diff --git a/ttm/manager.py b/ttm/manager.py index 3c3649a2a..482ea8c1d 100644 --- a/ttm/manager.py +++ b/ttm/manager.py @@ -72,6 +72,14 @@ def iso_build_version(self, project, tree, repo=None, arch=None): return result.group(1) raise NotFoundException(f"can't find {project} iso version") + def productcompose_build_version(self, project, tree, repo=None, arch=None): + for binary in self.binaries_of_product(project, tree, repo=repo, arch=arch): + result = re.match( + r'.*-(?:Build|Snapshot)([0-9.]+)(.report)', binary) + if result: + return result.group(1) + raise NotFoundException(f"can't find {project} productcompose version") + def version_from_totest_project(self): if len(self.project.main_products): return self.iso_build_version(self.project.test_project, self.project.main_products[0]) diff --git a/ttm/releaser.py b/ttm/releaser.py index 0e48341ba..861302b58 100644 --- a/ttm/releaser.py +++ b/ttm/releaser.py @@ -76,6 +76,11 @@ def version_from_project(self): return self.release_version() if len(self.project.main_products): + # 000productcompose has ftp built only and the build number + # agama-installer carry over build number from 000prodcutcompose + # but they are not from the same package container + if 'productcompose' in self.project.main_products[0]: + return self.productcompose_build_version(self.project.name, self.project.main_products[0]) return self.iso_build_version(self.project.name, self.project.main_products[0]) return self.iso_build_version(self.project.name, self.project.image_products[0].package, @@ -286,8 +291,12 @@ def _release(self, set_release=None): self.release_package(self.project.name, product, repository=self.project.product_repo) for cd in self.project.main_products: - self.release_package(self.project.name, cd, set_release=set_release, - repository=self.project.product_repo) + # do not set release number if it is productcompose + if 'productcompose' in self.project.main_products[0]: + self.release_package(self.project.name, cd, repository=self.project.product_repo) + else: + self.release_package(self.project.name, cd, set_release=set_release, + repository=self.project.product_repo) for cd in self.project.livecd_products: self.release_package('%s:Live' % @@ -296,7 +305,7 @@ def _release(self, set_release=None): for image in self.project.image_products: self.release_package(self.project.name, image.package, set_release=set_release, - repository=self.project.product_repo, + repository=getattr(self.project, 'totest_images_repo', self.project.product_repo), target_project=self.project.test_project, target_repository=self.project.totest_images_repo)