Updated dryrun script * root level certificates

This commit is contained in:
Ariel Sosnovsky committed 2024-03-14 14:04:18 -04:00
1 parent 01e5d16d3f
commit 588c340bb2
2 files changed
+38 -3

No files matched your search

+12 -3
View File
@@ -3,6 +3,8 @@ set -e
full_path=${1}
deployment=${2:-dev}
keep_old=${3:-no}
keep_old=$(echo "${keep_old:0:1}" | tr '[:upper:]' '[:lower:]')
app=$(basename $full_path)
location=$(dirname $full_path)
tmp_path=".tmp/$location/$deployment-$app.yaml"
@@ -32,9 +34,16 @@ popd &> /dev/null
echo $chart_checksum > $chart_checksum_path
if [ -f "$tmp_path" ]; then
echo " > found existing file"
echo " > renaming old file to "$tmp_path".old"
mv $tmp_path $tmp_path".old"
echo "Found existing file"
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
rm $tmp_path".old"*
echo " -> Renaming old file to "$tmp_path".old"
mv $tmp_path $tmp_path".old"
fi
fi
echo " > running..."
@@ -50,5 +50,31 @@ spec:
dnsNames:
- "*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}"
{{ end }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: cloudflare-wildcard.{{ $.Values.global.domain }}
spec:
secretName: cloudflare-wildcard.{{ $.Values.global.domain }}
issuerRef:
name: cloudflare
kind: Issuer
commonName: '*.{{ $.Values.global.domain }}'
dnsNames:
- "*.{{ $.Values.global.domain }}"
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }}
spec:
secretName: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }}
issuerRef:
name: cloudflare
kind: Issuer
commonName: '*.{{ $.Values.global.secondaryDomain }}'
dnsNames:
- "*.{{ $.Values.global.secondaryDomain }}"
{{ end }}
{{ end }}