pipeline.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. anchors:
  2. gradle-enterprise-task-params: &gradle-enterprise-task-params
  3. GRADLE_ENTERPRISE_ACCESS_KEY: ((gradle_enterprise_secret_access_key))
  4. GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle_enterprise_cache_user.username))
  5. GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle_enterprise_cache_user.password))
  6. docker-hub-task-params: &docker-hub-task-params
  7. DOCKER_HUB_USERNAME: ((docker-hub-username))
  8. DOCKER_HUB_PASSWORD: ((docker-hub-password))
  9. build-project-task-params: &build-project-task-params
  10. privileged: true
  11. timeout: ((task-timeout))
  12. file: git-repo/ci/tasks/build-project.yml
  13. params:
  14. BRANCH: ((branch))
  15. <<: *gradle-enterprise-task-params
  16. <<: *docker-hub-task-params
  17. artifactory-task-params: &artifactory-task-params
  18. ARTIFACTORY_SERVER: ((artifactory-server))
  19. ARTIFACTORY_USERNAME: ((artifactory-username))
  20. ARTIFACTORY_PASSWORD: ((artifactory-password))
  21. artifactory-repo-put-params: &artifactory-repo-put-params
  22. repo: libs-snapshot-local
  23. folder: distribution-repository
  24. build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
  25. build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}"
  26. disable_checksum_uploads: true
  27. threads: 8
  28. resource_types:
  29. - name: artifactory-resource
  30. type: registry-image
  31. source:
  32. repository: springio/artifactory-resource
  33. tag: 0.0.13
  34. resources:
  35. - name: git-repo
  36. type: git
  37. icon: github
  38. source:
  39. uri: ((github-repo))
  40. username: ((github-username))
  41. password: ((github-password))
  42. branch: ((branch))
  43. ignore_paths: ["ci/images/*"]
  44. - name: github-pre-release
  45. type: github-release
  46. icon: briefcase-download-outline
  47. source:
  48. owner: spring-io
  49. repository: ((github-project-name))
  50. access_token: ((github-ci-release-token))
  51. pre_release: true
  52. - name: github-release
  53. type: github-release
  54. icon: briefcase-download
  55. source:
  56. owner: spring-io
  57. repository: ((github-project-name))
  58. access_token: ((github-ci-release-token))
  59. pre_release: false
  60. - name: ci-images-git-repo
  61. type: git
  62. icon: github
  63. source:
  64. uri: ((github-repo))
  65. branch: ((branch))
  66. paths: ["ci/images/*"]
  67. - name: ci-image
  68. type: registry-image
  69. icon: docker
  70. source:
  71. repository: ((docker-hub-organization))/((ci-image-name))
  72. username: ((docker-hub-username))
  73. password: ((docker-hub-password))
  74. tag: ((branch))
  75. - name: artifactory-repo
  76. type: artifactory-resource
  77. icon: package-variant
  78. source:
  79. uri: ((artifactory-server))
  80. username: ((artifactory-username))
  81. password: ((artifactory-password))
  82. build_name: ((build-name))
  83. jobs:
  84. - name: build-ci-image
  85. plan:
  86. - get: ci-images-git-repo
  87. trigger: true
  88. - get: git-repo
  89. - task: build-ci-image
  90. privileged: true
  91. file: git-repo/ci/tasks/build-ci-image.yml
  92. output_mapping:
  93. image: ci-image
  94. vars:
  95. ci-image-name: ci-image
  96. - put: ci-image
  97. params:
  98. image: ci-image/image.tar
  99. - name: build
  100. serial: true
  101. public: true
  102. plan:
  103. - get: ci-image
  104. - get: git-repo
  105. trigger: true
  106. - do:
  107. - task: build-project
  108. privileged: true
  109. image: ci-image
  110. <<: *build-project-task-params
  111. - put: artifactory-repo
  112. params:
  113. <<: *artifactory-repo-put-params
  114. get_params:
  115. threads: 8
  116. - name: stage-milestone
  117. serial: true
  118. plan:
  119. - get: ci-image
  120. - get: git-repo
  121. trigger: false
  122. - task: stage
  123. image: ci-image
  124. file: git-repo/ci/tasks/stage.yml
  125. params:
  126. <<: *gradle-enterprise-task-params
  127. <<: *docker-hub-task-params
  128. RELEASE_TYPE: M
  129. - put: artifactory-repo
  130. params:
  131. <<: *artifactory-repo-put-params
  132. repo: libs-staging-local
  133. - put: git-repo
  134. params:
  135. repository: stage-git-repo
  136. - name: stage-rc
  137. serial: true
  138. plan:
  139. - get: ci-image
  140. - get: git-repo
  141. trigger: false
  142. - task: stage
  143. image: ci-image
  144. file: git-repo/ci/tasks/stage.yml
  145. params:
  146. RELEASE_TYPE: RC
  147. <<: *gradle-enterprise-task-params
  148. <<: *docker-hub-task-params
  149. - put: artifactory-repo
  150. params:
  151. <<: *artifactory-repo-put-params
  152. repo: libs-staging-local
  153. - put: git-repo
  154. params:
  155. repository: stage-git-repo
  156. - name: stage-release
  157. serial: true
  158. plan:
  159. - get: ci-image
  160. - get: git-repo
  161. trigger: false
  162. - task: stage
  163. image: ci-image
  164. file: git-repo/ci/tasks/stage.yml
  165. params:
  166. RELEASE_TYPE: RELEASE
  167. <<: *gradle-enterprise-task-params
  168. <<: *docker-hub-task-params
  169. - put: artifactory-repo
  170. params:
  171. <<: *artifactory-repo-put-params
  172. repo: libs-staging-local
  173. - put: git-repo
  174. params:
  175. repository: stage-git-repo
  176. - name: promote-milestone
  177. serial: true
  178. plan:
  179. - get: ci-image
  180. - get: git-repo
  181. trigger: false
  182. - get: artifactory-repo
  183. trigger: false
  184. passed: [stage-milestone]
  185. params:
  186. save_build_info: true
  187. - task: promote
  188. image: ci-image
  189. file: git-repo/ci/tasks/promote.yml
  190. params:
  191. RELEASE_TYPE: M
  192. <<: *artifactory-task-params
  193. - task: generate-changelog
  194. file: git-repo/ci/tasks/generate-changelog.yml
  195. params:
  196. RELEASE_TYPE: M
  197. GITHUB_USERNAME: ((github-username))
  198. GITHUB_TOKEN: ((github-ci-release-token))
  199. - put: github-pre-release
  200. params:
  201. name: generated-changelog/tag
  202. tag: generated-changelog/tag
  203. body: generated-changelog/changelog.md
  204. - name: promote-rc
  205. serial: true
  206. plan:
  207. - get: ci-image
  208. - get: git-repo
  209. trigger: false
  210. - get: artifactory-repo
  211. trigger: false
  212. passed: [stage-rc]
  213. params:
  214. download_artifacts: false
  215. save_build_info: true
  216. - task: promote
  217. image: ci-image
  218. file: git-repo/ci/tasks/promote.yml
  219. params:
  220. RELEASE_TYPE: RC
  221. <<: *artifactory-task-params
  222. - task: generate-changelog
  223. file: git-repo/ci/tasks/generate-changelog.yml
  224. params:
  225. RELEASE_TYPE: RC
  226. GITHUB_USERNAME: ((github-username))
  227. GITHUB_TOKEN: ((github-ci-release-token))
  228. - put: github-pre-release
  229. params:
  230. name: generated-changelog/tag
  231. tag: generated-changelog/tag
  232. body: generated-changelog/changelog.md
  233. - name: promote-release
  234. serial: true
  235. plan:
  236. - get: ci-image
  237. - get: git-repo
  238. trigger: false
  239. - get: artifactory-repo
  240. trigger: false
  241. passed: [stage-release]
  242. params:
  243. download_artifacts: true
  244. save_build_info: true
  245. - task: promote
  246. image: ci-image
  247. file: git-repo/ci/tasks/promote.yml
  248. params:
  249. RELEASE_TYPE: RELEASE
  250. <<: *artifactory-task-params
  251. - name: create-github-release
  252. serial: true
  253. plan:
  254. - get: ci-image
  255. - get: git-repo
  256. - get: artifactory-repo
  257. trigger: true
  258. passed: [promote-release]
  259. params:
  260. download_artifacts: false
  261. save_build_info: true
  262. - task: generate-changelog
  263. file: git-repo/ci/tasks/generate-changelog.yml
  264. params:
  265. RELEASE_TYPE: RELEASE
  266. GITHUB_USERNAME: ((github-username))
  267. GITHUB_TOKEN: ((github-ci-release-token))
  268. - put: github-release
  269. params:
  270. name: generated-changelog/tag
  271. tag: generated-changelog/tag
  272. body: generated-changelog/changelog.md
  273. groups:
  274. - name: "builds"
  275. jobs: ["build"]
  276. - name: "releases"
  277. jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"]
  278. - name: "ci-image"
  279. jobs: ["build-ci-image"]