PTU5KAS/scripts/release.sh
Claudius Heine 503cf183b1 kas-container: make container image variables overwritable
This patch introduces new and improved ways to overwrite kas-container
variables that specify which image should be used.

`KAS_CONTAINER_IMAGE_PREFIX`: can be used to overwrite image sources.
For instance if podman is used, the default value `docker://` is used as
a prefix. But it still allows to overwrite it, by setting a custom
variable.

`KAS_CONTAINER_IMAGE_PATH`: can be used to customize the image source
path.

`KAS_CONTAINER_IMAGE_NAME`: can be set to change the container image
name.  For instance if `--isar` is used, the default value is
`kas-isar`, as with `KAS_CONTAINER_IMAGE_PREFIX` this default value can
still be overwritten by setting a custom value.

And last `KAS_IMAGE_VERSION`: It was possible to overwrite this value
before this patch and its still possible. The default value is the
current release version. Setting it for instance to `latest`, would
allow to used the most recent version of the image.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-09-29 08:35:04 +02:00

69 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
OLD_VERSION=$(git describe --abbrev=0)
NEW_VERSION=$1
usage() {
echo "$0: NEW_VERSION"
echo ""
echo "example:"
echo " $0 0.16.0"
}
if [ -z "$NEW_VERSION" ] ; then
usage
exit 1
fi
echo "$NEW_VERSION" > newchangelog
git shortlog "$OLD_VERSION".. >> newchangelog
cat CHANGELOG.md >> newchangelog
$EDITOR newchangelog
echo -n "All fine, ready to release? [y/N]"
read a
a=$(echo "$a" | tr '[:upper:]' '[:lower:]')
if [ "$a" != "y" ]; then
echo "no not happy, let's stop doing the release"
exit 1
fi
mv newchangelog CHANGELOG.md
sed -i "s,\(__version__ =\).*,\1 \'$NEW_VERSION\'," kas/__version__.py
sed -i "s,\( KAS_IMAGE_VERSION_DEFAULT=\).*,\1\"$NEW_VERSION\"," kas-container
git add CHANGELOG.md
git add kas/__version__.py
git add kas-container
git commit -m "Release $NEW_VERSION"
git tag -s -m "Release $NEW_VERSION" "$NEW_VERSION"
git push --follow-tags
python setup.py sdist upload -r pypi
authors=$(git shortlog -s "$OLD_VERSION".."$NEW_VERSION" | cut -c8- | paste -s -d, - | sed -e 's/,/, /g')
highlights=$(cat CHANGELOG.md | sed -e "/$OLD_VERSION/,\$d")
prolog=$PWD/release-email.txt
echo \
"Hi all,
A new release $NEW_VERSION is available. A big thanks to all contributors:
$authors
Highlights in $highlights
Thanks,
Jan
https://github.com/siemens/kas/releases/tag/$NEW_VERSION
https://hub.docker.com/r/kasproject/kas/
"> $prolog
git shortlog $OLD_VERSION..$NEW_VERSION >> $prolog
thunderbird -compose "subject=[ANNOUNCE] Release $NEW_VERSION,to=kas-devel@googlegroups.com,message=$prolog"