pipeline.yml 7.5 KB

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