21 lines
708 B
Bash
21 lines
708 B
Bash
#!/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"
|