Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. stages:
  2. - build
  3. - test
  4. - deploy
  5.  
  6. variables:
  7. MYSQL_DATABASE: test
  8. MYSQL_USERNAME: root
  9. MYSQL_ROOT_PASSWORD: root
  10.  
  11. build:
  12. stage: build
  13. image: node
  14. script:
  15. - npm install
  16. - npm run production
  17. cache:
  18. paths:
  19. - ./node_modules
  20. artifacts:
  21. expire_in: 1 hour
  22. paths:
  23. - public/css
  24. - public/js
  25. only:
  26. - master
  27.  
  28.  
  29. test:
  30. stage: test
  31. image: thecodingmachine/php:7.2-v1-fpm
  32. services:
  33. - mysql:5.7
  34. script:
  35. - composer install
  36. - cp .env.example .env
  37. - php artisan key:generate
  38. - php artisan migrate
  39. - php artisan db:seed
  40. - php vendor/bin/phpunit
  41. cache:
  42. paths:
  43. - ./node_modules
  44. - ./vendor
  45. only:
  46. - master
  47.  
  48.  
  49. deploy:
  50. stage: deploy
  51. image: node
  52. dependencies:
  53. - build
  54. before_script:
  55. - 'which ssh-agent || ( apk add --update openssh-client rsync bash )'
  56. - eval $(ssh-agent -s)
  57. - bash -c "ssh-add <(echo '$SERVER_SSH_KEY')"
  58. - mkdir -p ~/.ssh
  59. - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  60. script:
  61. - ssh root@92.222.90.200 "cd /home/ubuntu/iim-avatar/ && git pull origin master"
  62. - scp -rp ./public/css/ root@92.222.90.200:/home/ubuntu/iim-avatar/public/
  63. - scp -rp ./public/js/ root@92.222.90.200:/home/ubuntu/iim-avatar/public/
  64. - ssh root@92.222.90.200 "docker restart iim-avatar"
  65. only:
  66. - master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement