Update .gitlab-ci.yml

environments/production/deployments/1
Theenoro 2018-09-05 13:39:08 +02:00
parent e5a7995f35
commit fb4f5bb4e0
1 changed files with 6 additions and 8 deletions

View File

@ -4,10 +4,11 @@ stages:
- deploy - deploy
- cleanup - cleanup
image: node:8.11.4
setup: setup:
image: node:8.11.4
only: master only: master
tag: prod tags: prod
script: script:
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
@ -20,18 +21,16 @@ setup:
- npm install --save - npm install --save
build: build:
image: node:8.11.4
stage: build stage: build
only: master only: master
tag: prod tags: prod
script: script:
- npm run build - npm run build
deploy: deploy:
image: node:8.11.4
stage: deploy stage: deploy
only: master only: master
tag: prod tags: prod
script: script:
- export c=$PWD - export c=$PWD
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SSH_U@$SSH_S 'rm -rf $HOME/wbm/*' - ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SSH_U@$SSH_S 'rm -rf $HOME/wbm/*'
@ -41,8 +40,7 @@ deploy:
url: https://wbm.lucajaents.ch url: https://wbm.lucajaents.ch
cleanup: cleanup:
image: node:8.11.4 tags: prod
tag: prod
stage: cleanup stage: cleanup
script: script:
- rm -rf ./* - rm -rf ./*