.gitlab-ci.yml 678 Bytes
Newer Older
Antoine Roux's avatar
Antoine Roux committed
1 2 3 4 5
image: docker:latest

before_script:
  - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY

Antoine Roux's avatar
Antoine Roux committed
6 7 8 9
variables:
  DOCKER_IMAGE_FULLNAME: $CI_REGISTRY/$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG

build:
Antoine Roux's avatar
Antoine Roux committed
10 11
  stage: build
  script:
Antoine Roux's avatar
Antoine Roux committed
12 13
    - docker build --pull -t "$DOCKER_IMAGE_FULLNAME" .
    - docker push "$DOCKER_IMAGE_FULLNAME"
14 15
  only:
    - tags
Antoine Roux's avatar
Antoine Roux committed
16

Antoine Roux's avatar
Antoine Roux committed
17 18 19 20 21
deploy:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  image: docker-registry.esrf.fr/cs/ci-deploy
Antoine Roux's avatar
Antoine Roux committed
22
  script:
Antoine Roux's avatar
Antoine Roux committed
23 24
    - deploy "$DOCKER_IMAGE_FULLNAME" "production"
    - retag "$DOCKER_IMAGE_FULLNAME" "production"
Antoine Roux's avatar
Antoine Roux committed
25 26 27 28
  environment:
    name: production
    url: https://datahub.esrf.fr/
  when: manual
29 30
  only:
    - tags