My personal website https://leviolson.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.0 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # This file is a template, and might need editing before it works on your project.
  2. # Official framework image. Look for the different tagged releases at:
  3. # https://hub.docker.com/r/library/node/tags/
  4. image: node:latest
  5. cache:
  6. paths:
  7. - node_modules/
  8. stages:
  9. - test
  10. - deploy
  11. before_script:
  12. - apt-get update -qq && apt-get install -y -qq sshpass
  13. test_coverage:
  14. stage: test
  15. script:
  16. - npm install
  17. - npm install --global mocha nyc
  18. - npm run coverage
  19. deploy_prod:
  20. stage: deploy
  21. script:
  22. - echo "Deploying to Production"
  23. - npm install
  24. - sshpass -V
  25. - export SSHPASS=$SSH_PASS
  26. - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  27. - 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"
  28. environment:
  29. name: production
  30. url: https://leviolson.com
  31. only:
  32. - master