.gitlab-ci.yml 2.26 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
variables:
  GHOST_API: https://ghost-intothesky.alpha.grandlyon.com/ghost/api
  #GHOST_ADMIN_API_KEY:
  INDEXER__ES_URL: https://elastic2.alpha.grandlyon.com
  INDEXER__ES_POSTS_INDEX: posts.ingest.v5
  INDEXER__ES_PAGES_INDEX: pages.ingest.v5
  REINDEXER__ES_SOURCE_URL: https://elastic2.alpha.grandlyon.com:443
  REINDEXER__ES_DESTINATION_URL: https://elastic2.alpha.grandlyon.com
  REINDEXER__SOURCE_POSTS_INDEX: posts.ingest.v5
  REINDEXER__SOURCE_PAGES_INDEX: pages.ingest.v5
  REINDEXER__DESTINATION_POSTS_INDEX: posts.v5
  REINDEXER__DESTINATION_PAGES_INDEX: pages.v5
  REINDEXER__POSTS_TEMPLATE_NAME: ghost-posts-template
  REINDEXER__PAGES_TEMPLATE_NAME: ghost-pages-template

stages:
  - build
  - deploy

build_development:
  stage: build
  only:
    - development
  script:
    - export TAG=dev
    - export CONTENT_INDEXER_BIND_PORT=4000
    - docker-compose build
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose push

build_release:
  stage: build
  only:
    - tags
  except:
    - /^(?!master).+@/
  script:
    - export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
    - export CONTENT_INDEXER_BIND_PORT=4000
    - docker-compose build
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose push

deploy_development:
  stage: deploy
  only:
    - development
  script:
    - export TAG=dev
    - export CONTENT_INDEXER_BIND_PORT=4000
51
    - envsubst < config.template.yaml > config.yaml
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker-compose pull
    - docker-compose --project-name service-email-${TAG} up -d --force-recreate
  environment:
    name: development

deploy_staging:
  stage: deploy
  only:
    - development
  when: manual
  script:
    - export TAG=staging
    - export CONTENT_INDEXER_BIND_PORT=4100
    - envsubst < config.template.yml > config.yml
    - 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}
    - docker-compose --project-name service-email-${TAG} up -d --force-recreate
  environment:
    name: staging