.gitlab-ci.yml 1 KB
Newer Older
Wolfgang Knopki's avatar
Wolfgang Knopki committed
1
deploy-testing:    
Rosanny Sihombing's avatar
Rosanny Sihombing committed
2
3
4
  stage: deploy
  script:
    - npm install
Rosanny Sihombing's avatar
Rosanny Sihombing committed
5
6
7
8
9
10
11
12
13
14
15
16
    - npm run clean
    - npm run build
    - rm -rf built/public/default
    - rm -rf built/routes/cert
    - rm -rf built/views
    - cp -R public/default /built/public
    - cp -R routes/cert built/routes
    - cp -R views built
    - cat $configfiledev > ./built/config/config.js
    - cat $cert > ./built/routes/cert/cert.pem
    - cat $certidp > ./built/routes/cert/cert_idp.pem
    - cat $key > ./built/routes/cert/key.pem
Rosanny Sihombing's avatar
Rosanny Sihombing committed
17
    - "pm2 delete --silent account || :"
Rosanny Sihombing's avatar
Rosanny Sihombing committed
18
    - pm2 start ./built/app.js --name=account
Rosanny Sihombing's avatar
Rosanny Sihombing committed
19
20
21
22
    - pm2 save
  tags: 
    - testing
  only: 
23
    - testing
Wolfgang Knopki's avatar
Wolfgang Knopki committed
24
25
26
27
28

deploy-master:    
  stage: deploy
  script:
    - cat $configfileprod > ./config/config.js
29
30
31
    - cat $cert > ./routes/cert/cert.pem
    - cat $certidp > ./routes/cert/cert_idp.pem
    - cat $key > ./routes/cert/key.pem
Wolfgang Knopki's avatar
Wolfgang Knopki committed
32
33
34
35
36
37
38
39
    - npm install
    - "pm2 delete --silent account || :"
    - pm2 start ./app.js --name=account
    - pm2 save
  tags: 
    - production
  only: 
    - master