You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.8KB

  1. kind: pipeline
  2. name: job_risk_third
  3. workspace:
  4. base: /var/goproject/src
  5. path: job_risk_third
  6. steps:
  7. - name: build
  8. image: golang:1.14.4
  9. environment:
  10. GOOS: linux
  11. GOARCH: amd64
  12. commands:
  13. - export GOPATH=/var/goproject
  14. - export PATH=$PATH:$GOROOT/bin
  15. - go env -w GO111MODULE=on
  16. - go env -w GOPROXY=https://goproxy.cn,direct
  17. - go version
  18. - go env
  19. - go mod tidy
  20. - go build -i -o bin/job_risk_third cmd/main.go
  21. - name: develop deploy
  22. image: appleboy/drone-scp
  23. settings:
  24. host:
  25. from_secret: host
  26. port:
  27. from_secret: port
  28. username:
  29. from_secret: username
  30. password:
  31. from_secret: password
  32. target:
  33. from_secret: target
  34. source: ./bin
  35. rm: false
  36. when:
  37. branch:
  38. - deploy_develop
  39. - name: run
  40. image: appleboy/drone-ssh
  41. settings:
  42. host:
  43. from_secret: host
  44. port:
  45. from_secret: port
  46. username:
  47. from_secret: username
  48. password:
  49. from_secret: password
  50. command_timeout: 2m
  51. script:
  52. - cd /server/job_risk_third/
  53. - rm -rf job_risk_third
  54. - cp bin/job_risk_third job_risk_third
  55. - cp restart.sh restart.sh
  56. - ./restart.sh
  57. - nohup ./job_risk_third -f config/job_risk_third.json 1>/dev/null 2>&1 &
  58. - name: notification
  59. image: lddsb/drone-dingtalk-message
  60. settings:
  61. token: 840fed65878154561a096c03a516ded894ab1b91efbe1643fe492dd93593e7a3
  62. type: markdown
  63. secret: SEC9fe40cc775658cbef7a30b43fd852b642201754fdrone15df42cd339627e05cfde41e
  64. tpl: ./drone/tpl/index.md
  65. tips_title: 宁达第三方服务构建结果
  66. success_pic: https://i.ibb.co/CB4HBLP/success-1.png
  67. failure_pic: https://i.ibb.co/wM2rbGS/fail-1.png
  68. trigger:
  69. branch:
  70. - deploy_develop