forked from argoflow/argoflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_repo.sh
executable file
·31 lines (28 loc) · 992 Bytes
/
setup_repo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# set secretkey for metallb
echo "generating secret for metallb"
yq eval -i ".stringData.secretkey = \"$(openssl rand -base64 128)\"" metallb/secret.yaml
if [ -z "$1" ]
then
echo "no repo URL provided, using upstream"
else
yq e -i ".spec.source.repoURL = \"$1\"" kubeflow.yaml
for filename in ./argocd-applications/*.yaml; do
if [ $(yq e ".spec.source | has (\"helm\")" $filename) == false ]
then
yq e -i ".spec.source.repoURL = \"$1\"" $filename
fi
done
fi
if [ -z "$2" ]
then
echo "no target branch provided, using HEAD"
else
yq e -i ".spec.source.targetRevision = \"$2\"" kubeflow.yaml
for filename in ./argocd-applications/*.yaml; do
if [ $(yq e ".spec.source | has (\"helm\")" $filename) == false ]
then
yq e -i ".spec.source.targetRevision = \"$2\"" $filename
fi
done
fi