pipeline-20220517-1.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. version: '1.0'
  2. name: pipeline-20220517-1
  3. displayName: pipeline-20220517-1
  4. triggers:
  5. trigger: manual
  6. push:
  7. branches:
  8. prefix:
  9. - ''
  10. stages:
  11. - name: stage-c0fe9b78
  12. displayName: 编译
  13. strategy: naturally
  14. trigger: auto
  15. executor:
  16. - mac520
  17. steps:
  18. - step: build@maven
  19. name: build_maven
  20. displayName: Maven 构建
  21. jdkVersion: '8'
  22. mavenVersion: 3.3.9
  23. commands:
  24. - mvn -B clean package -Dmaven.test.skip=true
  25. artifacts:
  26. - name: BUILD_ARTIFACT
  27. path:
  28. - ./release
  29. settings: []
  30. caches:
  31. - ~/.m2
  32. strategy: {}
  33. - name: stage-4d60b905
  34. displayName: 部署
  35. strategy: naturally
  36. trigger: auto
  37. executor:
  38. - mac520
  39. steps:
  40. - step: deploy@agent
  41. name: deploy_agent
  42. displayName: 主机部署
  43. hostGroupID: qiwen
  44. deployArtifact:
  45. - source: build
  46. name: qiwen-file
  47. target: ~/gitee_go/deploy/qiwen-file
  48. dependArtifact: BUILD_ARTIFACT
  49. script:
  50. - '# 请在此输入部署脚本,如启动Java应用如下'
  51. - '# nohup java -jar test.jar > nohup.out &'
  52. - cd ~/gitee_go/deploy/qiwen-file
  53. - rm -r bin/ conf/ lib/ log/
  54. - tar -zxvf qiwen-file.tar.gz
  55. - rm qiwen-file.tar.gz
  56. - cp -r ~/gitee_go/deploy/qiwen-file/release/* ~/gitee_go/deploy/qiwen-file
  57. - rm -r release
  58. - cp /home/qiwen-script/qiwen-file/application.properties conf/config/
  59. - cd bin
  60. - chmod -R 777 ./*
  61. - sh restart.sh
  62. - ' echo ''Hello Gitee!'''
  63. strategy: {}