Helm charts with little changes.
brew install gh
mkdir tmp
cd tmp
helm pull --repo https://raw.github.com/DefectDojo/django-DefectDojo/helm-charts defectdojo
tar xvzf defectdojo-*.tgz
FILE="$(ls -1 defectdojo-*.tgz)"
FILE="${FILE//defectdojo-/}"
VERSION="${FILE//\.tgz/}"
rm -rf defectdojo-*.tgz
cd ../helm
rm -rf defectdojo
mv ../tmp/defectdojo .
rmdir ../tmp
# add changes here
cd ..
git fetch
thisTag="$(git describe --tags $(git rev-list --tags --max-count=1) --abbrev=0 2>/dev/null || echo "0.0.0" )"
newTag="$(sh ./sem_ver.sh ${thisTag} release)"
helm package helm/defectdojo --version "${VERSION}+SDA.${newTag}" -d helm
URL="https://github.com/SDA-SE/devops-custom-helm-charts/releases/download/${newTag}/"
helm repo index helm/. --merge --url ${URL}
CHART_PACKAGE_NAME="defectdojo-${VERSION}+SDA.${newTag}.tgz"
git add helm/defectdojo helm/index.yaml
git commit -m "Update chart index"
git push origin master
echo "Create new tag ${newTag} (old: ${thisTag})"
gh release create "${newTag}" --title "${newTag}" --notes "This is the next release (${newTag})"
gh release upload "${newTag}" helm/${CHART_PACKAGE_NAME} --clobber
rm helm/${CHART_PACKAGE_NAME}