Commit 8f69e038 authored by Stan Hu's avatar Stan Hu

Merge branch 'docker-labels-for-builds' into 'master'

Use labels in docker builds

See merge request gitlab-org/gitlab-build-images!303
parents 7444de87 10c52533
...@@ -31,7 +31,7 @@ variables: ...@@ -31,7 +31,7 @@ variables:
.build_and_deploy: &build_and_deploy .build_and_deploy: &build_and_deploy
stage: build stage: build
script: script:
- docker build -t "$CI_REGISTRY_IMAGE:$CI_JOB_NAME" -f "Dockerfile.$CI_JOB_NAME" . - docker build --label "ci_pipeline_url=$CI_PIPELINE_URL" --label "ci_job_url=$CI_JOB_URL" -t "$CI_REGISTRY_IMAGE:$CI_JOB_NAME" -f "Dockerfile.$CI_JOB_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_JOB_NAME" - docker push "$CI_REGISTRY_IMAGE:$CI_JOB_NAME"
only: only:
- master - master
...@@ -49,7 +49,7 @@ variables: ...@@ -49,7 +49,7 @@ variables:
.build_and_deploy_custom: &build_and_deploy_custom .build_and_deploy_custom: &build_and_deploy_custom
stage: build stage: build
script: script:
- ./scripts/custom-docker-build $CI_JOB_NAME -t "$CI_REGISTRY_IMAGE:$CI_JOB_NAME" - ./scripts/custom-docker-build $CI_JOB_NAME --label "ci_pipeline_url=$CI_PIPELINE_URL" --label "ci_job_url=$CI_JOB_URL" -t "$CI_REGISTRY_IMAGE:$CI_JOB_NAME"
- push_if_needed "$CI_REGISTRY_IMAGE:$CI_JOB_NAME" - push_if_needed "$CI_REGISTRY_IMAGE:$CI_JOB_NAME"
only: only:
- master - master
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment