From 3080cb41561519b79f36247118612ed817cb23e4 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 26 Mar 2019 01:31:30 +0100 Subject: [PATCH] README: syntax, cleanup, fix path, prepare v0.5.0 fixes #3 --- README.md | 34 ++++++++++++++++++---------------- bin/make-release.sh | 4 ++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 11aef5d..8206de7 100644 --- a/README.md +++ b/README.md @@ -5,34 +5,36 @@ This repository is an attempt to ship 3rd party libraries that might be useful 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! +> **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. Sample Tarball installation --------------------------- ```sh -RELEASES="https://github.com/Icinga/icingaweb2-module-reactbundle/archive" \ -&& MODULES_PATH="/usr/share/icingaweb2/modules" \ -&& MODULE_VERSION=0.4.1 \ -&& mkdir "$MODULES_PATH" \ -&& wget -q $RELEASES/v${MODULE_VERSION}.tar.gz -O - \ - | tar xfz - -C "$MODULES_PATH" --strip-components 1 -icingacli module enable reactbundle +MODULE_NAME=reactbundle +MODULE_VERSION=v0.5.0 +MODULES_PATH="/usr/share/icingaweb2/modules" +MODULE_PATH="${MODULES_PATH}/${MODULE_PATH}" +RELEASES="https://github.com/Icinga/icingaweb2-module-${MODULE_NAME}/archive" +mkdir "$MODULE_PATH" \ +&& wget -q $RELEASES/${MODULE_VERSION}.tar.gz -O - \ + | tar xfz - -C "$MODULE_PATH" --strip-components 1 +icingacli module enable "${MODULE_NAME}" ``` Sample GIT installation ----------------------- ```sh -REPO="https://github.com/Icinga/icingaweb2-module-reactbundle" \ -&& MODULES_PATH="/usr/share/icingaweb2/modules" \ -&& MODULE_VERSION=0.4.1 \ -&& mkdir -p "$MODULES_PATH" \ -&& git clone ${REPO} "${MODULES_PATH}/reactbundle" --branch v${MODULE_VERSION} -icingacli module enable reactbundle +MODULE_NAME=reactbundle +MODULE_VERSION=v0.5.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}" +icingacli module enable "${MODULE_NAME}" ``` - Developer Documentation ----------------------- @@ -46,4 +48,4 @@ Developer Documentation e.g. - ./bin/make-release.sh 0.1.0 + ./bin/make-release.sh 0.5.0 diff --git a/bin/make-release.sh b/bin/make-release.sh index e54d9fc..6f39b0a 100755 --- a/bin/make-release.sh +++ b/bin/make-release.sh @@ -2,7 +2,7 @@ VERSION="$1" -if [ -z $VERSION ]; then +if [[ -z $VERSION ]]; then echo "USAGE: $0 " echo " e.g.: $0 0.1.0" exit 1 @@ -10,7 +10,7 @@ fi TAG=$(git tag | grep -c "$VERSION") -if [ "$TAG" -ne "0" ]; then +if [[ "$TAG" -ne "0" ]]; then echo -n "Version $VERSION has already been tagged: " git tag | grep "$VERSION" exit 1