Commit 3fb30fdd authored by Phillip Webb's avatar Phillip Webb

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
parent 5183dd12
...@@ -453,6 +453,9 @@ jobs: ...@@ -453,6 +453,9 @@ jobs:
ARTIFACTORY_PASSWORD: ((artifactory-password)) ARTIFACTORY_PASSWORD: ((artifactory-password))
BINTRAY_SUBJECT: ((bintray-subject)) BINTRAY_SUBJECT: ((bintray-subject))
BINTRAY_REPO: ((bintray-repo)) BINTRAY_REPO: ((bintray-repo))
BINTRAY_USERNAME: ((bintray-username))
BINTRAY_PASSWORD: ((bintray-password))
BINTRAY_API_KEY: ((bintray-api-key))
- task: generate-release-notes - task: generate-release-notes
file: git-repo/ci/tasks/generate-release-notes.yml file: git-repo/ci/tasks/generate-release-notes.yml
params: params:
...@@ -480,6 +483,7 @@ jobs: ...@@ -480,6 +483,7 @@ jobs:
params: params:
BINTRAY_USERNAME: ((bintray-username)) BINTRAY_USERNAME: ((bintray-username))
BINTRAY_PASSWORD: ((bintray-password)) BINTRAY_PASSWORD: ((bintray-password))
BINTRAY_API_KEY: ((bintray-api-key))
SONATYPE_USER_TOKEN: ((sonatype-user-token)) SONATYPE_USER_TOKEN: ((sonatype-user-token))
SONATYPE_PASSWORD_TOKEN: ((sonatype-user-token-password)) SONATYPE_PASSWORD_TOKEN: ((sonatype-user-token-password))
BINTRAY_SUBJECT: ((bintray-subject)) BINTRAY_SUBJECT: ((bintray-subject))
......
...@@ -64,7 +64,7 @@ if [[ $RELEASE_TYPE = "RELEASE" ]]; then ...@@ -64,7 +64,7 @@ if [[ $RELEASE_TYPE = "RELEASE" ]]; then
else else
curl \ curl \
-s \ -s \
-u ${BINTRAY_USERNAME}:${BINTRAY_PASSWORD} \ -u ${BINTRAY_USERNAME}:${BINTRAY_API_KEY} \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '[ { "name": "gradle-plugin", "values": ["org.springframework.boot:org.springframework.boot:spring-boot-gradle-plugin"] } ]' \ -d '[ { "name": "gradle-plugin", "values": ["org.springframework.boot:org.springframework.boot:spring-boot-gradle-plugin"] } ]' \
-X POST \ -X POST \
...@@ -74,4 +74,4 @@ fi ...@@ -74,4 +74,4 @@ fi
echo "Promotion complete" echo "Promotion complete"
echo $version > version/version echo $version > version/version
\ No newline at end of file
...@@ -11,9 +11,9 @@ echo "Syncing ${buildName}/${buildNumber} to Maven Central" ...@@ -11,9 +11,9 @@ echo "Syncing ${buildName}/${buildNumber} to Maven Central"
-s \ -s \
--connect-timeout 240 \ --connect-timeout 240 \
--max-time 2700 \ --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}\"}" \ -H "Content-Type: application/json" -d "{\"username\": \"${SONATYPE_USER_TOKEN}\", \"password\": \"${SONATYPE_PASSWORD_TOKEN}\"}" \
-f \ -f \
-X \ -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; } 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" echo "Sync complete"
\ No newline at end of file
...@@ -12,5 +12,9 @@ params: ...@@ -12,5 +12,9 @@ params:
ARTIFACTORY_PASSWORD: ARTIFACTORY_PASSWORD:
BINTRAY_SUBJECT: BINTRAY_SUBJECT:
BINTRAY_REPO: BINTRAY_REPO:
BINTRAY_SUBJECT:
BINTRAY_USERNAME:
BINTRAY_PASSWORD:
BINTRAY_API_KEY:
run: run:
path: git-repo/ci/scripts/promote.sh path: git-repo/ci/scripts/promote.sh
...@@ -8,6 +8,7 @@ params: ...@@ -8,6 +8,7 @@ params:
BINTRAY_SUBJECT: BINTRAY_SUBJECT:
BINTRAY_USERNAME: BINTRAY_USERNAME:
BINTRAY_PASSWORD: BINTRAY_PASSWORD:
BINTRAY_API_KEY:
SONATYPE_USER_TOKEN: SONATYPE_USER_TOKEN:
SONATYPE_PASSWORD_TOKEN: SONATYPE_PASSWORD_TOKEN:
run: run:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment