.gitlab-ci.yml 1.85 KB
Newer Older
ncastejon's avatar
ncastejon committed
1
2
3
4
stages:
  - build
  - deploy

5
6
7
variables:
  USER_SUPPORT_MAILBOX: alpha-test@erasme.org

8
build_development:
ncastejon's avatar
ncastejon committed
9
10
  stage: build
  only:
11
    - development
ncastejon's avatar
ncastejon committed
12
  script:
13
    - export TAG=dev
14
    - export MAIL_SERVICE_BIND_PORT=3000
15
    - export RABBITMQ_LISTENING_PORT=5672
16
    - export RABBITMQ_GUI_PORT=15672
17
18
19
    - docker-compose build 
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose push
ncastejon's avatar
ncastejon committed
20

21
22
23
24
25
26
27
build_release:
  stage: build
  only:
    - tags
  except:
    - /^(?!master).+@/
  script:
Alessandro CERIONI's avatar
Bugfix.    
Alessandro CERIONI committed
28
    - export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
29
    - export MAIL_SERVICE_BIND_PORT=3000
30
    - export RABBITMQ_LISTENING_PORT=5672
31
32
33
34
35
    - export RABBITMQ_GUI_PORT=15672
    - docker-compose build
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose push
    
36
deploy_development:
ncastejon's avatar
ncastejon committed
37
38
  stage: deploy
  only:
39
    - development
ncastejon's avatar
ncastejon committed
40
  script:
41
    - export TAG=dev
42
    - export MAIL_SERVICE_BIND_PORT=3001
43
    - export RABBITMQ_LISTENING_PORT=5672
44
    - export RABBITMQ_GUI_PORT=15672
45
46
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose pull
47
48
49
    - docker-compose --project-name service-email-${TAG} up -d --force-recreate
  environment:
    name: development
50
51
52
53

deploy_staging:
  stage: deploy
  only:
54
    - development
55
  when: manual
56
  script:
57
    - export TAG=staging
58
    - export MAIL_SERVICE_BIND_PORT=3101
59
    - export RABBITMQ_LISTENING_PORT=5673
60
    - export RABBITMQ_GUI_PORT=15673
61
62
63
64
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - TAG=dev docker-compose pull
    - docker tag $CI_REGISTRY/refonte-data/service-email:dev $CI_REGISTRY/refonte-data/service-email:${TAG}
    - docker push $CI_REGISTRY/refonte-data/service-email:${TAG}
65
66
67
    - docker-compose --project-name service-email-${TAG} up -d --force-recreate
  environment:
    name: staging