Update .gitlab-ci.yml

environments/production/deployments/1
Theenoro 2018-09-05 13:47:30 +02:00
parent 2311612cae
commit 1eed39c5b7
1 changed files with 6 additions and 31 deletions

View File

@ -1,19 +1,16 @@
stages:
- setup
- build
- deploy
- cleanup
image: node:8.11.4
setup:
stage: setup
build:
stage: build
only:
- master
tags:
- prod
script:
- eval $(ssh-agent -s)
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
@ -22,35 +19,13 @@ setup:
- export SSH_U=$(echo $SSH_USER)
- export SSH_S=$(echo $SSH_SERVER)
- npm install --save
build:
stage: build
only:
- master
tags:
- prod
script:
- npm run build
deploy:
stage: deploy
only:
- master
tags:
- prod
script:
after_script:
- export c=$PWD
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SSH_U@$SSH_S 'rm -rf $HOME/wbm/*'
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r $c/build/* $SSH_U@$SSH_S:/home/$SSH_U/wbm
- rm -rf ./*
environment:
name: production
url: https://wbm.lucajaents.ch
cleanup:
tags:
- prod
only:
- master
stage: cleanup
script:
- rm -rf ./*