.gitlab-ci.yml 1.29 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
    - npm run clean
    - npm run build
Rosanny Sihombing's avatar
Rosanny Sihombing committed
7
8
9
10
11
12
    - 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
Rosanny Sihombing's avatar
Rosanny Sihombing committed
13
14
15
16
    - 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:
    - npm install
Wolfgang Knopki's avatar
Wolfgang Knopki committed
29
30
31
32
33
34
35
36
    - 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
37
    - cat $configfileprod > ./built/config/config.js
Wolfgang Knopki's avatar
Wolfgang Knopki committed
38
39
40
    - cat $cert > ./built/routes/cert/cert.pem
    - cat $certidp > ./built/routes/cert/cert_idp.pem
    - cat $key > ./built/routes/cert/key.pem
Wolfgang Knopki's avatar
Wolfgang Knopki committed
41
    - "pm2 delete --silent account || :"
Wolfgang Knopki's avatar
Wolfgang Knopki committed
42
    - pm2 start ./built/app.js --name=account
Wolfgang Knopki's avatar
Wolfgang Knopki committed
43
44
45
46
    - pm2 save
  tags: 
    - production
  only: 
Wolfgang Knopki's avatar
Wolfgang Knopki committed
47
    - master