generated from hybrid-cloud-patterns/example
-
Notifications
You must be signed in to change notification settings - Fork 71
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 #286 from mbaldessari/newer-common
Newer common
- Loading branch information
Showing
2 changed files
with
40 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,26 @@ | ||
#!/bin/bash | ||
set -o pipefail | ||
|
||
RUNS=5 | ||
# 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 10 | ||
fi | ||
done | ||
|
||
# All the runs failed | ||
if [ ${i} -eq ${RUNS} ]; then | ||
echo "Installation failed [${i}/${RUNS}]. Error:" | ||
echo "${OUT}" | ||
exit 1 | ||
fi | ||
echo "Done" |