From 2fbe011e992c0ae72a8702200842b498fe5afe57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Wed, 26 Aug 2020 14:57:36 +0200 Subject: [PATCH] version bump script; minor bugfixes --- bump-version.sh | 10 ++++++++++ example/kiwi.yml | 2 +- kiwi | 4 ++-- src/etc/version_tag | 2 +- src/{kiwi-config.py => kiwi-scp.py} | 0 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 bump-version.sh rename src/{kiwi-config.py => kiwi-scp.py} (100%) diff --git a/bump-version.sh b/bump-version.sh new file mode 100755 index 0000000..a9cd35a --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +this="$(readlink -f "${0}")" +this_dir="$(dirname "${this}")" + +git_branch="$(git rev-parse --abbrev-ref HEAD)" +version_str="${git_branch##*/}" + +echo "${version_str}" > "${this_dir}/src/etc/version_tag" +sed -ri "s/(version\s*:).*$/\1 '${version_str}'/" "${this_dir}/example/kiwi.yml" diff --git a/example/kiwi.yml b/example/kiwi.yml index 1ec35f1..56be52f 100644 --- a/example/kiwi.yml +++ b/example/kiwi.yml @@ -2,7 +2,7 @@ # kiwi-scp instance configuration # ################################### -version: '0.1.2' +version: '0.1.3' runtime: storage: /tmp/kiwi diff --git a/kiwi b/kiwi index 9a19718..bf9da3c 100755 --- a/kiwi +++ b/kiwi @@ -12,7 +12,7 @@ KIWI_VERSION_TAG="etc/version_tag" # dependencies to run kiwi-scp KIWI_DEPENDENCIES="python3 pipenv less docker docker-compose" # base install dir -KIWI_BASEDIR="${HOME}/.local/lib/kiwi-scp" +KIWI_BASEDIR="${HOME}/.cache/kiwi-scp" # per-user env setup script KIWI_PROFILE="${HOME}/.kiwi_profile" @@ -122,7 +122,7 @@ fi # run check for new kiwi version if [ "${run_kiwi_check}" = "yes" ]; then # hash this script and the master version - hash_local="$(md5sum <"$(readlink "${0}")")" + hash_local="$(md5sum <"$(readlink -f "${0}")")" hash_remote="$(curl --proto '=https' --tlsv1.2 -sSfL "${KIWI_URI}" | md5sum)" # warn if different diff --git a/src/etc/version_tag b/src/etc/version_tag index 8294c18..b1e80bb 100644 --- a/src/etc/version_tag +++ b/src/etc/version_tag @@ -1 +1 @@ -0.1.2 \ No newline at end of file +0.1.3 diff --git a/src/kiwi-config.py b/src/kiwi-scp.py similarity index 100% rename from src/kiwi-config.py rename to src/kiwi-scp.py