def read_configs(self):
        self.odcs_config = get_config(self.workflow).get_odcs_config()
        if not self.odcs_config:
            raise SkipResolveComposesPlugin('ODCS config not found')

        data = self.workflow.source.config.compose
        if not data and not self.all_compose_ids:
            raise SkipResolveComposesPlugin(
                '"compose" config not set and compose_ids not given')

        pulp_data = util.read_content_sets(self.workflow) or {}

        platforms = get_platforms(self.workflow)
        if platforms:
            platforms = sorted(
                platforms)  # sorted to keep predictable for tests

        koji_tag = None
        if self.koji_target:
            target_info = self.koji_session.getBuildTarget(self.koji_target,
                                                           strict=True)
            koji_tag = target_info['build_tag_name']

        self.compose_config = ComposeConfig(data,
                                            pulp_data,
                                            self.odcs_config,
                                            koji_tag=koji_tag,
                                            arches=platforms)
Exemple #2
0
 def _populate_content_sets(self):
     """
     Get the list of the current platform's content_sets from
     'content_sets.yml' in dist-git, and set `self.content_sets` to same.
     """
     current_platform = self.workflow.user_params['platform']
     content_sets = read_content_sets(self.workflow) or {}
     self.content_sets = content_sets.get(current_platform, [])
     self.log.debug('Output content_sets: %s', self.content_sets)
Exemple #3
0
    def make_icm(self, platform: str) -> dict:
        """Create the complete ICM document for the specified platform."""
        icm = deepcopy(self._icm_base)

        content_sets = read_content_sets(self.workflow) or {}
        icm['content_sets'] = content_sets.get(platform, [])

        self.log.debug('Output ICM content_sets: %s', icm['content_sets'])
        self.log.debug('Output ICM metadata: %s', icm['metadata'])

        # Validate; `json.dumps()` converts `icm` to str. Confusingly, `read_yaml`
        #     *will* validate JSON
        read_yaml(json.dumps(icm), 'schemas/content_manifest.json')
        return icm
Exemple #4
0
 def validate_user_config_files(self):
     """Validate some user config files"""
     read_fetch_artifacts_koji(self.workflow)
     read_fetch_artifacts_pnc(self.workflow)
     read_fetch_artifacts_url(self.workflow)
     read_content_sets(self.workflow)