.drone.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #- name: docker
  22. # image: plugins/docker
  23. # volumes:
  24. # - name: dockersock
  25. # path: /var/run/docker.sock
  26. ## settings:
  27. # username: iamsee
  28. # password: zhuotong
  29. # from_secret: zhuotong
  30. # debug: true
  31. # launch_debug: true
  32. #insecure: true
  33. # mirror: https://mgjrzxtn.mirror.aliyuncs.com
  34. # #registry: 192.168.1.100:10000
  35. # repo: iamsee/railway-admin
  36. # purge: true
  37. # tags:
  38. # - ${DRONE_COMMIT_SHA:1.0.0}
  39. # - ${DRONE_COMMIT}
  40. # - v1
  41. # - latest
  42. - name: scp_files
  43. image: appleboy/drone-scp
  44. settings:
  45. host: 172.16.0.28
  46. username: root
  47. password: $Jgkj1234
  48. debug: true
  49. target:
  50. - /www/wwwroot/railway.ninecase.top/release
  51. - /www/wwwroot/railway.ninecase.top/release
  52. source:
  53. - railway-admin/target/railway-admin.jar
  54. - Dockerfile
  55. rm: true
  56. - name: deploy
  57. image: appleboy/drone-ssh
  58. settings:
  59. host: 172.16.0.28
  60. username: root
  61. password: $Jgkj1234
  62. debug: true
  63. script:
  64. - export PATH=/usr/local/bin:$PATH
  65. - echo $PATH
  66. - export LANG="en_US.UTF-8"
  67. - pkill -9 java
  68. - 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 &
  69. - name: deploy-build-image
  70. image: appleboy/drone-ssh
  71. settings:
  72. host: 172.16.0.28
  73. username: root
  74. password: $Jgkj1234
  75. debug: true
  76. script:
  77. - cd /www/wwwroot/railway.ninecase.top/release
  78. - docker build -t iamsee/railway-admin:1.0.0 .
  79. - docker save -o railway-admin@1.0.0.tar iamsee/railway-admin:1.0.0
  80. trigger:
  81. branch:
  82. - 20221201
  83. volumes:
  84. - name: cache # The name use in this pipeline,
  85. host:
  86. path: /tmp/cache # The path be used in the host.
  87. - name: dockersock
  88. host:
  89. path: /var/run/docker.sock