Commit 11b8e7c2 authored by Phillip Webb's avatar Phillip Webb

Don't exit script on error

Update CI scripts so that command failures do not cause an immediate
exit. Prior to this commit, some of our looping logic would never run
because the entire script would exit.
parent fb90803d
#!/bin/bash #!/bin/bash
set -e
case "$JDK_VERSION" in case "$JDK_VERSION" in
java8) java8)
......
#!/bin/bash #!/bin/bash
set -e
source $(dirname $0)/common.sh source $(dirname $0)/common.sh
...@@ -31,7 +30,7 @@ curl \ ...@@ -31,7 +30,7 @@ curl \
-f \ -f \
-X \ -X \
POST "${ARTIFACTORY_SERVER}/api/build/promote/${buildName}/${buildNumber}" > /dev/null || { POST "${ARTIFACTORY_SERVER}/api/build/promote/${buildName}/${buildNumber}" > /dev/null || {
result=$( curl -s -u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} -f "${ARTIFACTORY_SERVER}/api/build/${buildName}/${buildNumber}" ) result=$( curl -s -f -u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} "${ARTIFACTORY_SERVER}/api/build/${buildName}/${buildNumber}" )
resultRepo=$( echo $result | jq -r '.buildInfo.statuses[0].repository' ) resultRepo=$( echo $result | jq -r '.buildInfo.statuses[0].repository' )
if [[ $resultRepo = "libs-release-local" ]]; then if [[ $resultRepo = "libs-release-local" ]]; then
echo "Already promoted" echo "Already promoted"
......
#!/bin/bash #!/bin/bash
set -e
buildName=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.name' ) buildName=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.name' )
buildNumber=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.number' ) buildNumber=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.number' )
......
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