Skip to content

Commit f12685a

Browse files
committed
Added maintaining a Maven repository to the build release process
1 parent d5bdbdf commit f12685a

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

build.moxie

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ url: 'http://gitblit.com'
2222
issuesUrl: 'http://code.google.com/p/gitblit/issues/list'
2323
socialNetworkUrl: 'https://plus.google.com/114464678392593421684'
2424
forumUrl: 'http://groups.google.com/group/gitblit'
25+
mavenUrl: 'http://gitblit.github.io/gitblit-maven'
2526

2627
# Licenses section included for POM generation
2728
licenses:

build.xml

+14-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
<property name="authority.zipfile" value="authority-${project.version}.zip" />
5050
<property name="gbapi.zipfile" value="gbapi-${project.version}.zip" />
5151
<property name="express.zipfile" value="express-${project.version}.zip" />
52-
52+
<property name="maven.directory" value="${basedir}/../gitblit-maven" />
53+
5354
<!-- Download links -->
5455
<property name="gc.url" value="http://code.google.com/p/gitblit/downloads/detail?name=" />
5556
</target>
@@ -812,6 +813,16 @@
812813

813814
</target>
814815

816+
<!--
817+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
818+
Package and deploy RELEASE artifacts to the Maven repository
819+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
820+
-->
821+
<target name="buildMavenArtifacts" depends="prepare">
822+
<mx:package />
823+
<mx:deploy basedir="${maven.directory}" allowsnapshots="false" />
824+
</target>
825+
815826

816827
<!--
817828
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -966,6 +977,8 @@
966977
<filter token="project.version" value="${project.version}" />
967978
<filter token="project.commitId" value="${project.commitId}" />
968979
<filter token="project.tag" value="${project.tag}" />
980+
<filter token="project.directory" value="${basedir}" />
981+
<filter token="maven.directory" value="${maven.directory}" />
969982
</filterset>
970983
</copy>
971984
<chmod file="${recipe}" perm="ugo+rx" />

release.template

+32
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
# ${project.version} release script
44
#
55

6+
# ensure Maven repository is up-to-date
7+
echo ""
8+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
9+
echo "Preparing Maven repository"
10+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
11+
echo ""
12+
cd ${maven.directory}
13+
git checkout gh-pages
14+
git pull
15+
cd ${project.directory}
16+
617
# go back one commit to RELEASE commit
718
echo ""
819
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
@@ -19,6 +30,17 @@ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1930
echo ""
2031
ant clean buildAll
2132

33+
# commit all generated artifacts and metadata
34+
echo ""
35+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
36+
echo "Committing Maven repository ${project.version} RELEASE artifacts"
37+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
38+
echo ""
39+
cd ${maven.directory}
40+
git add .
41+
git commit -m "${project.version} artifacts"
42+
cd ${project.directory}
43+
2244
# upload artifacts
2345
echo ""
2446
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
@@ -43,6 +65,16 @@ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
4365
echo ""
4466
git checkout master
4567

68+
# push Maven repository to origin
69+
echo ""
70+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
71+
echo "Pushing Maven repository"
72+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
73+
echo ""
74+
cd ${maven.directory}
75+
git push origin gh-pages
76+
cd ${project.directory}
77+
4678
# push project branches
4779
echo ""
4880
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

0 commit comments

Comments
 (0)