Skip to content
Snippets Groups Projects
Commit e3fcfb5f authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Merge branch 'fix_versioned_images' into 'master'

Use new CI variables and push the correct tag with build images.

See merge request !37
parents 4c89bab6 bdd9d383
No related branches found
No related tags found
1 merge request!37Use new CI variables and push the correct tag with build images.
Loading
Loading
@@ -7,14 +7,14 @@ variables:
DOCKER_DRIVER: overlay
 
before_script:
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
 
.test_build: &test_build
stage: test
script:
# Hack to set an array in /bin/sh
# http://unix.stackexchange.com/a/137571
- set -- $CI_BUILD_NAME
- set -- $CI_JOB_NAME
- cd docker && docker build -f "Dockerfile_$1" .
except:
- tags
Loading
Loading
@@ -22,8 +22,8 @@ before_script:
.build_and_deploy: &build_and_deploy
stage: build
script:
- cd docker && docker build -t "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME-$CI_COMMIT_TAG" -f "Dockerfile_$CI_BUILD_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME"
- cd docker && docker build -t "$CI_REGISTRY_IMAGE:$CI_JOB_NAME-$CI_COMMIT_TAG" -f "Dockerfile_$CI_JOB_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_JOB_NAME-$CI_COMMIT_TAG"
only:
- tags
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment