Doing a GeoNetwork releaseΒΆ

This section documents the steps followed by the development team to do a new release.

Once the release branch has been thoroughly tested and is stable a release can be made.

  1. Get the source code
currentversion=3.5.x-SNAPSHOT
versionbranch=3.6.x
version=3.6.0
minorversion=0
nextMajorVersion=3.7.0-SNAPSHOT
newversion=$version-$minorversion
previousversion=3.4.4
nextversion=3.6.1-SNAPSHOT
git clone --recursive https://github.com/geonetwork/core-geonetwork.git \
          geonetwork-$versionbranch
cd geonetwork-$versionbranch
  1. (if major version) Create the branch for the version based on master
# Create it if it does not exist yet
git checkout -b $versionbranch origin/master
  1. (if minor version) Move to the branch for the version
# Move into it as it exist (eg. 3.6.x)
git checkout $versionbranch
  1. Update version number
./update-version.sh $currentversion $newversion

This will update all pom.xml, installer build file and data-db-default.sql. Check the path to the documentation in https://github.com/geonetwork/core-geonetwork/blob/master/web-ui/src/main/resources/catalog/js/CatController.js#L259 based on the website folders.

  1. Generate list of changes
cat <<EOF > docs/changes$newversion.txt
================================================================================
===
=== GeoNetwork $version: List of changes
===
================================================================================
EOF
git log --pretty='format:- %s' $previousversion... >> docs/changes$newversion.txt
  1. (if major release) Generate a DB migration script

This will set the version number from master (eg. 3.5.X) to the major release (eg. 3.6.0).

In the following folder web/src/main/webapp/WEB-INF/classes/setup/sql/migrate create v360 folder.

In this folder create a migrate-default.sql with the following content:

UPDATE Settings SET value='3.6.0' WHERE name='system/platform/version';
UPDATE Settings SET value='0' WHERE name='system/platform/subVersion';

In web/src/main/webResources/WEB-INF/config-db/database_migration.xml add the following for the migration to call the migration script:

<entry key="3.6.0">
  <list>
    <value>WEB-INF/classes/setup/sql/migrate/v360/migrate-</value>
  </list>
</entry>

For minor version, this is not required as it is supposed to be done at the end of the release process.

For major version, check that all migration scripts made for the previous minor releases are also in the master branch. If not, backport them.

  1. Build the new release
mvn clean install -DskipTests -Pwith-doc -Des.spring.profile=es -Des.url=
  1. Create the installer
cd release
mvn clean install -Djetty-download
cd ../installer
ant
cd ..
  1. Re-build the new release

This is required as previous step creates a file WEB-INF/server.prop, otherwise the old version will be added to the war file. This should be improved.

mvn clean install -DskipTests -Pwith-doc -Des.spring.profile=es -Des.url=
  1. Commit the new version
# Then commit the new version
git add .
git commit -m "Update version to $newversion"
  1. Test the installer
cd geonetwork-$version
java -jar geonetwork-$newversion/geonetwork-install-$newversion.jar
  1. Tag the release
git tag -a $version -m "Tag for $version release"
git push origin $version
  1. Set version number to SNAPSHOT
./update-version.sh $newversion $nextversion
  1. Add migration script for the next version.

In web/src/main/webResources/WEB-INF/config-db/database_migration.xml add an entry for the new version:

<entry key="3.6.1">
  <list>
    <value>WEB-INF/classes/setup/sql/migrate/v361/migrate-</value>
  </list>
</entry>

In web/src/main/webapp/WEB-INF/classes/setup/sql/migrate, create the SQL migration script:

UPDATE Settings SET value='3.6.1' WHERE name='system/platform/version';
UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion';
  1. Commit/Push the changes for the version update.
git add .
git commit -m "Update version to $nextversion"

git push origin $versionbranch
  1. Merge in depending branches

If needed, merge the changes into the develop branch.

  1. Generate checksum files
  • If using Linux:
cd web/target && md5sum geonetwork.war > geonetwork.war.md5 && cd ../..
cd geonetwork-$version && md5sum geonetwork-install-$newversion.jar > geonetwork-install-$newversion.jar.md5 && cd ..
  • If using Mac OS X:
md5 -r web/target/geonetwork.war > web/target/geonetwork.war.md5
md5 -r geonetwork-$newversion/geonetwork-install-$newversion.jar > geonetwork-$newversion/geonetwork-install-$newversion.jar.md5
  1. Publish in sourceforge
sftp $sourceforge_username,geonetwork@frs.sourceforge.net
# For stable release
cd /home/frs/project/g/ge/geonetwork/GeoNetwork_opensource
# or for RC release
cd /home/frs/project/g/ge/geonetwork/GeoNetwork_unstable_development_versions/
mkdir v3.6.0
cd v3.6.0
put docs/changes3.6.0-0.txt
put geonetwork*/*.jar
put geonetwork*/*.md5
put web/target/geonetwork.war
put web/target/geonetwork.war.md5
bye
  1. Add changes to the documentation https://github.com/geonetwork/website
  1. Update the following files in the website https://github.com/geonetwork/website
  1. Publish the website
  2. Update the release page on github

See https://github.com/geonetwork/core-geonetwork/releases

  1. (if major version) Update master branch for the next version
# Create it if it does not exist yet
git checkout master
./update-version.sh $currentversion $nextMajorVersion

In the following folder web/src/main/webapp/WEB-INF/classes/setup/sql/migrate create v370 folder.

In this folder create a migrate-default.sql with the following content:

UPDATE Settings SET value='3.7.0' WHERE name='system/platform/version';
UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion';

In web/src/main/webResources/WEB-INF/config-db/database_migration.xml add the following for the migration to call the migration script:

<entry key="3.7.0">
  <list>
    <value>WEB-INF/classes/setup/sql/migrate/v370/migrate-</value>
  </list>
</entry>

Commit the new version

git add .
git commit -m "Update version to $nextMajorVersion"
git push origin master