This commit is contained in:
Mylloon 2021-07-27 22:59:04 +02:00
parent 1f5179ca4d
commit bc6b34a00e

View file

@ -3,13 +3,6 @@ stages:
- test
- deploy
variables:
# disable Docker TLS validation
DOCKER_TLS_CERTDIR: ""
# localhost address is shared by both the job container and the dind container (as they share the same Pod)
# So this configuration make the dind service as our Docker daemon when running Docker commands
DOCKER_HOST: "tcp://localhost:2375"
services:
- docker:stable-dind
@ -17,6 +10,16 @@ docker-build:
image: docker:stable
stage: build
script:
- docker build .
- docker tag registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:${CI_COMMIT_SHORT_SHA}
- docker push registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:${CI_COMMIT_SHORT_SHA}
- docker pull registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot-builder:latest || true
- docker pull registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:latest || true
- docker build --cache-from registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot-builder:latest --target builder -t hello-builder:latest .
- docker build --cache-from registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:latest --cache-from registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot-builder:latest -t hello:latest .
- docker tag hello-builder:latest registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot-builder:latest
- docker tag hello:latest registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:${CI_COMMIT_SHORT_SHA}
- docker tag hello:latest registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:latest
- docker push registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot-builder:latest
- docker push registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:${CI_COMMIT_SHORT_SHA}
- docker push registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:latest