.drone.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. kind: pipeline
  2. name: default
  3. type:
  4. steps:
  5. - name: build
  6. image: maven:3.8.1-openjdk-8
  7. volumes:
  8. - name: cache # The Volume's name
  9. path: /root/.m2 # The path in the container
  10. commands:
  11. #- mvn help:effective-settings # check maven
  12. - ls -hl /root/.m2/
  13. - mvn -version
  14. - java -version
  15. - mvn help:effective-settings
  16. - mvn clean package -DskipTests
  17. - pwd
  18. - ls -hl
  19. - ls -hl railway-admin
  20. - ls -hl railway-admin/target
  21. - pkill -9 java
  22. #- name: docker
  23. # image: plugins/docker
  24. # volumes:
  25. # - name: dockersock
  26. # path: /var/run/docker.sock
  27. ## settings:
  28. # username: iamsee
  29. # password: zhuotong
  30. # from_secret: zhuotong
  31. # debug: true
  32. # launch_debug: true
  33. #insecure: true
  34. # mirror: https://mgjrzxtn.mirror.aliyuncs.com
  35. # #registry: 192.168.1.100:10000
  36. # repo: iamsee/railway-admin
  37. # purge: true
  38. # tags:
  39. # - ${DRONE_COMMIT_SHA:1.0.0}
  40. # - ${DRONE_COMMIT}
  41. # - v1
  42. # - latest
  43. - name: scp_files
  44. image: appleboy/drone-scp
  45. settings:
  46. host: 172.16.0.28
  47. username: root
  48. password: $Jgkj1234
  49. debug: true
  50. target: /www/wwwroot/railway.ninecase.top/release
  51. source: railway-admin/target/railway-admin.jar
  52. rm: true
  53. - name: deploy
  54. image: appleboy/drone-ssh
  55. settings:
  56. host: drone.ninecase.top
  57. username: root
  58. password: $Jgkj1234
  59. debug: true
  60. script:
  61. - export PATH=/usr/local/bin:$PATH
  62. - echo $PATH
  63. - export LANG="en_US.UTF-8"
  64. - pkill -9 java
  65. - nohup java -jar /www/wwwroot/railway.ninecase.top/release/railway-admin/target/railway-admin.jar --spring.profiles.active=dev -Ddruid.mysql.usePingMethod=false > /www/wwwroot/railway.iamsee.com/out.log 2>&1 &
  66. trigger:
  67. branch:
  68. - master
  69. volumes:
  70. - name: cache # The name use in this pipeline,
  71. host:
  72. path: /tmp/cache # The path be used in the host.
  73. - name: dockersock
  74. host:
  75. path: /var/run/docker.sock