21 lines
593 B
Bash
21 lines
593 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
[ $# != 1 ] &&
|
||
|
echo "wrong number of args, run with --help" &&
|
||
|
exit 1;
|
||
|
|
||
|
APPNAME=$1
|
||
|
|
||
|
cp -r ./templates/new-svc "$APPNAME"
|
||
|
cp ./templates/appname-application.yaml "argocd-applications/base/$APPNAME-application.yaml"
|
||
|
|
||
|
for file in "$APPNAME"/base/* ; do
|
||
|
rename appname "$APPNAME" "$file"
|
||
|
# NEWFILE=$(echo "$file" | sed "s/appname/$APPNAME/g")
|
||
|
NEWFILE=${file//appname/$APPNAME}
|
||
|
sed -i "s/appname/$APPNAME/g" "$NEWFILE"
|
||
|
done
|
||
|
|
||
|
sed -i "s/appname/$APPNAME/g" "./$APPNAME/kustomization.yaml"
|
||
|
sed -i "s/appname/$APPNAME/g" "argocd-applications/base/$APPNAME-application.yaml"
|