def test_validate_full_schema(self, _):
        conf = {**takeoff_config(),
                **BASE_CONF, **{
                "dockerfiles": [{
                    "file": "Dockerfile_custom",
                    "postfix": "Dave",
                    "custom_image_name": "Mustaine"
                }]}}

        DockerImageBuilder(ApplicationVersion("dev", "v", "branch"), conf)
Esempio n. 2
0
    def test_validate_minimal_schema(self, _):
        conf = {**takeoff_config(), **BASE_CONF}

        res = DockerImageBuilder(ApplicationVersion("dev", "v", "branch"),
                                 conf)
        assert res.config['dockerfiles'] == [{
            "file": "Dockerfile",
            "postfix": None,
            "prefix": None,
            "custom_image_name": None,
            'tag_release_as_latest': True
        }]
Esempio n. 3
0
def victim_release() -> DockerImageBuilder:
    with mock.patch("takeoff.build_docker_image.DockerRegistry.credentials", return_value=CREDS), \
         mock.patch("takeoff.step.ApplicationName.get", return_value="myapp"):
        conf = {**takeoff_config(), **BASE_CONF}
        return DockerImageBuilder(ApplicationVersion('PRD', '2.1.0', 'master'),
                                  conf)