update version script allow different semantic versions

This commit is contained in:
Eugenio Romano
2018-11-19 15:58:56 +00:00
parent 3d0c7449b4
commit 2a816d3b47

View File

@@ -6,6 +6,7 @@ eval GNU=false
eval DIFFERENT_JS_API=false eval DIFFERENT_JS_API=false
eval AUTO=false eval AUTO=false
eval TOTAL_BUILD=true; eval TOTAL_BUILD=true;
eval SEMANTIC="minor";
eval projects=( "core" eval projects=( "core"
"content-services" "content-services"
@@ -25,6 +26,9 @@ show_help() {
echo "-vj or -versionjsapi to use a different version of js-api" echo "-vj or -versionjsapi to use a different version of js-api"
echo "-components execute the change version only in the components " echo "-components execute the change version only in the components "
echo "-v or -version version to update" echo "-v or -version version to update"
echo "-major increase the major number and reset minor and patch"
echo "-minor increase the minor number and reset the patch number"
echo "-patch increase the patch number"
echo "-nextalpha update next alpha version of js-api and lib automatically" echo "-nextalpha update next alpha version of js-api and lib automatically"
echo "-nextbeta update next beta version of js-api and lib automatically" echo "-nextbeta update next beta version of js-api and lib automatically"
echo "-alpha update last alpha version of js-api and lib automatically" echo "-alpha update last alpha version of js-api and lib automatically"
@@ -50,8 +54,8 @@ last_alpha_mode() {
} }
next_alpha_mode() { next_alpha_mode() {
echo "====== Auto find next ALPHA version =====" echo "====== Auto find next ALPHA version ===== ${SEMANTIC} "
VERSION=$(./next_version.sh -minor -alpha) VERSION=$(./next_version.sh -${SEMANTIC} -alpha)
echo "====== version lib ${VERSION} =====" echo "====== version lib ${VERSION} ====="
@@ -62,8 +66,8 @@ next_alpha_mode() {
} }
next_beta_mode() { next_beta_mode() {
echo "====== Auto find next BETA version =====" echo "====== Auto find next BETA version ===== ${SEMANTIC}"
VERSION=$(./next_version.sh -minor -beta) VERSION=$(./next_version.sh -${SEMANTIC} -beta)
echo "====== version lib ${VERSION} =====" echo "====== version lib ${VERSION} ====="
@@ -90,6 +94,11 @@ gnu_mode() {
GNU=true GNU=true
} }
semantic_set() {
echo "====== semantic MODE $1 ====="
SEMANTIC=$1
}
version_change() { version_change() {
echo "====== New version $1 =====" echo "====== New version $1 ====="
VERSION=$1 VERSION=$1
@@ -167,6 +176,19 @@ update_component_js_version(){
} }
args=("$@")
while [[ $1 == -* ]]; do
case "$1" in
-major) semantic_set "major"; shift;;
-minor) semantic_set "minor"; shift;;
-patch) semantic_set "patch"; shift;;
-*) shift;;
esac
done
set -- "${args[@]}"
while [[ $1 == -* ]]; do while [[ $1 == -* ]]; do
case "$1" in case "$1" in
-h|--help|-\?) show_help; exit 0;; -h|--help|-\?) show_help; exit 0;;