.drone.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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:
  51. - /www/wwwroot/railway.ninecase.top/release
  52. - /www/wwwroot/railway.ninecase.top/release
  53. source:
  54. - railway-admin/target/railway-admin.jar
  55. - Dockerfile
  56. rm: true
  57. - name: deploy
  58. image: appleboy/drone-ssh
  59. settings:
  60. host: 172.16.0.28
  61. username: root
  62. password: $Jgkj1234
  63. debug: true
  64. script:
  65. - export PATH=/usr/local/bin:$PATH
  66. - echo $PATH
  67. - export LANG="en_US.UTF-8"
  68. - pkill -9 java
  69. - 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.ninecase.top/out.log 2>&1 &
  70. - name: deploy-build-image
  71. image: appleboy/drone-ssh
  72. settings:
  73. host: 172.16.0.28
  74. username: root
  75. password: $Jgkj1234
  76. debug: true
  77. script:
  78. - cd /www/wwwroot/railway.ninecase.top/release
  79. - docker build -t iamsee/railway-admin:1.0.0 .
  80. - docker save -o railway-admin@1.0.0.tar iamsee/railway-admin:1.0.0
  81. trigger:
  82. branch:
  83. - 20221201
  84. volumes:
  85. - name: cache # The name use in this pipeline,
  86. host:
  87. path: /tmp/cache # The path be used in the host.
  88. - name: dockersock
  89. host:
  90. path: /var/run/docker.sock