forked from geonetwork/core-geonetwork
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document use of release scripts ahead of 4.4.4 release
These release scripts are from geonetwork#7399 Thanks @fxprunayre for this improvement.
- Loading branch information
1 parent
98cda16
commit 330c079
Showing
8 changed files
with
450 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
|
||
buildRequiredApps=( "java" "git" "mvn" "ant" "xmlstarlet" ) | ||
|
||
for app in "${buildRequiredApps[@]}"; do : | ||
if ! [ -x "$(command -v ${app})" ]; then | ||
echo "Error: ${app} is not installed." >&2 | ||
exit 1 | ||
fi | ||
done | ||
|
||
function showUsage | ||
{ | ||
echo -e "\nThis script is used to build a release for the current branch" | ||
echo | ||
} | ||
|
||
if [ "$1" = "-h" ] | ||
then | ||
showUsage | ||
exit | ||
fi | ||
|
||
projectVersion=`xmlstarlet sel -t -m "/_:project/_:version" -v . -n pom.xml` | ||
subVersion=`cut -d "-" -f 2 <<< $projectVersion` | ||
mainVersion=`cut -d "-" -f 1 <<< $projectVersion` | ||
mainVersionMajor=`cut -d "." -f 1 <<< $mainVersion` | ||
mainVersionMinor=`cut -d "." -f 2 <<< $mainVersion` | ||
mainVersionSub=`cut -d "." -f 3 <<< $mainVersion` | ||
gitBranch=`git branch --show-current` | ||
nextVersionNumber="${mainVersionMajor}.${mainVersionMinor}.$((mainVersionSub+1))" | ||
previousVersionNumber="${mainVersionMajor}.${mainVersionMinor}.$((mainVersionSub-1))" | ||
from=origin | ||
frombranch=origin/${gitBranch} | ||
series=${mainVersionMajor}.${mainVersionMinor} | ||
versionbranch=${gitBranch} | ||
version=${projectVersion} | ||
minorversion=0 | ||
release=latest | ||
newversion=${mainVersion}-$minorversion | ||
currentversion=${projectVersion} | ||
previousversion=${previousVersionNumber} | ||
nextversion=${nextVersionNumber}-SNAPSHOT | ||
echo "Buuilding release for version ${newversion} (from ${currentversion})." | ||
echo "" | ||
echo "Before you start:" | ||
echo "1. Use web-ui/download-from-transifex.sh to update translations" | ||
echo "2. Use release-notes.sh to update change log and release notes" | ||
echo "" | ||
echo "After being build you can test the release before publishing. Git branch ${gitBranch}." | ||
read -p "Press enter to continue" | ||
# Update version number (in pom.xml, installer config and SQL) | ||
./update-version.sh $currentversion $newversion | ||
# Then commit the new version | ||
git add . | ||
git commit -m "Update version to $newversion" | ||
git tag -a $version -m "Tag for $version release" | ||
# Build the new release | ||
mvn clean install -DskipTests -ntp -Pwar -Pwro4j-prebuild-cache | ||
(cd datastorages && mvn clean install -DskipTests -ntp -Drelease -DskipTests) | ||
# Download Jetty and create the installer | ||
(cd release && mvn clean install -Pjetty-download && ant) | ||
# generate checksum for download artifacts | ||
if [ -f "release/target/GeoNetwork-$version/geonetwork-bundle-$newversion.zip.MD5" ]; then | ||
rm release/target/GeoNetwork-$version/geonetwork-bundle-$newversion.zip.MD5 | ||
fi | ||
if [[ ${OSTYPE:0:6} == 'darwin' ]]; then | ||
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 | ||
else | ||
(cd web/target && md5sum geonetwork.war > geonetwork.war.md5) | ||
(cd release/target/GeoNetwork-$version && md5sum geonetwork-bundle-$newversion.zip > geonetwork-bundle-$newversion.zip.md5) | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#!/bin/bash | ||
|
||
buildRequiredApps=( "java" "git" "mvn" "ant" "xmlstarlet" ) | ||
|
||
for app in "${buildRequiredApps[@]}"; do : | ||
if ! [ -x "$(command -v ${app})" ]; then | ||
echo "Error: ${app} is not installed." >&2 | ||
exit 1 | ||
fi | ||
done | ||
|
||
function showUsage | ||
{ | ||
echo -e "\nThis script is used to build a release for the current branch" | ||
echo | ||
} | ||
|
||
if [ "$1" = "-h" ] | ||
then | ||
showUsage | ||
exit | ||
fi | ||
|
||
projectVersion=`xmlstarlet sel -t -m "/_:project/_:version" -v . -n pom.xml` | ||
subVersion=`cut -d "-" -f 2 <<< $projectVersion` | ||
mainVersion=`cut -d "-" -f 1 <<< $projectVersion` | ||
mainVersionMajor=`cut -d "." -f 1 <<< $mainVersion` | ||
mainVersionMinor=`cut -d "." -f 2 <<< $mainVersion` | ||
mainVersionSub=`cut -d "." -f 3 <<< $mainVersion` | ||
gitBranch=`git branch --show-current` | ||
nextVersionNumber="${mainVersionMajor}.${mainVersionMinor}.$((mainVersionSub+1))" | ||
previousVersionNumber="${mainVersionMajor}.${mainVersionMinor}.$((mainVersionSub-1))" | ||
from=origin | ||
frombranch=origin/${gitBranch} | ||
series=${mainVersionMajor}.${mainVersionMinor} | ||
versionbranch=${gitBranch} | ||
version=${projectVersion} | ||
minorversion=0 | ||
release=latest | ||
newversion=${mainVersion}-$minorversion | ||
currentversion=${projectVersion} | ||
previousversion=${previousVersionNumber} | ||
nextversion=${nextVersionNumber}-SNAPSHOT | ||
echo "Creating change log and release notes for version ${newversion} (from ${currentversion}). Git branch ${gitBranch}:" | ||
echo " docs/changes/changes$newversion.txt" | ||
echo " docs/manual/docs/overview/change-log/version-$mainVersion.md" | ||
echo "When generated please review and update:" | ||
echo " docs/manual/mkdocs.yml" | ||
echo " docs/manual/docs/overview/latest/index.md" | ||
echo " docs/manual/docs/overview/change-log/version-$mainVersion.md" | ||
echo "" | ||
read -p "Press enter to continue" | ||
# Generate list of changes | ||
cat <<EOF > docs/changes/changes$newversion.txt | ||
================================================================================ | ||
=== | ||
=== GeoNetwork $version: List of changes | ||
=== | ||
================================================================================ | ||
EOF | ||
git log --pretty='format:- %s' $previousversion... >> docs/changes/changes$newversion.txt | ||
# Generate release notes | ||
cat <<EOF > docs/manual/docs/overview/change-log/version-$mainVersion.md | ||
# Version $mainVersion | ||
GeoNetwork $mainVersion 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-$mainVersion.md | ||
cat <<EOF >> docs/manual/docs/overview/change-log/version-$mainVersion.md | ||
and more \... see [$newversion issues](https://github.com/geonetwork/core-geonetwork/issues?q=is%3Aissue+milestone%3A$mainVersion+is%3Aclosed) and [pull requests](https://github.com/geonetwork/core-geonetwork/pulls?page=3&q=is%3Apr+milestone%3A$mainVersion+is%3Aclosed) for full details. | ||
EOF |
Oops, something went wrong.