laravel.drone.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. pipeline:
  2. # load cache
  3. load-composer-cache:
  4. image: drillster/drone-volume-cache
  5. restore: true
  6. mount:
  7. - ./vendor
  8. volumes:
  9. # Mount the cache volume, needs "Trusted" | https://docs.drone.io/administration/user/admins/
  10. # DRONE_USER_CREATE=username:{alicfeng},admin:true
  11. # source path {/tmp/cache/composer need to mkdir on server}
  12. - /tmp/cache/composer:/cache
  13. # case test
  14. build-tests:
  15. image: lorisleiva/laravel-docker:7.3
  16. commands:
  17. - mv $(pwd)/.env.drone $(pwd)/.env
  18. - composer install -vvv
  19. - ./vendor/phpunit/phpunit/phpunit
  20. # rebuild compose cache
  21. rebuild-composer-cache:
  22. image: drillster/drone-volume-cache
  23. rebuild: true
  24. mount:
  25. - ./vendor
  26. volumes:
  27. - /tmp/cache/composer:/cache
  28. # deploy on dev env
  29. deploy-dev:
  30. image: appleboy/drone-ssh
  31. host: {$host}
  32. username: {$username}
  33. password: {$password}
  34. port: {$port}
  35. command_timeout: 30000s
  36. script:
  37. - cd /www/api.yi-insurance.com
  38. - git pull
  39. - /home/service/php/bin/php artisan config:cache
  40. - /home/service/php/bin/php artisan route:cache
  41. - /home/service/php/bin/php artisan optimize
  42. - supervisorctl reload
  43. when:
  44. event:
  45. - push
  46. branch:
  47. - master
  48. # notify by email
  49. notify:
  50. image: drillster/drone-email
  51. from: {email}
  52. host: {smtp.163.com}
  53. username: {email}
  54. password: {password}
  55. port: 465
  56. recipients:
  57. - {a@samego.com}