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

5
6
variables:
  USER_SUPPORT_MAILBOX: alpha-test@erasme.org
FORESTIER Fabien's avatar
FORESTIER Fabien committed
7
  # ADDITIONAL_FEEDBACK_EMAILS: 
8

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

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

deploy_staging:
  stage: deploy
  only:
57
    - development
58
  when: manual
59
  script:
60
    - export TAG=staging
61
    - export MAIL_SERVICE_BIND_PORT=3101
62
    - export RABBITMQ_LISTENING_PORT=5673
63
    - export RABBITMQ_GUI_PORT=15673
FORESTIER Fabien's avatar
FORESTIER Fabien committed
64
    - export MAIL_SUBJECT_PREFIX=alpha
65
    - export NO_REPLY_MAIL_ADDRESS=no-reply@erasme.org
66
67
68
69
    - 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}
70
71
72
    - docker-compose --project-name service-email-${TAG} up -d --force-recreate
  environment:
    name: staging