SE4 Virtualisation TP Wasilewski - Gitlab CI file
Aller à la navigation
Aller à la recherche
variables:
NOMAD_ADDR: http://10.99.99.96:4646
docker_registry: 10.99.99.97:5000
docker_image: web-$VMID
stages:
- build
- deploy
build:
stage: build
image: docker
tags:
- docker
script:
- tag=${docker_registry}/${docker_image}:${CI_COMMIT_SHORT_SHA}
- echo "building and pushing tag $tag"
- docker build -t ${tag} -f Dockerfile .
- docker push ${tag}
deploy:
stage: deploy
image: hendrikmaus/nomad-cli
tags:
- docker
script:
- apk add gettext
- envsubst '${CI_COMMIT_SHORT_SHA}' < project.nomad > job.nomad
- cat job.nomad
- nomad validate job.nomad
- nomad plan job.nomad || if [ $? -eq 255 ]; then exit 255; else echo "success"; fi
- nomad run job.nomad