def build( build_info, ci_image_type, group_name, group_version, target, push, dry_run, progress, ): """Builds a ci-package or ci-image docker image. """ if push == "YES": pushb = True elif push == "AUTO": pushb = utils.get_docker_push(build_info.repo_uri, build_info.source_branch) else: pushb = False b = builder.Builder( build_info=build_info, group_info=builder.GroupInfo( type_=constants.ImageType[ci_image_type], names=group_name.split(","), versions=group_version.split(","), target=target, ), push=pushb, ) b.build(dry_run=dry_run, progress=progress)
def test_package_baseqt_2019_dict(self): b = builder.Builder( self.build_info, builder.GroupInfo( names=["baseqt"], versions=["2019"], type_=constants.ImageType.PACKAGE, ), ) self.assertEqual( b.make_bake_dict(), { "group": { "default": { "targets": ["package-qt-2019"] } }, "target": { "package-qt-2019": { "context": ".", "dockerfile": "packages/Dockerfile", "args": { "ASWF_ORG": "aswflocaltesting", "ASWF_PKG_ORG": "aswftesting", "ASWF_VERSION": constants.VERSIONS[constants.ImageType.PACKAGE] ["qt"][1], "BUILD_DATE": constants.DEV_BUILD_DATE, "CI_COMMON_VERSION": "1", "DTS_VERSION": "6", "PYTHON_VERSION": "2.7", "VCS_REF": constants.DEV_BUILD_DATE, "VFXPLATFORM_VERSION": "2019", }, "tags": [ f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:2019", f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:{constants.VERSIONS[constants.ImageType.PACKAGE]['qt'][1]}", f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-package-qt:latest", ], "target": "ci-qt-package", "output": ["type=docker"], } }, }, )
def build( build_info, ci_image_type, group_name, group_version, target, push, dry_run, progress, ): """Builds a ci-package or ci-image docker image. """ b = builder.Builder( build_info=build_info, group_info=builder.GroupInfo( type_=constants.ImageType[ci_image_type], name=group_name, version=group_version, target=target, ), push=push, ) b.build(dry_run=dry_run, progress=progress)
def test_image_base_2019_dict(self): b = builder.Builder( self.build_info, builder.GroupInfo( name="base", version="2019", type_=constants.ImageType.IMAGE, ), ) self.assertEqual( b.make_bake_dict(), { "group": {"default": {"targets": ["image-base"]}}, "target": { "image-base": { "context": ".", "dockerfile": "ci-base/Dockerfile", "args": { "ASWF_ORG": "aswflocaltesting", "ASWF_PKG_ORG": "aswftesting", "ASWF_VERSION": constants.VERSIONS[ constants.ImageType.IMAGE ]["base"][1], "BUILD_DATE": constants.DEV_BUILD_DATE, "CI_COMMON_VERSION": "1", "PYTHON_VERSION": "2.7", "VCS_REF": constants.DEV_BUILD_DATE, "VFXPLATFORM_VERSION": "2019", }, "tags": [ f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:2019", f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:{constants.VERSIONS[constants.ImageType.IMAGE]['base'][1]}", f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:latest", ], "output": ["type=docker"], } }, }, )