Fix build failed due to script unable to find configmap (#1237)
This commit is contained in:
@@ -26,6 +26,7 @@ while true; do
|
|||||||
|
|
||||||
previous_build_id=$(kubectl --namespace default get configmap in-test --ignore-not-found -o=jsonpath='{.metadata.labels.travisID}')
|
previous_build_id=$(kubectl --namespace default get configmap in-test --ignore-not-found -o=jsonpath='{.metadata.labels.travisID}')
|
||||||
|
|
||||||
|
if [[ ! -z ${previous_build_id} ]]; then
|
||||||
build_state=$(curl -s -X GET https://api.travis-ci.org/build/${previous_build_id} \
|
build_state=$(curl -s -X GET https://api.travis-ci.org/build/${previous_build_id} \
|
||||||
-H "Authorization: token ${TRAVIS_TOKEN}" \
|
-H "Authorization: token ${TRAVIS_TOKEN}" \
|
||||||
-H "Travis-API-Version: 3" | python -c "import sys,json; print json.load(sys.stdin)['state']")
|
-H "Travis-API-Version: 3" | python -c "import sys,json; print json.load(sys.stdin)['state']")
|
||||||
@@ -36,6 +37,7 @@ while true; do
|
|||||||
if [[ ${TRAVIS_TOKEN} == ${previous_build_id} ]] || [[ $build_state != "started" ]]; then
|
if [[ ${TRAVIS_TOKEN} == ${previous_build_id} ]] || [[ $build_state != "started" ]]; then
|
||||||
kubectl --namespace default delete configmap -l travisID=${previous_build_id}
|
kubectl --namespace default delete configmap -l travisID=${previous_build_id}
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
created=$(kubectl --namespace default create configmap in-test|grep "created"||true)
|
created=$(kubectl --namespace default create configmap in-test|grep "created"||true)
|
||||||
if [[ -z $created ]]; then
|
if [[ -z $created ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user