Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
48 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
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 |
---|---|---|
@@ -1,24 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
TF_ROOT="${TF_ROOT:-terraform}" | ||
|
||
KUBECONFIG=$(mktemp /tmp/kubeconfig.XXXXXX) | ||
export KUBECONFIG | ||
# This script requires this environment variables to be set: | ||
# | ||
# - KUBECONFIG: pointing to a file containing the Kubernetes context to use as we use port-forwarding | ||
# - ARGOCD_AUTH_TOKEN: a read-only token that is allowed to perform argocd app list and argocd app diff | ||
|
||
python3 -c "import sys, json; print(json.load(sys.stdin)['kubeconfig']['value'])" < "$TF_ROOT/outputs.json" > "$KUBECONFIG" | ||
chmod 0600 "$KUBECONFIG" | ||
|
||
ARGOCD_AUTH_TOKEN=$(python3 -c "import sys, json; print(json.load(sys.stdin)['argocd_auth_token']['value'])" < "$TF_ROOT/outputs.json") | ||
export ARGOCD_AUTH_TOKEN | ||
set -e | ||
|
||
ARGOCD_OPTS="--plaintext --port-forward --port-forward-namespace argocd" | ||
export ARGOCD_OPTS | ||
export ARGOCD_OPTS="--plaintext --port-forward --port-forward-namespace argocd" | ||
|
||
while ! argocd app wait apps --sync --health --timeout 30 | ||
do | ||
argocd app list -owide || true | ||
done | ||
|
||
rm "$KUBECONFIG" |