You've already forked prometheus-fail2ban-exporter-charts
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
863c3a30c1
|
|||
c9a45d8040
|
|||
24d29f2b09
|
|||
a4180e0953
|
|||
c5783bd053
|
|||
7cfe55a106
|
@ -8,8 +8,8 @@ if [ ! -f "${CHART_FILE}" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DEFAULT_NEW_TAG="$(git describe --abbrev=0)"
|
DEFAULT_NEW_TAG="$(git tag --sort=-version:refname | head -n 1)"
|
||||||
DEFAULT_OLD_TAG="$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")"
|
DEFAULT_OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)"
|
||||||
|
|
||||||
if [ -z "${1}" ]; then
|
if [ -z "${1}" ]; then
|
||||||
read -p "Enter start tag [${DEFAULT_OLD_TAG}]: " OLD_TAG
|
read -p "Enter start tag [${DEFAULT_OLD_TAG}]: " OLD_TAG
|
||||||
@ -54,7 +54,8 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
YAML_FILE=$(mktemp)
|
CHANGE_LOG_YAML=$(mktemp)
|
||||||
|
echo "[]" > "${CHANGE_LOG_YAML}"
|
||||||
|
|
||||||
function map_type_to_kind() {
|
function map_type_to_kind() {
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
@ -79,28 +80,35 @@ function map_type_to_kind() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
COMMIT_TITLES=$(git log "${OLD_TAG}..${NEW_TAG}" --pretty=format:"%s")
|
COMMIT_TITLES="$(git log --pretty=format:"%s" "${OLD_TAG}..${NEW_TAG}")"
|
||||||
|
|
||||||
|
echo "INFO: Generate change log entries from ${OLD_TAG} until ${NEW_TAG}"
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if [[ "${line}" =~ ^([a-zA-Z]+)(\([^\)]+\))?\:\ (.+)$ ]]; then
|
if [[ "${line}" =~ ^([a-zA-Z]+)(\([^\)]+\))?\:\ (.+)$ ]]; then
|
||||||
TYPE="${BASH_REMATCH[1]}"
|
TYPE="${BASH_REMATCH[1]}"
|
||||||
|
KIND=$(map_type_to_kind "${TYPE}")
|
||||||
|
|
||||||
if [ "${TYPE}" == "skip" ]; then
|
if [ "${KIND}" == "skip" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESC="${BASH_REMATCH[3]}"
|
DESC="${BASH_REMATCH[3]}"
|
||||||
KIND=$(map_type_to_kind "${TYPE}")
|
|
||||||
|
|
||||||
yq --inplace ". += [ {\"kind\": \"${KIND}\", \"description\": \"${DESC}\"}]" "${YAML_FILE}"
|
echo "- ${KIND}: ${DESC}"
|
||||||
|
|
||||||
|
jq --arg kind changed --arg description "$DESC" '. += [ $ARGS.named ]' < ${CHANGE_LOG_YAML} > ${CHANGE_LOG_YAML}.new
|
||||||
|
mv ${CHANGE_LOG_YAML}.new ${CHANGE_LOG_YAML}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done <<< "${COMMIT_TITLES}"
|
done <<< "${COMMIT_TITLES}"
|
||||||
|
|
||||||
if [ -s "${YAML_FILE}" ]; then
|
if [ -s "${CHANGE_LOG_YAML}" ]; then
|
||||||
yq --no-colors --inplace ".annotations.\"artifacthub.io/changes\" |= loadstr(\"${YAML_FILE}\") | sort_keys(.)" "${CHART_FILE}"
|
yq --inplace --input-format json --output-format yml "${CHANGE_LOG_YAML}"
|
||||||
|
yq --no-colors --inplace ".annotations.\"artifacthub.io/changes\" |= loadstr(\"${CHANGE_LOG_YAML}\") | sort_keys(.)" "${CHART_FILE}"
|
||||||
else
|
else
|
||||||
echo "ERROR: Changelog file is empty: ${YAML_FILE}" 1>&2
|
echo "ERROR: Changelog file is empty: ${CHANGE_LOG_YAML}" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm "${YAML_FILE}"
|
rm "${CHANGE_LOG_YAML}"
|
||||||
|
@ -2,8 +2,6 @@ name: Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
tags:
|
||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
@ -16,7 +14,7 @@ jobs:
|
|||||||
- name: Install tooling
|
- name: Install tooling
|
||||||
run: |
|
run: |
|
||||||
apk update
|
apk update
|
||||||
apk add git npm yq
|
apk add git npm jq yq
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -24,11 +22,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Add Artifacthub.io annotations
|
- name: Add Artifacthub.io annotations
|
||||||
run: |
|
run: |
|
||||||
git tag
|
NEW_TAG="$(git tag --sort=-version:refname | head --lines 1)"
|
||||||
|
OLD_TAG="$(git tag --sort=-version:refname | head --lines 2 | tail --lines 1)"
|
||||||
NEW_TAG="$(git describe --abbrev=0)"
|
|
||||||
OLD_TAG="$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")"
|
|
||||||
|
|
||||||
.gitea/scripts/add-annotations.sh "${OLD_TAG}" "${NEW_TAG}"
|
.gitea/scripts/add-annotations.sh "${OLD_TAG}" "${NEW_TAG}"
|
||||||
|
|
||||||
- name: Package chart
|
- name: Package chart
|
||||||
|
@ -42,7 +42,7 @@ version of the chart must be in sync with the `values.yaml`. Newer *minor* versi
|
|||||||
versions can break something!
|
versions can break something!
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
CHART_VERSION=0.4.11
|
CHART_VERSION=0.4.16
|
||||||
helm show values prometheus-exporters/prometheus-fail2ban-exporter --version "${CHART_VERSION}" > values.yaml
|
helm show values prometheus-exporters/prometheus-fail2ban-exporter --version "${CHART_VERSION}" > values.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user