1fed20fd0SVladimir Kotal#!/bin/bash 2fed20fd0SVladimir Kotal# 3fed20fd0SVladimir Kotal# Trigger new release creation on Github. 4fed20fd0SVladimir Kotal# Assumes working Maven + Git. 5fed20fd0SVladimir Kotal# 6fed20fd0SVladimir Kotal# see https://github.com/OpenGrok/opengrok/wiki/Release-process 7fed20fd0SVladimir Kotal# 8fed20fd0SVladimir Kotal 9*bd2770a0SVladimir Kotalset -e 10*bd2770a0SVladimir Kotal 11fed20fd0SVladimir Kotalif (( $# != 1 )); then 12fed20fd0SVladimir Kotal echo "usage: `basename $0` <version>" 13fed20fd0SVladimir Kotal exit 1 14fed20fd0SVladimir Kotalfi 15fed20fd0SVladimir Kotal 16fed20fd0SVladimir KotalVERSION=$1 17fed20fd0SVladimir Kotal 18fed20fd0SVladimir Kotalif [[ ! -d $PWD/opengrok-indexer ]]; then 19fed20fd0SVladimir Kotal echo "This needs to be run from top-level directory of the repository" 20fed20fd0SVladimir Kotal exit 1 21fed20fd0SVladimir Kotalfi 22fed20fd0SVladimir Kotal 23fed20fd0SVladimir Kotalver=$( git tag -l "$VERSION" ) 24fed20fd0SVladimir Kotalif (( $? != 0 )); then 25fed20fd0SVladimir Kotal echo "Cannot determine tag" 26fed20fd0SVladimir Kotal exit 1 27fed20fd0SVladimir Kotalfi 28fed20fd0SVladimir Kotalif [[ $ver == $VERSION ]]; then 29fed20fd0SVladimir Kotal echo "Tag $VERSION already exists" 30fed20fd0SVladimir Kotal exit 1 31fed20fd0SVladimir Kotalfi 32fed20fd0SVladimir Kotal 33*bd2770a0SVladimir Kotalgit pull --ff-only 34*bd2770a0SVladimir Kotalmvn versions:set -DgenerateBackupPoms=false "-DnewVersion=$VERSION" 35*bd2770a0SVladimir Kotalgit commit pom.xml '**/pom.xml' -m "$VERSION" 36*bd2770a0SVladimir Kotalgit push 37*bd2770a0SVladimir Kotalgit tag "$VERSION" 38*bd2770a0SVladimir Kotalgit push origin tag "$VERSION" 39