Deployments

February 27, 2019 ยท View on GitHub

The docker images which have been build can also be pushed to a docker registry by InfraBox.

Docker Registry

You would add a deployment to your job:

{
    "type": "docker",
    ...
    "deployments": [{
        "type": "docker-registry",
        "host": "<my_registry>:5000",
        "repository": "repo-name",
        "tag": "some optional tag",
        "target": "target build stage",
        "always_push": "true or false",
        "username": "your_username",
        "password": { "$secret": "SECRET_NAME_FOR_YOUR_PASSWORD" }
    }]
}

Deployments are currently only supported for docker job types.

NameRequiredTypeDefaultDescription
typetruestringHas to be "docker-registry"
hosttruestringHost of the registry. I.e. my-registry.com:5000
repositorytruestringName of the repository
tagfalsestringbuild_<NUMBER>The tag of the image
targetfalsestringWhen building a Dockerfile with multiple build stages target can be used to specify an intermediate build stage by name as a final stage for the resulting image which should be deployed
always_pushfalseboolfalseAlways deploy image, even if container run failed.
usernamefalsestringUsername to be used with the registry
passwordfalseSecretSecret containing the password

ECR

You would add a deployment to your job:

{
    "type": "docker",
    ...
    "deployments": [{
        "type": "ecr",
        "host": "<my_registry>",
        "repository": "repo-name",
        "tag": "some optional tag",
        "target": "target build stage",
        "region": "region",
        "access_key_id": { "$secret": "SECRET_KEY_ID" },
        "secret_access_key": { "$secret": "SECRET_ACCESS_KEY" }
    }]
}

Deployments are currently only supported for docker job types.

NameRequiredTypeDefaultDescription
typetruestringHas to be "ecr"
hosttruestringECR endpoint
repositorytruestringName of the repository
tagfalsestringbuild_<NUMBER>The tag of the image
targetfalsestringWhen building a Dockerfile with multiple build stages target can be used to specify an intermediate build stage by name as a final stage for the resulting image which should be deployed
regiontruestringAWS Region
access_key_idtrueSecretSecret containing the AWS Access Key ID
secret_access_keytrueSecretSecret containing AWS Secret Access Key

GCR

You would add a deployment to your job:

{
    "type": "docker",
    ...
    "deployments": [{
        "type": "gcr",
        "host": "eu.gcr.io",
        "repository": "<project-id>/<repo-name>",
        "tag": "some optional tag",
        "target": "target build stage",
        "service_account": { "$secret": "GCP_SERVICE_ACCOUNT" },
    }]
}

Deployments are currently only supported for docker job types.

NameRequiredTypeDefaultDescription
typetruestringHas to be "gcr"
hosttruestringGCR endpoint i.e. us.gcr.io
repositorytruestringName of the repository
tagfalsestringbuild_<NUMBER>The tag of the image
targetfalsestringWhen building a Dockerfile with multiple build stages target can be used to specify an intermediate build stage by name as a final stage for the resulting image which should be deployed
service_accounttrueSecretSecret containing the GCP Service Account with role Storage Admin