Skip to content

Commit

Permalink
Wait for clustertasks before checking pipelines
Browse files Browse the repository at this point in the history
We observed on an SNO system, that the pipelines were there but the
clustertasks were not created yet, and so all the pipelineruns just
failed due to missing tasks. Let's make sure we wait for clustertasks
first.
  • Loading branch information
mbaldessari committed Aug 26, 2024
1 parent 081ad5c commit f60ed38
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/start_pipelines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
build_ns=quarkuscoffeeshop-cicd
pipelines=('build-and-push-quarkuscoffeeshop-barista' 'build-and-push-quarkuscoffeeshop-counter' 'build-and-push-quarkuscoffeeshop-customerloyalty' 'build-and-push-quarkuscoffeeshop-customermocker' 'build-and-push-quarkuscoffeeshop-inventory' 'build-and-push-quarkuscoffeeshop-kitchen' 'build-and-push-quarkuscoffeeshop-web')

echo "Checking for resources to be available to start pipelines"
DELAY=5
echo "Checking for ClusterTasks to be available"
while true; do
OUT=$(oc get clustertasks 2>/dev/null | wc -l)
if [ ${OUT} -eq 0 ]; then
sleep ${DELAY}
continue
fi
break
done

echo "Checking for resources to be available to start pipelines"
retry=0
check=1
while [ "$check" == "1" ]; do
Expand Down

0 comments on commit f60ed38

Please sign in to comment.