Supports both basicAuth & Token

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-09-10 11:13:10 +02:00
committed by Sam Alba
parent d34200c9f6
commit 05b165bcc8
5 changed files with 120 additions and 91 deletions

View File

@@ -223,15 +223,15 @@ setup() {
dagger -e argocd-infra up
# Forward port
# We need to kill subprocess to avoid infinity loop
kubectl port-forward svc/argocd-server -n argocd 8080:443 >/dev/null 2>/dev/null &
sleep 3
sleep 3 || (pkill kubectl && exit 1)
# Run test
dagger -e argocd input secret TestConfig.argocdConfig.password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)"
dagger -e up
dagger -e argocd input unset TestConfig.argocdConfig.password
dagger -e argocd input secret TestConfig.argocdConfig.basicAuth.password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)" || (pkill kubectl && exit 1)
dagger -e argocd up || (pkill kubectl && exit 1)
dagger -e argocd input unset TestConfig.argocdConfig.basicAuth.password || (pkill kubectl && exit 1)
# Kill Pid
pkill kubectl
pgrep kubectl && pkill kubectl
}