From 97c0649e03b954efe2e5a2e83c4e913b71692954 Mon Sep 17 00:00:00 2001 From: Rakhesh Sasidharan Date: Sun, 24 Jan 2021 15:42:09 +0000 Subject: [PATCH] add a script to tag so i don't have to type always --- taggh.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 taggh.sh diff --git a/taggh.sh b/taggh.sh new file mode 100755 index 0000000..46f5851 --- /dev/null +++ b/taggh.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Usage ./taggh.sh +# Tag and push to GitHub + +BUILDINFO="$(pwd)/buildinfo.json" +if ! [[ -r "$BUILDINFO" ]]; then echo "Cannot find $BUILDINFO file. Exiting ..."; exit 1; fi + +if ! command -v jq &> /dev/null; then echo "Cannot find jq. Exiting ..."; exit 1; fi + +VERSION=$(jq -r '.version' $BUILDINFO) +IMAGENAME=$(jq -r '.imagename' $BUILDINFO) + +git tag -a ${VERSION} -m ${VERSION} +git push origin ${VERSION} \ No newline at end of file