fix(CI): MàJ du fichier .gitlab-ci.yml

This commit is contained in:
Olivier DOSSMANN 2024-05-12 17:40:08 +00:00
parent c42584f401
commit 4578e39c2d

View File

@ -1,23 +1,29 @@
image: docker:stable image: docker:cli
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services: services:
- docker:dind - docker:dind
stages: stages:
- build - build
- deploy
build: build:
stage: build stage: build
script: script:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG . - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG .
# Run this job in a branch where a Dockerfile exists
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile
deploy:
stage: deploy
script:
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
tags:
- docker
only: only:
- tags - tags
when: on_success
after_script:
- docker images --filter "dangling=true" -q --no-trunc | xargs -r docker rmi