From 3fb30fddb4878285c46e6fd3e5bdae92c0a1c31e Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 15 Nov 2018 11:15:33 -0800 Subject: [PATCH] Use Bintray API key rather than password in CI Update CI scripts to use the Bintray API key rather than the password when making curl calls. Closes gh-15015 --- ci/pipeline.yml | 4 ++++ ci/scripts/promote.sh | 4 ++-- ci/scripts/sync-to-maven-central.sh | 4 ++-- ci/tasks/promote.yml | 4 ++++ ci/tasks/sync-to-maven-central.yml | 1 + 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 0f53ddd6497..67dbd9dc0ce 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -453,6 +453,9 @@ jobs: ARTIFACTORY_PASSWORD: ((artifactory-password)) BINTRAY_SUBJECT: ((bintray-subject)) BINTRAY_REPO: ((bintray-repo)) + BINTRAY_USERNAME: ((bintray-username)) + BINTRAY_PASSWORD: ((bintray-password)) + BINTRAY_API_KEY: ((bintray-api-key)) - task: generate-release-notes file: git-repo/ci/tasks/generate-release-notes.yml params: @@ -480,6 +483,7 @@ jobs: params: BINTRAY_USERNAME: ((bintray-username)) BINTRAY_PASSWORD: ((bintray-password)) + BINTRAY_API_KEY: ((bintray-api-key)) SONATYPE_USER_TOKEN: ((sonatype-user-token)) SONATYPE_PASSWORD_TOKEN: ((sonatype-user-token-password)) BINTRAY_SUBJECT: ((bintray-subject)) diff --git a/ci/scripts/promote.sh b/ci/scripts/promote.sh index 719a4d86766..941507d0e81 100755 --- a/ci/scripts/promote.sh +++ b/ci/scripts/promote.sh @@ -64,7 +64,7 @@ if [[ $RELEASE_TYPE = "RELEASE" ]]; then else curl \ -s \ - -u ${BINTRAY_USERNAME}:${BINTRAY_PASSWORD} \ + -u ${BINTRAY_USERNAME}:${BINTRAY_API_KEY} \ -H "Content-Type: application/json" \ -d '[ { "name": "gradle-plugin", "values": ["org.springframework.boot:org.springframework.boot:spring-boot-gradle-plugin"] } ]' \ -X POST \ @@ -74,4 +74,4 @@ fi echo "Promotion complete" -echo $version > version/version \ No newline at end of file +echo $version > version/version diff --git a/ci/scripts/sync-to-maven-central.sh b/ci/scripts/sync-to-maven-central.sh index 073c73bb5d5..23a97d78700 100755 --- a/ci/scripts/sync-to-maven-central.sh +++ b/ci/scripts/sync-to-maven-central.sh @@ -11,9 +11,9 @@ echo "Syncing ${buildName}/${buildNumber} to Maven Central" -s \ --connect-timeout 240 \ --max-time 2700 \ - -u ${BINTRAY_USERNAME}:${BINTRAY_PASSWORD} \ + -u ${BINTRAY_USERNAME}:${BINTRAY_API_KEY} \ -H "Content-Type: application/json" -d "{\"username\": \"${SONATYPE_USER_TOKEN}\", \"password\": \"${SONATYPE_PASSWORD_TOKEN}\"}" \ -f \ -X \ POST "https://api.bintray.com/maven_central_sync/${BINTRAY_SUBJECT}/${BINTRAY_REPO}/${groupId}/versions/${version}" > /dev/null || { echo "Failed to sync" >&2; exit 1; } -echo "Sync complete" \ No newline at end of file +echo "Sync complete" diff --git a/ci/tasks/promote.yml b/ci/tasks/promote.yml index 015a935fb88..acf5a905845 100644 --- a/ci/tasks/promote.yml +++ b/ci/tasks/promote.yml @@ -12,5 +12,9 @@ params: ARTIFACTORY_PASSWORD: BINTRAY_SUBJECT: BINTRAY_REPO: + BINTRAY_SUBJECT: + BINTRAY_USERNAME: + BINTRAY_PASSWORD: + BINTRAY_API_KEY: run: path: git-repo/ci/scripts/promote.sh diff --git a/ci/tasks/sync-to-maven-central.yml b/ci/tasks/sync-to-maven-central.yml index 51235b0a97e..02ca81d0a00 100644 --- a/ci/tasks/sync-to-maven-central.yml +++ b/ci/tasks/sync-to-maven-central.yml @@ -8,6 +8,7 @@ params: BINTRAY_SUBJECT: BINTRAY_USERNAME: BINTRAY_PASSWORD: + BINTRAY_API_KEY: SONATYPE_USER_TOKEN: SONATYPE_PASSWORD_TOKEN: run: