Skip to content

Commit

Permalink
Merge pull request #32 from mbaldessari/cleanup
Browse files Browse the repository at this point in the history
A couple of small improvements
  • Loading branch information
mbaldessari committed Aug 28, 2024
2 parents 9a2fa3f + c748306 commit 0b2c1f0
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion scripts/start_pipelines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,31 @@
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')


MAX_ATTEMPTS=720
DELAY=5
ATTEMPT=1

while [ ${ATTEMPT} -le ${MAX_ATTEMPTS} ]; do
OUT=$(oc get clustertasks 2>/dev/null | wc -l)
if [ ${OUT} -gt 0 ]; then
echo "ClusterTasks found"
break
else
echo "ClusterTasks not found yet"
if [ ${ATTEMPT} -ge ${MAX_ATTEMPTS} ]; then
echo "Max attempts reached. Existing."
fi
ATTEMPT=$((ATTEMPT + 1))
sleep ${DELAY}
fi
done

echo "Checking for resources to be available to start pipelines"
retry=0
check=1
while [ "$check" == "1" ]; do
sleep 2;
sleep ${DELAY}

for p in ${pipelines[@]}; do
oc get -n $build_ns pipeline $p 1>/dev/null 2>/dev/null
Expand Down

0 comments on commit 0b2c1f0

Please sign in to comment.