@@ -48,6 +48,13 @@ export FYRE_KEY=$(get_env fyre-key)
4848export FYRE_PASS=$( get_env fyre-pass)
4949export FYRE_PRODUCT_GROUP_ID=$( get_env fyre-product-group-id)
5050
51+ # acceptance-test.sh return values
52+ export KIND_E2E_TEST=1
53+ export OCP_E2E_X_TEST=2
54+ export OCP_E2E_P_TEST=4
55+ export OCP_E2E_Z_TEST=8
56+ export UNKNOWN_E2E_TEST=256
57+
5158echo " ${PIPELINE_PASSWORD} " | docker login " ${PIPELINE_REGISTRY} " -u " ${PIPELINE_USERNAME} " --password-stdin
5259if [[ ! -z " $RELEASE_ACCEPTANCE_TEST " && " $RELEASE_ACCEPTANCE_TEST " != " false" && " $RELEASE_ACCEPTANCE_TEST " != " no" ]]; then
5360 RELEASE_TARGET=$( curl --silent " https://api.github.com/repos/WASdev/websphere-liberty-operator/releases/latest" | jq -r .tag_name)
7178
7279scripts/acceptance-test.sh
7380rc=$?
81+ keep_cluster=0
82+
83+ if (( (rc & OCP_E2 E_X_TEST) > 0 )) ||
84+ (( (rc & OCP_E2 E_P_TEST) > 0 )) ||
85+ (( (rc & OCP_E2 E_Z_TEST) > 0 )) ||
86+ (( (rc & UNKNOWN_E2 E_TEST) > 0 )) ; then
87+ keep_cluster=1
88+ fi
7489
7590echo " switching back to ebc-gateway-http directory"
7691cd scripts/pipeline/ebc-gateway-http
7792
78- if [[ " $rc " == 0 ]]; then
93+ if [[ " $keep_cluster " == 0 ]]; then
94+ if (( (rc & KIND_E2 E_TEST) > 0 )) ; then
95+ slack_users=$( get_env slack_users)
96+ echo " slack_users=$slack_users "
97+ eval " arr=($slack_users )"
98+ for user in " ${arr[@]} " ; do
99+ echo " user=$user "
100+ curl -X POST -H ' Content-type: application/json' --data ' {"text":"<' $user ' > kind accceptance test failure see below "}' $( get_env slack_web_hook_url)
101+ echo " "
102+ done
103+ pipeline_url=" https://cloud.ibm.com/devops/pipelines/tekton/${PIPELINE_ID} /runs/${PIPELINE_RUN_ID} ?env_id=ibm:yp:us-south"
104+ curl -X POST -H ' Content-type: application/json' --data ' {"text":"Your kind acceptance test failed."}' $( get_env slack_web_hook_url) < /dev/null
105+ curl -X POST -H ' Content-type: application/json' --data ' {"text":"Failing pipeline: ' $pipeline_url ' "}' $( get_env slack_web_hook_url) < /dev/null
106+ fi
79107 ./ebc_complete.sh
80108else
81109 hours=$( get_env ebc_autocomplete_hours " 6" )
88116 echo " slack_users=$slack_users "
89117 eval " arr=($slack_users )"
90118 for user in " ${arr[@]} " ; do
91- echo " user=$user "
92- curl -X POST -H ' Content-type: application/json' --data ' {"text":"<' $user ' > accceptance test failure see below "}' $( get_env slack_web_hook_url)
93- echo " "
119+ echo " user=$user "
120+ curl -X POST -H ' Content-type: application/json' --data ' {"text":"<' $user ' > accceptance test failure see below "}' $( get_env slack_web_hook_url)
121+ echo " "
94122 done
95123 pipeline_url=" https://cloud.ibm.com/devops/pipelines/tekton/${PIPELINE_ID} /runs/${PIPELINE_RUN_ID} ?env_id=ibm:yp:us-south"
96124 curl -X POST -H ' Content-type: application/json' --data ' {"text":"Your acceptance test failed."}' $( get_env slack_web_hook_url) < /dev/null
0 commit comments