My ham website
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.

39 lines
1.1 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
  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. before_script:
  9. - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  10. - eval $(ssh-agent -s)
  11. - echo "$SSH_PRIV_KEY" | tr -d '\r' | ssh-add - > /dev/null
  12. - mkdir -p ~/.ssh
  13. - chmod 700 ~/.ssh
  14. - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  15. stages:
  16. - test
  17. - deploy
  18. test_coverage:
  19. stage: test
  20. script:
  21. - npm install
  22. - npm install --global mocha nyc
  23. - npm run coverage
  24. deploy_prod:
  25. stage: deploy
  26. script:
  27. - echo "Deploying to Production"
  28. - npm install
  29. - ssh root@68.183.173.226 "cd /opt/website && git pull && npm install && bash -c \"pm2 stop LeviOlson && pm2 delete LeviOlson && pm2 start app.js --name LeviOlson --watch && pm2 logs --nostream --lines 2 LeviOlson && exit 0\" && exit 0"
  30. environment:
  31. name: production
  32. url: https://leviolson.com
  33. only:
  34. - master