README, others: prepare release

This commit is contained in:
Thomas Gelf 2019-05-16 17:35:34 +02:00
parent f44e3d2bdb
commit 40391095e3
3 changed files with 19 additions and 12 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
.idea
/vendor/
/.idea/
.*.sw[op]
composer.lock
vendor

View File

@ -6,14 +6,14 @@ for asynchronous PHP-based Icinga Web 2 modules. Please download the latest
release and install it like any other module.
> **HINT**: Do NOT install the GIT master, it will not work! Checking out a
> branch like `stable/0.5.0` or a tag like `v0.5.0` is fine.
> branch like `stable/0.6.0` or a tag like `v0.6.0` is fine.
Sample Tarball installation
---------------------------
```sh
MODULE_NAME=reactbundle
MODULE_VERSION=v0.5.0
MODULE_VERSION=v0.6.0
MODULES_PATH="/usr/share/icingaweb2/modules"
MODULE_PATH="${MODULES_PATH}/${MODULE_NAME}"
RELEASES="https://github.com/Icinga/icingaweb2-module-${MODULE_NAME}/archive"
@ -28,7 +28,7 @@ Sample GIT installation
```sh
MODULE_NAME=reactbundle
MODULE_VERSION=v0.5.0
MODULE_VERSION=v0.6.0
REPO="https://github.com/Icinga/icingaweb2-module-${MODULE_NAME}"
MODULES_PATH="/usr/share/icingaweb2/modules"
git clone ${REPO} "${MODULES_PATH}/${MODULE_NAME}" --branch "${MODULE_VERSION}"
@ -48,4 +48,4 @@ Developer Documentation
e.g.
./bin/make-release.sh 0.5.0
./bin/make-release.sh 0.6.0

View File

@ -8,6 +8,12 @@ if [[ -z $VERSION ]]; then
exit 1
fi
function fail {
local msg="$1"
echo "ERROR: $msg"
exit 1
}
TAG=$(git tag | grep -c "$VERSION")
if [[ "$TAG" -ne "0" ]]; then
@ -20,22 +26,23 @@ BRANCH="stable/$VERSION"
git checkout -b "$BRANCH"
git rm -rf vendor
rm -rf vendor
rm composer.lock
composer install
rm -f composer.lock
composer install || fail "composer install failed"
find vendor/ -type f -name "*.php" \
| grep -v '/examples/' \
| grep -v '/example/' \
| grep -v '/tests/' \
| grep -v '/test/' \
| xargs git add -f
find vendor/ -type f -name LICENSE | xargs git add -f
sed -i "s/^Version:.*/Version: v$VERSION/" module.info
| xargs -L1 git add -f
find vendor/ -type f -name LICENSE | xargs -L1 git add -f
sed -i.bak "s/^Version:.*/Version: v$VERSION/" module.info && rm -f module.info.bak
git add module.info
git add composer.lock
git commit -m "Version v$VERSION"
rm -f composer.lock
rm -rf vendor
git checkout vendor
composer validate --no-check-all --strict || fail "Composer validate failed"
git tag -a v$VERSION -m "Version v$VERSION"
echo "Finished, tagged v$VERSION"