.gitlab-ci.yml 2.63 KB
Newer Older
1
2
3
4
stages:
  - build
  - deploy

5
variables:
6
7
  LEGACY_AUTH_SERVICE_URL: https://download.data.grandlyon.com/auth
  ADMIN_USERNAME: data-beta-grandlyon-com
8
  USER_SUPPORT_MAILBOX: alpha-test@erasme.org
9
  ACCESS_TOKEN_COOKIE_KEY: access_token
10

11
12
13
build_development:
  stage: build
  only:
14
    - development
15
  script:
FORESTIER Fabien's avatar
FORESTIER Fabien committed
16
    - export TAG=dev
17
    - export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
18
19
20
    - export REDIS_SENTINEL_PORT=26379
    - export REDIS_SLAVE_PORT=6380
    - export REDIS_MASTER_PORT=6379
FORESTIER Fabien's avatar
FORESTIER Fabien committed
21
    - docker-compose build 
22
23
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose push
24

25
26
27
28
build_release:
  stage: build
  only:
    - tags
29
30
  # except:
  #   - /^(?!master).+@/
31
32
33
  script:
    - export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
    - export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
34
35
36
    - export REDIS_SENTINEL_PORT=26379
    - export REDIS_SLAVE_PORT=6380
    - export REDIS_MASTER_PORT=6379
37
38
39
40
    - docker-compose build
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose push

41
42
43
deploy_development:
  stage: deploy
  only:
44
    - development
45
  script:
FORESTIER Fabien's avatar
FORESTIER Fabien committed
46
    - export TAG=dev
47
    - export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3004
48
49
50
    - export REDIS_SENTINEL_PORT=26379
    - export REDIS_SLAVE_PORT=6380
    - export REDIS_MASTER_PORT=6379
51
52
53
    - export SERVICE_EMAIL_URL=http://vm-refonte-data-2:9000/email
    - export FRONT_END_URL=https://data-reloaded-dev.alpha.grandlyon.com/fr
    - export API_KEY=$DEV_API_KEY
54
55
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose pull
56
57
58
    - docker-compose --project-name middleware-legacy-auth-${TAG} up -d --force-recreate
  environment:
    name: development
59
60
61
62

deploy_staging:
  stage: deploy
  only:
63
    - development
64
  when: manual
65
  script:
66
    - export TAG=staging
67
    - export MIDDLEWARE_LEGACY_SERVICE_BIND_PORT=3104
68
69
70
    - export REDIS_SENTINEL_PORT=26479
    - export REDIS_SLAVE_PORT=6480
    - export REDIS_MASTER_PORT=6479
71
72
73
    - export SERVICE_EMAIL_URL=http://vm-refonte-data-2:9100/email
    - export FRONT_END_URL=https://data-reloaded-rec.alpha.grandlyon.com/fr
    - export API_KEY=$REC_API_KEY
74
75
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - TAG=dev docker-compose pull
76
77
78
    - export REGISTRY_PATH=web-et-numerique/web-et-numerique-internet/data.grandlyon.com/web-portal/components/middlewares/legacy-auth
    - docker tag $CI_REGISTRY/$REGISTRY_PATH:dev $CI_REGISTRY/$REGISTRY_PATH:${TAG}
    - docker push $CI_REGISTRY/$REGISTRY_PATH:${TAG}
79
80
81
    - docker-compose --project-name middleware-legacy-auth-${TAG} up -d --force-recreate
  environment:
    name: staging
82