Refactor in progress (deploy and upgrade to 0.13)
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Adrien Reslinger 2020-06-19 00:11:06 +02:00
parent acbd41024a
commit 2c98242d0b
18 changed files with 384 additions and 322 deletions

View file

@ -1,5 +1,5 @@
#!/bin/bash
CERTMANAGER_VERSION=0.15.1
CERTMANAGER_VERSION="$(curl --silent "https://api.github.com/repos/jetstack/cert-manager/releases/latest" | jq {"name"} | sed -e '/^{/d' -e '/^}/d' -e 's|.*v\([0-9\.]*\).*|\1|')"
CERTMANAGER_SHORTVERSION="$(echo "${CERTMANAGER_VERSION}" | sed 's/^\(.*\)\.[0-9]$/\1/')"
wget https://github.com/jetstack/cert-manager/releases/download/v"${CERTMANAGER_VERSION}"/cert-manager.yaml
kubernetes-split-yaml cert-manager.yaml > generated.log
@ -7,7 +7,8 @@ if [ -d templates/"${CERTMANAGER_SHORTVERSION}" ]; then
rm -fr templates/"${CERTMANAGER_SHORTVERSION}"
fi
mv generated templates/"${CERTMANAGER_SHORTVERSION}"
cat generated.log | while read LIGNE; do if [ $(echo "${LIGNE}" | grep -c ^File) -eq 1 ]; then echo -n "${LIGNE} "; else echo "${LIGNE}"; fi; done | grep ^File | sort -V | sed 's|.*\(generated/\)\(.*\.yaml\)| - "'${CERTMANAGER_SHORTVERSION}'/\2"|'
echo -e "---\ncertmanager_${CERTMANAGER_SHORTVERSION}_list:" > vars/files_list_${CERTMANAGER_SHORTVERSION}.yml
cat generated.log | while read LIGNE; do if [ $(echo "${LIGNE}" | grep -c ^File) -eq 1 ]; then echo -n "${LIGNE} "; else echo "${LIGNE}"; fi; done | grep ^File | sort -V | sed 's|.*\(generated/\)\(.*\.yaml\)| - "'${CERTMANAGER_SHORTVERSION}'/\2"|' >> vars/files_list_${CERTMANAGER_SHORTVERSION}.yml
sed '/args:/ a\ - --dns01-recursive-nameservers=8.8.8.8:53,1.1.1.1:53' -i templates/"${CERTMANAGER_SHORTVERSION}"/cert-manager-Deployment.yaml
rm -f generated.log cert-manager.yaml