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