Skip to content
Snippets Groups Projects
.gitlab-ci.yml 931 B
Newer Older
Hugo NOUTS's avatar
Hugo NOUTS committed
image: docker:git

services:
  - docker:dind

Hugo NOUTS's avatar
Hugo NOUTS committed
variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ""

Hugo NOUTS's avatar
Hugo NOUTS committed
stages:
  - build
Hugo's avatar
Hugo committed
  - deploy
Hugo NOUTS's avatar
Hugo NOUTS committed

build_master:
  stage: build
Hugo's avatar
Hugo committed
  tags:
Hugo's avatar
Hugo committed
    - build-push-to-registry
Hugo NOUTS's avatar
Hugo NOUTS committed
  only:
    - master
  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - docker build -t registry.forge.grandlyon.com/web-et-numerique/factory/llle_project/self-data-technical-doc .
    - docker push registry.forge.grandlyon.com/web-et-numerique/factory/llle_project/self-data-technical-doc
Hugo's avatar
Hugo committed

deploy_master:
  stage: deploy
  tags:
Bastien DUMONT's avatar
Bastien DUMONT committed
    - deploy-alpha
Hugo's avatar
Hugo committed
  only:
    - master
  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - docker-compose pull
Hugo NOUTS's avatar
ci  
Hugo NOUTS committed
    - docker-compose up -d self_data_docs
Hugo NOUTS's avatar
Hugo NOUTS committed
    - docker rmi $(docker images 'registry.forge.grandlyon.com/web-et-numerique/factory/llle_project/self-data-technical-doc' -f "dangling=true" -q)