argocd/argo1/deploy.sh

21 lines
708 B
Bash
Raw Normal View History

2023-04-23 16:19:35 +00:00
#!/bin/bash
cd "$(dirname "$0")"
TARGETNS="argocd"
ORIGNS="$(kubectl config view --minify -o jsonpath='{..namespace}')"
(
set -e
jq -n --args '{"apiVersion":"v1","kind":"Namespace","metadata":{"name": $ARGS.positional[0]}}' "$TARGETNS" | kubectl apply -f -
[ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace $TARGETNS
helm upgrade -i --create-namespace -n $TARGETNS argo1 argo/argo-cd -f values.yaml
kubectl wait -n $TARGETNS deploy/argocd-server --for=condition=available
#kubectl apply -f application.yaml
#
argocd --core app sync argocd
)
[ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace "$ORIGNS"