-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ead1271
commit 9955a7c
Showing
4 changed files
with
31 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring: | ||
main: | ||
banner-mode: off | ||
sonatype: | ||
exclude: | ||
- 'build-info\.json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,17 @@ | ||
#!/bin/bash | ||
|
||
source $(dirname $0)/common.sh | ||
CONFIG_DIR=git-repo/ci/config | ||
|
||
buildName=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.name' ) | ||
buildNumber=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.number' ) | ||
groupId=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/\(.*\):.*:.*/\1/' ) | ||
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) | ||
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json | ||
|
||
if [[ $RELEASE_TYPE = "RELEASE" ]]; then | ||
targetRepo="libs-release-local" | ||
else | ||
echo "Unknown release type $RELEASE_TYPE" >&2; exit 1; | ||
fi | ||
java -jar /concourse-release-scripts.jar \ | ||
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \ | ||
publishToCentral $RELEASE_TYPE $BUILD_INFO_LOCATION artifactory-repo || { exit 1; } | ||
|
||
echo "Promoting ${buildName}/${buildNumber} to ${targetRepo}" | ||
|
||
curl \ | ||
-s \ | ||
--connect-timeout 240 \ | ||
--max-time 900 \ | ||
-u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} \ | ||
-H "Content-type:application/json" \ | ||
-d "{\"status\": \"staged\", \"sourceRepo\": \"libs-staging-local\", \"targetRepo\": \"${targetRepo}\"}" \ | ||
-f \ | ||
-X \ | ||
POST "${ARTIFACTORY_SERVER}/api/build/promote/${buildName}/${buildNumber}" > /dev/null || { | ||
result=$( curl -s -f -u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} "${ARTIFACTORY_SERVER}/api/build/${buildName}/${buildNumber}" ) | ||
resultRepo=$( echo $result | jq -r '.buildInfo.statuses[0].repository' ) | ||
if [[ $resultRepo = "libs-release-local" ]]; then | ||
echo "Already promoted" | ||
else | ||
echo "Failed to promote" >&2 | ||
exit 1 | ||
fi | ||
} | ||
java -jar /concourse-release-scripts.jar \ | ||
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \ | ||
promote $RELEASE_TYPE $BUILD_INFO_LOCATION || { exit 1; } | ||
|
||
echo "Promotion complete" | ||
echo $version > version/version | ||
echo $version > version/version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
--- | ||
platform: linux | ||
image_resource: | ||
type: registry-image | ||
source: | ||
repository: springio/concourse-release-scripts | ||
tag: '0.3.4' | ||
inputs: | ||
- name: git-repo | ||
- name: artifactory-repo | ||
outputs: | ||
- name: version | ||
params: | ||
RELEASE_TYPE: | ||
ARTIFACTORY_SERVER: | ||
ARTIFACTORY_USERNAME: | ||
ARTIFACTORY_PASSWORD: | ||
RELEASE_TYPE: | ||
SONATYPE_USER: | ||
SONATYPE_PASSWORD: | ||
SONATYPE_URL: | ||
SONATYPE_STAGING_PROFILE: | ||
run: | ||
path: git-repo/ci/scripts/promote.sh | ||
path: git-repo/ci/scripts/promote.sh |