pipeline.yml 7.4 KB

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