Merge commit '939177be6b30bd19dd3acfc1ae85690b83803234' as 'acm-hub-bootstrap'
This commit is contained in:
27
acm-hub-bootstrap/common/scripts/deploy-pattern.sh
Executable file
27
acm-hub-bootstrap/common/scripts/deploy-pattern.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
set -o pipefail
|
||||
|
||||
RUNS=10
|
||||
WAIT=15
|
||||
# Retry five times because the CRD might not be fully installed yet
|
||||
echo -n "Installing pattern: "
|
||||
for i in $(seq 1 ${RUNS}); do \
|
||||
exec 3>&1 4>&2
|
||||
OUT=$( { helm template --include-crds --name-template $* 2>&4 | oc apply -f- 2>&4 1>&3; } 4>&1 3>&1)
|
||||
ret=$?
|
||||
exec 3>&- 4>&-
|
||||
if [ ${ret} -eq 0 ]; then
|
||||
break;
|
||||
else
|
||||
echo -n "."
|
||||
sleep "${WAIT}"
|
||||
fi
|
||||
done
|
||||
|
||||
# All the runs failed
|
||||
if [ ${i} -eq ${RUNS} ]; then
|
||||
echo "Installation failed [${i}/${RUNS}]. Error:"
|
||||
echo "${OUT}"
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
Reference in New Issue
Block a user