[Minor] added building of strolch in script to verify setting of versions
This commit is contained in:
parent
4345e3a540
commit
a4c9cdb490
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
declare SCRIPT_NAME="${0##*/}"
|
||||||
|
declare SCRIPT_DIR="$(cd ${0%/*} ; pwd)"
|
||||||
|
root="$(cd ${SCRIPT_DIR}/.. ; pwd)"
|
||||||
|
|
||||||
if [ ! $(which xmlstarlet) ] ; then
|
if [ ! $(which xmlstarlet) ] ; then
|
||||||
echo "ERROR: xmlstarlet is missing!"s
|
echo "ERROR: xmlstarlet is missing!"s
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -17,6 +21,7 @@ function usage() {
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get arguments
|
||||||
while getopts ":b:o:n:r:cp" arg; do
|
while getopts ":b:o:n:r:cp" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
c)
|
c)
|
||||||
|
@ -45,6 +50,7 @@ while getopts ":b:o:n:r:cp" arg; do
|
||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
# validate arguments
|
||||||
if [ -z "${r}" ] || [ -z "${b}" ] || [ -z "${o}" ] || [ -z "${n}" ] ; then
|
if [ -z "${r}" ] || [ -z "${b}" ] || [ -z "${o}" ] || [ -z "${n}" ] ; then
|
||||||
echo "ERROR: Missing an argument!"
|
echo "ERROR: Missing an argument!"
|
||||||
usage
|
usage
|
||||||
|
@ -56,9 +62,7 @@ if [ "$(git status --short)" != "" ] ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
declare SCRIPT_NAME="${0##*/}"
|
# set vars
|
||||||
declare SCRIPT_DIR="$(cd ${0%/*} ; pwd)"
|
|
||||||
|
|
||||||
create_release_branch="${c}"
|
create_release_branch="${c}"
|
||||||
release_branch="${r}"
|
release_branch="${r}"
|
||||||
branch="${b}"
|
branch="${b}"
|
||||||
|
@ -66,9 +70,8 @@ old_version="${o}"
|
||||||
new_version="${n}"
|
new_version="${n}"
|
||||||
push="${p}"
|
push="${p}"
|
||||||
|
|
||||||
root="$(cd ${SCRIPT_DIR}/.. ; pwd)"
|
|
||||||
|
|
||||||
|
|
||||||
|
# log what we are doing
|
||||||
echo "root=${root}"
|
echo "root=${root}"
|
||||||
echo "old_version=${old_version}"
|
echo "old_version=${old_version}"
|
||||||
echo "new_version=${new_version}"
|
echo "new_version=${new_version}"
|
||||||
|
@ -107,6 +110,18 @@ function fail() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build() {
|
||||||
|
cd ${root}
|
||||||
|
if mvn clean package -DskipTests 1> /dev/null ; then
|
||||||
|
echo "INFO: Build OK"
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
echo "ERROR: Build failed!"
|
||||||
|
echo "INFO: Run mvn clean package -DskipTests to see the build problems!"
|
||||||
|
return 1;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# create release branch
|
# create release branch
|
||||||
if [ -n "${create_release_branch}" ] ; then
|
if [ -n "${create_release_branch}" ] ; then
|
||||||
|
@ -131,6 +146,13 @@ if ! git submodule foreach git checkout ${release_branch} ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# build with old version
|
||||||
|
echo "INFO: Building current version ${old_version}..."
|
||||||
|
if ! build ; then
|
||||||
|
fail
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# bump version
|
# bump version
|
||||||
echo -e "\nINFO: Bumping versions..."
|
echo -e "\nINFO: Bumping versions..."
|
||||||
${root}/li.strolch.dev/setVersion.sh ${old_version} ${new_version}
|
${root}/li.strolch.dev/setVersion.sh ${old_version} ${new_version}
|
||||||
|
@ -149,6 +171,13 @@ if ! git submodule foreach git status --short ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# build with new version
|
||||||
|
echo "Building new version ${new_version}..."
|
||||||
|
if ! build ; then
|
||||||
|
fail
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# commit and tag submodules
|
# commit and tag submodules
|
||||||
echo -e "\nINFO: Committing and tagging submodules..."
|
echo -e "\nINFO: Committing and tagging submodules..."
|
||||||
if ! git submodule foreach git add . ; then
|
if ! git submodule foreach git add . ; then
|
||||||
|
|
Loading…
Reference in New Issue