Updated argo + dryrun script

This commit is contained in:
Ariel Sosnovsky committed 2024-03-06 12:15:50 -05:00
1 parent fc99788e2e
commit dfaeb1a5f6
2 files changed
+12 -5

No files matched your search

+10 -3
View File
@@ -2,6 +2,8 @@
mkdir -p .tmp
deployment=${1:-dev}
keep_old=${2:-no}
keep_old=$(echo "${keep_old:0:1}" | tr '[:upper:]' '[:lower:]')
app=argocd
location=k8s/$app
full_path=$(realpath $location)
@@ -14,10 +16,15 @@ popd &> /dev/null
if [ -f "$tmp_path" ]; then
echo "Found existing file"
echo " -> Renaming old file to "$tmp_path".old"
mv $tmp_path $tmp_path".old"
if [[ -f "$tmp_path".old && "${keep_old:0:1}" == "y" ]]; then
num_files=$(ls -1q "${tmp_path}.old"* 2> /dev/null | wc -l | tr -d '[:space:]')
echo " -> Renaming old file to "$tmp_path".old.${num_files}"
mv $tmp_path $tmp_path".old.${num_files}"
else
echo " -> Renaming old file to "$tmp_path".old"
mv $tmp_path $tmp_path".old"
fi
fi
helm template $app $full_path --namespace $app \
--debug \
--create-namespace \
+2 -2
View File
@@ -5,5 +5,5 @@ type: application
version: 0.1.0
dependencies:
- name: argo-cd
version: 5.35.0
repository: https://argoproj.github.io/argo-helm
version: 6.6.0
repository: https://argoproj.github.io/argo-helm