Aller au contenu

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. Prepare the release (examples prepairs version 3.12.12 as latest release):

    # Setup properties
    frombranch=origin/3.12.x
    versionbranch=3.12.x
    version=3.12.12
    minorversion=0
    newversion=$version-$minorversion
    currentversion=3.12-SNAPSHOT
    previousversion=3.12.11
    nextversion=3.12.13
    nextversionsnapshot=$currentversion
    nextMajorVersion=4.0.0-SNAPSHOT
    
    
    # Get the branch
    git clone --recursive https://github.com/geonetwork/core-geonetwork.git \
              geonetwork-$versionbranch
    cd geonetwork-$versionbranch
    
    
    # Create or move to the branch for the version
    # Create it if it does not exist yet
    git checkout -b $versionbranch $frombranch
    # or move into it if it exist
    # git checkout $versionbranch
    # or stay in main branch if the release is on main
    
    
    # Update version number (in pom.xml, installer config and SQL)
    ./update-version.sh $currentversion $version
    
    # 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
    
  2. Create change log page: docs/manual/docs/overview/change-log/

    cat <<EOF > docs/manual/docs/overview/change-log/version-$version.md
    # Version $version
    
    GeoNetwork $version is a minor release.
    
    ## Migration notes
    
    ### API changes
    
    ### Installation changes
    
    ### Index changes
    
    ## List of changes
    
    Major changes:
    
    EOF
    
    git log --pretty='format:* %N' $previousversion... | grep -v "^* $" >> docs/manual/docs/overview/change-log/version-$version.md
    
    cat <<EOF >> docs/manual/docs/overview/change-log/version-$version.md
    
    and more \... see [$version issues](https://github.com/geonetwork/core-geonetwork/issues?q=is%3Aissue+milestone%3A$version+is%3Aclosed) and [pull requests](https://github.com/geonetwork/core-geonetwork/pulls?page=3&q=is%3Apr+milestone%3A$version+is%3Aclosed) for full details.
    EOF
    

    Fill in the above markdown file, removing any unused headings.

  3. Update links and navigation:

  4. docs/manual/mkdocs.yml

  5. docs/manual/docs/overview/change-log/maintenance.md

Test documentation locally:

cd docs/manual
mkdocs serve
Once running check the new page:
open http://localhost:8000/ocverview/change-log/$newversion

  1. Commit & tag the new version

    # Then commit the new version
    git add .
    git commit -m "Update version to $newversion"
    
    # Create the release tag
    git tag -a $version -m "Tag for $version release"
    
  2. Build

    # Build the new release
    mvn clean install -DskipTests
    
    
    # Download Jetty and create the installer
    cd release
    mvn clean install -Pjetty-download,bundle
    ant
    
    # Deploy to osgeo repository (requires credentials in ~/.m2/settings.xml)
    cd ..
    mvn deploy -Drelease
    
  3. Test

    cd target/GeoNetwork-$version
    unzip geonetwork-bundle-$newversion.zip -d geonetwork-bundle-$newversion
    cd geonetwork-bundle-$newversion/bin
    ./startup.sh -f
    
  4. Set the next version

    # Set version number to SNAPSHOT
    ./update-version.sh $version $nextversionsnapshot
    
    # Add SQL migration step for the next version
    mkdir web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v${nextversion//[.]/}
    cat <<EOF > web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v${nextversion//[.]/}/migrate-default.sql
    UPDATE Settings SET value='${nextversion}' WHERE name='system/platform/version';
    UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion';
    EOF
    vi web/src/main/webResources/WEB-INF/config-db/database_migration.xml
    

    In WEB-INF/config-db/database_migration.xml add an entry for the new version in the 2 steps:

    <entry key="3.12.13">
      <list>
        <value>WEB-INF/classes/setup/sql/migrate/v31213/migrate-</value>
      </list>
    </entry>
    
    git add .
    git commit -m "Update version to $nextversionsnapshot"
    
  5. Publishing

    # Push the branch and tag
    git push origin $versionbranch
    git push origin $version
    
  6. Generate checksum files

    • If using Linux:

      cd web/target && md5sum geonetwork.war > geonetwork.war.md5 && cd ../..
      cd release/target/GeoNetwork-$version && md5sum geonetwork-bundle-$newversion.zip >  geonetwork-bundle-$newversion.zip.md5 && cd ../../..
      
    • If using Mac OS X:

      md5 -r web/target/geonetwork.war > web/target/geonetwork.war.md5
      md5 -r release/target/GeoNetwork-$newversion/geonetwork-bundle-$newversion.zip > release/target/GeoNetwork-$newversion/geonetwork-bundle-$newversion.zip.md5
      

    On sourceforge first:

    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.12.12
    cd v3.12.12
    put docs/changes3.12.12-0.txt
    put release/target/GeoNetwork*/geonetwork-bundle*.zip*
    put web/target/geonetwork.war*
    bye
    
  7. Update or add the changelog in the documentation https://github.com/geonetwork/doc .

  8. Close the milestone on github https://github.com/geonetwork/core-geonetwork/milestones?state=closed with link to sourceforge download.

    Publish the release on github https://github.com/geonetwork/core-geonetwork/releases .

    Update the website links https://github.com/geonetwork/website .

    Send an email to the mailing lists.

  9. Merge in depending branches

    If a major version, then master version has to be updated to the next one (eg. if 3.8.0, then 3.7.x is 3.9.x).

    # 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