From b8f876bfcddf52269bd9e47faf5c89e22e12275c Mon Sep 17 00:00:00 2001 From: Sander Schaminee Date: Thu, 14 Jan 2021 12:02:14 +0100 Subject: [PATCH] Move release build properties to separate file (#5348) * Moved "global" props to build.properties file * Fixed shell scripts to replace versions in build.properties * Additional updates for updateReleaseVersions.sh - Version check fixes to in case a version number has more than 1 digit. - Fix path for documents conf.py update * Update updateBranchVersions.sh - Version check fixes to in case a version number has more than 1 digit. - Fix path for documents conf.py update * Fix regular expression in updateReleaseVersions.sh * Update resetReleaseVersions.sh - Version check fixes to in case a version number has more than 1 digit. - Fix path for documents conf.py update Co-authored-by: josegar74 --- release/build.properties | 15 +++++++ release/build.xml | 94 +++++++++++++--------------------------- resetReleaseVersions.sh | 15 ++++--- update-version.sh | 10 ++--- updateBranchVersions.sh | 19 ++++---- updateReleaseVersions.sh | 14 +++--- 6 files changed, 77 insertions(+), 90 deletions(-) create mode 100644 release/build.properties diff --git a/release/build.properties b/release/build.properties new file mode 100644 index 00000000000..7f24e7563e0 --- /dev/null +++ b/release/build.properties @@ -0,0 +1,15 @@ +# General properties +appName=GeoNetwork +displayName=GeoNetwork opensource +homepage=https://geonetwork-opensource.org +supportEmail=geonetwork-users@lists.sourceforge.net + +# Application version properties +version=4.0.6 +subVersion=SNAPSHOT + +# Java runtime properties +javaVersion=1.8.0 +javaDisplayVersion=8 +jreUrl=https://adoptopenjdk.net/?variant=openjdk8 +jreName=AdoptOpenJDK diff --git a/release/build.xml b/release/build.xml index 32918f13474..100cfaa733f 100644 --- a/release/build.xml +++ b/release/build.xml @@ -43,22 +43,19 @@ - - - - - - - - - - + + + + + + - + + @@ -69,43 +66,17 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - + @@ -120,15 +91,12 @@ filtering="on" overwrite="yes"/> - - - - - - - - + + + + + + @@ -143,26 +111,24 @@ - - - - + - + - + - + - + + - + @@ -170,11 +136,11 @@ + tofile="target/${appName}-${version}/${appName}-${version}-${subVersion}.war" /> - + diff --git a/resetReleaseVersions.sh b/resetReleaseVersions.sh index a6188ea6ef2..3072b0cb07f 100644 --- a/resetReleaseVersions.sh +++ b/resetReleaseVersions.sh @@ -30,7 +30,9 @@ then fi -if [[ $1 != [0-9].[0-9].[0-9] ]]; then +if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo +else echo echo 'Update failed due to incorrect versionnumber format: ' $1 echo 'The format should be three numbers separated by dots. e.g.: 2.7.0' @@ -40,7 +42,9 @@ if [[ $1 != [0-9].[0-9].[0-9] ]]; then exit fi -if [[ $2 != [0-9].[0-9].[0-9] ]]; then +if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo +else echo echo 'Update failed due to incorrect new versionnumber format (' $2 ')' echo 'The format should be three numbers separated by dots. e.g.: 2.7.1' @@ -63,11 +67,10 @@ echo 'sed will use the following option: ' $sedopt echo # Update version in sphinx doc files -sed $sedopt "s/${version}/${new_version}/g" docs/eng/users/source/conf.py -sed $sedopt "s/${version}/${new_version}/g" docs/eng/developer/source/conf.py +sed $sedopt "s/${version}/${new_version}/g" docs/manuals/source/conf.py -# Update ZIP distribution -sed $sedopt "s/\/\/g" release/build.xml +# Update release version +sed $sedopt "s/version=${version}/version=${new_version}/g" release/build.properties # Update version pom files find . -name pom.xml -exec sed $sedopt "s/${version}/${new_version}/g" {} \; diff --git a/update-version.sh b/update-version.sh index 040ad11e94f..c10237ca05b 100755 --- a/update-version.sh +++ b/update-version.sh @@ -100,11 +100,11 @@ echo ' * updating docs/manuals/source/conf.py' sed $sedopt "s/${version}/${new_version_main}/g" docs/manuals/source/conf.py echo -# Update ZIP distro -echo 'ZIP distribution' -echo ' * updating release/build.xml' -sed $sedopt "s/property name=\"version\" value=\".*\"/property name=\"version\" value=\"${new_version_main}\"/g" release/build.xml -sed $sedopt "s/property name=\"subVersion\" value=\".*\"/property name=\"subVersion\" value=\"${sub_version}\"/g" release/build.xml +# Update release properties +echo 'Release (ZIP bundle)' +echo ' * updating release/build.properties' +sed $sedopt "s/version=.*/version=${new_version_main}/g" release/build.properties +sed $sedopt "s/subVersion=.*/subVersion=${sub_version}/g" release/build.properties echo # Update SQL - needs improvements diff --git a/updateBranchVersions.sh b/updateBranchVersions.sh index 90164dc8037..512d4d96bcb 100755 --- a/updateBranchVersions.sh +++ b/updateBranchVersions.sh @@ -26,7 +26,9 @@ then exit fi -if [[ $1 != [0-9].[0-9].[0-9] ]]; then +if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo +else echo echo 'Update failed due to incorrect versionnumber format (' $1 ')' echo 'The format should be three numbers separated by dots. e.g.: 2.7.0' @@ -36,7 +38,9 @@ if [[ $1 != [0-9].[0-9].[0-9] ]]; then exit fi -if [[ $2 != [0-9].[0-9].[0-9] ]]; then +if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo +else echo echo 'Update failed due to incorrect new versionnumber format (' $2 ')' echo 'The format should be three numbers separated by dots. e.g.: 2.7.1' @@ -62,12 +66,11 @@ version="$1" new_version="$2" # Update version in sphinx doc files -sed $sedopt "s/${version}/${new_version}-SNAPSHOT/g" docs/eng/users/source/conf.py -sed $sedopt "s/${version}/${new_version}-SNAPSHOT/g" docs/eng/developer/source/conf.py +sed $sedopt "s/${version}/${new_version}-SNAPSHOT/g" docs/manuals/source/conf.py -# Update ZIP distribution -sed $sedopt "s/\/\/g" release/build.xml -sed $sedopt "s/\/\/g" release/build.xml +# Update release properties +sed $sedopt "s/version=${version}/version=${new_version}/g" release/build.properties +sed $sedopt "s/subVersion=0/subVersion=SNAPSHOT/g" release/build.properties # Update version pom files -find . -name pom.xml -exec sed $sedopt "s/${version}/${new_version}-SNAPSHOT/g" {} \; \ No newline at end of file +find . -name pom.xml -exec sed $sedopt "s/${version}/${new_version}-SNAPSHOT/g" {} \; diff --git a/updateReleaseVersions.sh b/updateReleaseVersions.sh index e314733d983..f2777f93c04 100755 --- a/updateReleaseVersions.sh +++ b/updateReleaseVersions.sh @@ -26,8 +26,9 @@ then exit fi -if [[ $1 != [0-9].[0-9].[0-9] ]]; then - echo +if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then + echo +else echo 'Update failed due to incorrect versionnumber format: ' $1 echo 'The format should be three numbers separated by dots. e.g.: 2.7.0' echo @@ -51,11 +52,10 @@ echo version="$1" # Update version in sphinx doc files -sed $sedopt "s/${version}-SNAPSHOT/${version}/g" docs/eng/users/source/conf.py -sed $sedopt "s/${version}-SNAPSHOT/${version}/g" docs/eng/developer/source/conf.py +sed $sedopt "s/${version}-SNAPSHOT/${version}/g" docs/manuals/source/conf.py -# Update ZIP distribution -sed $sedopt "s/\/\/g" release/build.xml +# Update release subversion +sed $sedopt "s/subVersion=SNAPSHOT/subVersion=0/g" release/build.properties # Update version pom files -find . -name pom.xml -exec sed $sedopt "s/${version}-SNAPSHOT/${version}/g" {} \; \ No newline at end of file +find . -name pom.xml -exec sed $sedopt "s/${version}-SNAPSHOT/${version}/g" {} \;