Skip to content

Commit 5aec867

Browse files
committed
Added release script template and build.xml adjustments
1 parent 044549d commit 5aec867

File tree

2 files changed

+85
-16
lines changed

2 files changed

+85
-16
lines changed

build.xml

+33-16
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@
806806
Update the gh-pages branch with the current site
807807
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
808808
-->
809-
<target name="updateGhPages" depends="buildSite">
809+
<target name="updateGhPages">
810810
<!-- Build gh-pages branch -->
811811
<mx:ghpages repositorydir="${basedir}" obliterate="true" />
812812
</target>
@@ -817,7 +817,7 @@
817817
Publish binaries to Google Code
818818
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
819819
-->
820-
<target name="publishBinaries" depends="clean,buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary" description="Publish the Gitblit binaries to Google Code">
820+
<target name="publishBinaries" description="Publish the Gitblit binaries to Google Code">
821821

822822
<echo>Uploading Gitblit ${project.version} binaries</echo>
823823

@@ -869,32 +869,23 @@
869869
<!--
870870
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
871871
Publish site to site hosting service
872-
You must add ext/commons-net-1.4.0.jar to your ANT classpath.
873872
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
874873
-->
875-
<target name="publishSite" depends="clean,buildSite,updateGhPages" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)" >
874+
<target name="publishSite" depends="clean,buildSite,updateGhPages" description="Publish the Gitblit site to a host" >
876875

877876
<echo>Uploading Gitblit ${project.version} website</echo>
878877

879-
<ftp server="${ftp.server}"
878+
<mx:ftp server="${ftp.server}"
880879
userid="${ftp.user}"
881880
password="${ftp.password}"
882881
remotedir="${ftp.dir}"
883882
passive="true"
884883
verbose="yes">
885884
<fileset dir="${project.siteTargetDirectory}" />
886-
</ftp>
885+
</mx:ftp>
887886
</target>
888887

889888

890-
<!--
891-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
892-
Compile from source, publish binaries, and build & deploy site
893-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
894-
-->
895-
<target name="publishAll" depends="publishBinaries,publishSite" />
896-
897-
898889
<!--
899890
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
900891
Tag a new version and prepare for the next development cycle.
@@ -904,19 +895,45 @@
904895
<!-- release -->
905896
<property name="dryrun" value="false" />
906897
<mx:version stage="release" dryrun="${dryrun}" />
898+
<property name="project.tag" value="v${project.version}" />
907899
<!-- commit build.moxie & releases.moxie (automatic) -->
908900
<mx:commit showtitle="no">
909901
<message>Prepare ${project.version} release</message>
910-
<tag name="v${project.version}">
902+
<tag name="${project.tag}">
911903
<message>${project.name} ${project.version} release</message>
912904
</tag>
913905
</mx:commit>
914906

907+
<!-- create the release process script -->
908+
<mx:if>
909+
<os family="windows" />
910+
<then>
911+
<!-- Windows PowerShell script -->
912+
<!-- set-executionpolicy remotesigned -->
913+
<property name="recipe" value="release_${project.version}.ps1" />
914+
</then>
915+
<else>
916+
<!-- Bash script -->
917+
<property name="recipe" value="release_${project.version}.sh" />
918+
</else>
919+
</mx:if>
920+
<delete file="${recipe}" failonerror="false" quiet="true" verbose="false" />
921+
<!-- Work-around for lack of proper ant property substitution in copy -->
922+
<property name="dollar" value="$"/>
923+
<copy file="release.template" tofile="${recipe}">
924+
<filterset begintoken="${dollar}{" endtoken="}">
925+
<filter token="project.version" value="${project.version}" />
926+
<filter token="project.commitId" value="${project.commitId}" />
927+
<filter token="project.tag" value="${project.tag}" />
928+
</filterset>
929+
</copy>
930+
<chmod file="${recipe}" perm="ugo+rx" />
931+
915932
<!-- next cycle -->
916933
<mx:version stage="snapshot" incrementNumber="incremental" dryrun="${dryrun}" />
917934
<mx:commit showtitle="no">
918935
<message>Reset build identifiers for next development cycle</message>
919-
</mx:commit>
936+
</mx:commit>
920937
</target>
921938

922939

release.template

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
#
3+
# ${project.version} release script
4+
#
5+
6+
# go back one commit to RELEASE commit
7+
echo ""
8+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
9+
echo "Checking out ${project.version} RELEASE commit ${project.commitId}"
10+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
11+
echo ""
12+
git checkout ${project.commitId}
13+
14+
# build RELEASE artifacts
15+
echo ""
16+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
17+
echo "Building ${project.version} RELEASE artifacts"
18+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
19+
echo ""
20+
ant clean buildAll
21+
22+
# upload artifacts
23+
echo ""
24+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
25+
echo "Uploading ${project.version} artifacts"
26+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
27+
echo ""
28+
ant publishBinaries
29+
30+
# build site, update gh-pages, and ftp upload site to hosting provider
31+
echo ""
32+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
33+
echo "Building ${project.version} website"
34+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
35+
echo ""
36+
ant publishSite
37+
38+
# return to project master
39+
echo ""
40+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
41+
echo "Checking out master"
42+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
43+
echo ""
44+
git checkout master
45+
46+
# push project branches
47+
echo ""
48+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
49+
echo "Pushing master, gh-pages, and tag ${project.tag}"
50+
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
51+
echo ""
52+
git push origin master gh-pages tag ${project.tag}

0 commit comments

Comments
 (0)