bunkerized-nginx/misc/update-version.sh

45 lines
1.3 KiB
Bash
Raw Normal View History

2023-10-02 12:05:15 +02:00
#!/bin/bash
if [ $# -ne 1 ] ; then
echo "Missing version argument"
exit 1
fi
2023-10-02 12:05:15 +02:00
OLD_VERSION="$(tr -d '\n' < src/VERSION | sed 's/\./\\./g' | sed 's/\-/\\-/g')"
NEW_VERSION="$(echo -n "$1" | sed 's/\./\\./g' | sed 's/\-/\\-/g')"
# VERSION
2023-10-02 12:05:15 +02:00
echo -en "$NEW_VERSION" | sed 's/\\//g' | tee src/VERSION
# integrations
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" misc/integrations/*.yml
# examples
2023-10-02 12:05:15 +02:00
shopt -s globstar
for example in examples/* ; do
2023-10-20 16:26:02 +02:00
if [ -d "$example" ] ; then
# shellcheck disable=SC2086
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" ${example}/*.yml
2023-10-02 12:05:15 +02:00
fi
done
2023-10-02 12:05:15 +02:00
shopt -u globstar
# docs
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" docs/*.md
# README
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" README.md
# tests
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" tests/ui/docker-compose.yml
2023-10-02 12:05:15 +02:00
shopt -s globstar
for test in tests/core/* ; do
2023-10-02 12:05:15 +02:00
if [ -d "$test" ] ; then
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" "$test/docker-compose.yml"
fi
done
2023-10-02 12:05:15 +02:00
shopt -u globstar
# linux
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" src/linux/scripts/*.sh
2023-08-07 13:39:26 +02:00
# db
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" src/common/db/model.py
2023-10-20 16:26:02 +02:00
# github
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" .github/ISSUE_TEMPLATE/bug_report.yml
# pyproject
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" pyproject.toml