Skip to content

Commit

Permalink
Docs / update versions and fixes in 'Doing a release' page
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 committed Nov 22, 2023
1 parent 2b0def8 commit 44f9258
Showing 1 changed file with 80 additions and 39 deletions.
119 changes: 80 additions & 39 deletions docs/manual/docs/contributing/doing-a-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ with the following utilities: sed, xmlstarlet and sftp.
``` shell
# Setup properties
frombranch=origin/main
versionbranch=4.2.x
version=4.2.3
versionbranch=main
version=4.4.1
minorversion=0
newversion=$version-$minorversion
currentversion=4.2.3-SNAPSHOT
previousversion=4.2.2
nextversion=4.2.4-SNAPSHOT
nextMajorVersion=4.4.0-SNAPSHOT

currentversion=4.4.1-SNAPSHOT
previousversion=4.4.0
nextversion=4.4.2-SNAPSHOT
nextversionNoSnapshot = ${nextversion//-SNAPSHOT/}
nextMajorVersion=4.6.0-SNAPSHOT

# Get the branch
git clone --recursive https://github.com/geonetwork/core-geonetwork.git \
Expand Down Expand Up @@ -71,7 +71,7 @@ with the following utilities: sed, xmlstarlet and sftp.
# Download Jetty and create the installer
cd release
mvn clean install -Djetty-download
mvn clean install -Pjetty-download
ant
Expand All @@ -94,6 +94,43 @@ with the following utilities: sed, xmlstarlet and sftp.
# Set version number to SNAPSHOT
./update-version.sh $newversion $nextversion
# Add SQL migration step for the next version
mkdir web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v${nextversionNoSnapshot}
cat <<EOF > web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v${nextversionNoSnapshot}/migrate-default.sql
UPDATE Settings SET value='${nextversionNoSnapshot}' WHERE name='system/platform/version';
UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion';
EOF
```
In `WEB-INF/config-db/database_migration.xml` add an entry for the new version:
``` shell
line=$(grep -n '</beans>' web/src/main/webResources/WEB-INF/config-db/database_migration.xml | cut -d: -f1)
finalLine=$(($line - 2))
if [[ ${OSTYPE:0:6} == 'darwin' ]]; then
sedopt='-i .bak'
else
sedopt='-i'
fi
sed $sedopt "${finalLine} a\\
<entry key=\"${nextversionNoSnapshot}\">\\
<list>\\
<value>WEB-INF/classes/setup/sql/migrate/v${nextversionNoSnapshot//[.]/}/migrate-</value>\\
</list>\\
</entry>
" web/src/main/webResources/WEB-INF/config-db/database_migration.xml
if [[ ${OSTYPE:0:6} == 'darwin' ]]; then
rm web/src/main/webResources/WEB-INF/config-db/database_migration.xml.bak
fi
```
Commit the changes:
``` shell
git add .
git commit -m "Update version to $nextversion"
Expand All @@ -107,37 +144,41 @@ with the following utilities: sed, xmlstarlet and sftp.
git push origin $version
```
7. Generate checksum files
- If using Linux:
``` shell
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:
``` shell
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:
``` shell
sftp $sourceforge_username,[email protected]
# 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.1
cd v3.12.1
put docs/changes3.12.1-0.txt
put release/target/GeoNetwork*/geonetwork-bundle*.zip*
put web/target/geonetwork.war*
bye
```
7. Generate checksum files
- If using Linux:
``` shell
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:
``` shell
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:
``` shell
# Set your sourceforge username
sourceforge_username=XXXXX
sftp $sourceforge_username,[email protected] << EOT
# 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 v${version}
cd v${version}
put docs/changes{$newversion}.txt
put release/target/GeoNetwork*/geonetwork-bundle*.zip*
put web/target/geonetwork.war*
bye
EOT
```
8. Update or add the changelog in the documentation <https://github.com/geonetwork/doc> .
Expand Down

0 comments on commit 44f9258

Please sign in to comment.