Skip to content
Snippets Groups Projects
Commit 61f60234 authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

Update .build-container.yml

parent d2dd1275
No related branches found
No related tags found
1 merge request!90Develop
Pipeline #67302 failed
image: docker:19.03.12
services:
- docker:19.03.12-dind
......@@ -7,27 +6,19 @@ variables:
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_IMAGE_SHA: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
build:docker:
.deploy: &deploy
before_script:
- echo "override global before script"
image: docker:19.03.12
stage: build
tags:
- dind
rules:
- if: $CI_COMMIT_BRANCH == "develop"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- >
docker build \
--build-arg GITLAB_USER=$GO_MODULES_USER \
--build-arg GITLAB_TOKEN=$GO_MODULES_ACCESS_TOKEN \
-t $DOCKER_IMAGE_SHA .
.deploy: &deploy
stage: deploy
needs: ["build:docker"]
tags:
- baremetal
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker tag $DOCKER_IMAGE_SHA $TAG
- docker push $TAG
......@@ -50,11 +41,18 @@ deploy:latest:
<<: *deploy
.deploy:mr: &deploy-mr
stage: deploy
needs: ["build:docker"]
before_script:
- echo "override global before script"
image: docker:19.03.12
stage: build
tags:
- baremetal
- dind
script:
- >
docker build \
--build-arg GITLAB_USER=$GO_MODULES_USER \
--build-arg GITLAB_TOKEN=$GO_MODULES_ACCESS_TOKEN \
-t $DOCKER_IMAGE_SHA .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker tag $DOCKER_IMAGE_SHA $TAG
- docker push $TAG
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment