forked from geonetwork/core-geonetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-publish.sh
executable file
·56 lines (47 loc) · 1.24 KB
/
release-publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
function showUsage
{
echo -e "\nThis script is used to publish a release on sourceforge, github and maven repository"
echo
echo -e "Usage: ./`basename $0` sourceforge_username [remote]"
echo
echo -e "Example:"
echo -e "\t./`basename $0` sourceforgeusername"
echo -e "\t./`basename $0` sourceforgeusername upstream"
echo
}
if [ "$1" = "-h" ]
then
showUsage
exit
fi
if [[ ($# -ne 1) && ($# -ne 2) ]]
then
showUsage
exit
fi
projectVersion=`xmlstarlet sel -t -m "/_:project/_:version" -v . -n pom.xml`
version=`cut -d "-" -f 1 <<< $projectVersion`
versionbranch=`git branch --show-current`
sourceforge_username=$1
remote=origin
if [ $# -eq 2 ]
then
remote=$2
fi
# Push the branch and tag to github
git push $remote $versionbranch
git push $remote $version
# TODO: attach release notes to version
sftp $sourceforge_username,geonetwork@frs.sourceforge.net << EOT
cd /home/frs/project/g/ge/geonetwork/GeoNetwork_opensource
mkdir v${version}
cd v${version}
put docs/changes/changes${version}-0.txt
put release/target/GeoNetwork*/geonetwork-bundle*.zip*
put web/target/geonetwork.war*
put datastorages/*/target/*.zip
bye
EOT
# Deploy to osgeo repository (requires credentials in ~/.m2/settings.xml)
mvn deploy -DskipTests -Drelease