Browse Source

Update ci

post_vjs2
Levi Olson 6 years ago
parent
commit
433f714b08
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      .gitlab-ci.yml

+ 9
- 6
.gitlab-ci.yml View File

@ -7,6 +7,14 @@ cache:
paths: paths:
- node_modules/ - node_modules/
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIV_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
stages: stages:
- test - test
- deploy - deploy
@ -22,13 +30,8 @@ deploy_prod:
stage: deploy stage: deploy
script: script:
- echo "Deploying to Production" - echo "Deploying to Production"
- apt-get update -qq && apt-get install -y -qq sshpass
- npm install - npm install
- sshpass -V
- export SSHPASS=$SSH_PASS
- mkdir ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- sshpass -e ssh root@45.55.44.195 "cd /home/forge/leviolson-website && git pull && bash -c \"pm2 stop LeviOlson.com && pm2 delete LeviOlson.com && pm2 start app.js --name LeviOlson.com && pm2 logs --nostream --lines 2 LeviOlson.com && exit 0\" && exit 0"
- ssh root@206.189.236.142 "cd /opt/apps/leviolson.com && git pull && npm install && bash -c \"pm2 stop LeviOlson.com && pm2 delete LeviOlson.com && pm2 start app.js --name LeviOlson.com && pm2 logs --nostream --lines 2 LeviOlson.com && exit 0\" && exit 0"
environment: environment:
name: production name: production
url: https://leviolson.com url: https://leviolson.com

Loading…
Cancel
Save