-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from keboola/ondra-test-kbc-tests
Run KBC test jobs on new Queue
- Loading branch information
Showing
2 changed files
with
36 additions
and
8 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
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,29 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
for config in ${KBC_TEST_PROJECT_CONFIGS} | ||
do | ||
export CONFIG="{\"component\": \"${KBC_DEVELOPERPORTAL_APP}\",\"mode\": \"run\",\"config\": \"${config}\",\"tag\": \"${TAG}\"}" | ||
|
||
jobid=$(curl -s -X POST -H "X-StorageApi-Token: ${KBC_STORAGE_TOKEN}" -H "Content-Type: application/json" -d "${CONFIG}" https://queue.keboola.com/jobs | jq -r '.id') | ||
echo "Job '$jobid' started" | ||
jobfinished=false | ||
while ! $jobfinished; do | ||
sleep 5 | ||
curl -s -X GET -H "X-StorageApi-Token: ${KBC_STORAGE_TOKEN}" -H "Content-Type: application/json" https://queue.keboola.com/jobs/$jobid > jobResult.json | ||
jobfinished=$(jq -r '.isFinished' jobResult.json) | ||
status=$(jq -r '.status' jobResult.json) | ||
|
||
if [[ "$jobfinished" == "true" && "$status" != "success" ]] | ||
then | ||
echo "Job '$jobid' ended with status '$status'" | ||
exit 1 | ||
fi | ||
if [ "$jobfinished" == "true" ] | ||
then | ||
echo "Job '$jobid' has been successful" | ||
fi | ||
done | ||
done | ||
|
||
echo "OK" |