From 506fbd803b9153c309c32c2282c071474189d110 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 13 Nov 2018 10:15:50 -0800 Subject: [PATCH] Use release notes generator docker image in CI Closes gh-15160 --- ci/pipeline.yml | 35 +++++++--------------------- ci/scripts/generate-release-notes.sh | 16 +++++++------ ci/tasks/generate-release-notes.yml | 6 ++++- 3 files changed, 23 insertions(+), 34 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index e1c38f1fb7..0f53ddd649 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -27,11 +27,6 @@ resources: password: ((github-password)) branch: ((branch)) ignore_paths: ["ci/images/*"] -- name: release-notes-repo - type: git - source: - uri: https://github.com/mbhave/release-notes-generator - branch: master - name: git-pull-request type: pull-request source: @@ -383,7 +378,6 @@ jobs: - get: spring-boot-ci-image - get: git-repo trigger: false - - get: release-notes-repo - get: artifactory-repo trigger: false passed: [stage-milestone] @@ -398,26 +392,22 @@ jobs: ARTIFACTORY_USERNAME: ((artifactory-username)) ARTIFACTORY_PASSWORD: ((artifactory-password)) - task: generate-release-notes - image: spring-boot-ci-image file: git-repo/ci/tasks/generate-release-notes.yml params: RELEASE_TYPE: M - GITHUB_ORGANIZATION: spring-projects - GITHUB_REPO: spring-boot GITHUB_USERNAME: ((github-username)) GITHUB_PASSWORD: ((github-release-notes-access-token)) - put: github-pre-release params: - name: generated-release-notes/version - tag: generated-release-notes/version - body: generated-release-notes/body + name: generated-release-notes/tag + tag: generated-release-notes/tag + body: generated-release-notes/release-notes.md - name: promote-rc serial: true plan: - get: spring-boot-ci-image - get: git-repo trigger: false - - get: release-notes-repo - get: artifactory-repo trigger: false passed: [stage-rc] @@ -432,26 +422,22 @@ jobs: ARTIFACTORY_USERNAME: ((artifactory-username)) ARTIFACTORY_PASSWORD: ((artifactory-password)) - task: generate-release-notes - image: spring-boot-ci-image file: git-repo/ci/tasks/generate-release-notes.yml params: RELEASE_TYPE: RC - GITHUB_ORGANIZATION: spring-projects - GITHUB_REPO: spring-boot GITHUB_USERNAME: ((github-username)) GITHUB_PASSWORD: ((github-release-notes-access-token)) - put: github-pre-release params: - name: generated-release-notes/version - tag: generated-release-notes/version - body: generated-release-notes/body + name: generated-release-notes/tag + tag: generated-release-notes/tag + body: generated-release-notes/release-notes.md - name: promote-release serial: true plan: - get: spring-boot-ci-image - get: git-repo trigger: false - - get: release-notes-repo - get: artifactory-repo trigger: false passed: [stage-release] @@ -468,19 +454,16 @@ jobs: BINTRAY_SUBJECT: ((bintray-subject)) BINTRAY_REPO: ((bintray-repo)) - task: generate-release-notes - image: spring-boot-ci-image file: git-repo/ci/tasks/generate-release-notes.yml params: RELEASE_TYPE: RELEASE - GITHUB_ORGANIZATION: spring-projects - GITHUB_REPO: spring-boot GITHUB_USERNAME: ((github-username)) GITHUB_PASSWORD: ((github-release-notes-access-token)) - put: github-release params: - name: generated-release-notes/version - tag: generated-release-notes/version - body: generated-release-notes/body + name: generated-release-notes/tag + tag: generated-release-notes/tag + body: generated-release-notes/release-notes.md - name: sync-to-maven-central serial: true plan: diff --git a/ci/scripts/generate-release-notes.sh b/ci/scripts/generate-release-notes.sh index f3b915fcfd..d2967d4922 100755 --- a/ci/scripts/generate-release-notes.sh +++ b/ci/scripts/generate-release-notes.sh @@ -4,16 +4,18 @@ set -e source $(dirname $0)/common.sh version=$( cat version/version ) + milestone=$( echo $version ) if [[ $RELEASE_TYPE = "RELEASE" ]]; then milestone=${version%.RELEASE} fi -milestone_number=$( curl -s "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones" -u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} | jq -r --arg MILESTONE "${milestone}" '.[] | select(.title == $MILESTONE) | .number') -pushd release-notes-repo > /dev/null -run_maven clean install -java -jar -Dreleasenotes.github.organization=${GITHUB_ORGANIZATION} -Dreleasenotes.github.name=${GITHUB_REPO} target/github-release-notes-generator-0.0.1-SNAPSHOT.jar "${milestone_number}" release-notes.md -popd > /dev/null +java -jar /github-release-notes-generator.jar \ + --releasenotes.github.username=${GITHUB_USERNAME} \ + --releasenotes.github.password=${GITHUB_TOKEN} \ + --releasenotes.github.organization=spring-projects \ + --releasenotes.github.repository=spring-boot \ + ${milestone} generated-release-notes/release-notes.md -cat release-notes-repo/release-notes.md > generated-release-notes/body -echo v${version} > generated-release-notes/version +echo ${version} > generated-release-notes/version +echo v${version} > generated-release-notes/tag diff --git a/ci/tasks/generate-release-notes.yml b/ci/tasks/generate-release-notes.yml index fde7d8caff..55fc35eec2 100755 --- a/ci/tasks/generate-release-notes.yml +++ b/ci/tasks/generate-release-notes.yml @@ -1,8 +1,12 @@ --- platform: linux +image_resource: + type: docker-image + source: + repository: springio/github-release-notes-generator + tag: '0.0.2' inputs: - name: git-repo -- name: release-notes-repo - name: version outputs: - name: generated-release-notes