Added Git revision to build id

This commit is contained in:
Rick Falkvinge
2014-09-11 21:03:22 +02:00
parent 40b2c1215a
commit f3376d6e5f
2 changed files with 95 additions and 17 deletions
+22 -10
View File
@@ -55,10 +55,19 @@ else
fi
PACKAGENAME=$PACKAGE$CONTROLSUFFIX
BUILDIDSOURCE="BuildIdentity.txt"
cp ../lastbuild/frontend/BuildIdentity.txt ./BuildIdentity.txt
cp ../lastbuild/frontend/BuildIdentity.txt ../lastbuild/backend/.
cp ../lastbuild/frontend/CommitIdentity.txt ./CommitIdentity.txt
BUILDID=$(cat BuildIdentity.txt | tr -d ' \r')
COMMITID=$(cat CommitIdentity.txt | tr -d ' \r')
BUILDID=$(echo $BUILDID | cut -c 1-8)$(echo $COMMITID | cut -c 1-7)
echo ""
echo "Building package $PACKAGENAME $BUILDID."
echo "----------------------------------------------------------------------"
echo ""
# Delete flag that indicates a new drop is available
#rm /home/packaging/lastbuild/BuildDropped.txt
@@ -123,12 +132,13 @@ else
fi
fi
echo "Converting possible CRLF line endings in scripts to LF-only..."
dos2unix DEBIAN/*
dos2unix etc/init.d/*
echo "Converting CRLF line endings in scripts to LF-only..."
dos2unix -q DEBIAN/*
dos2unix -q etc/init.d/*
echo "Setting build number ($(cat ../$BUILDIDSOURCE | tr -d ' \r'))..."
sed -i "s/--BuildNumber--/$(cat ../$BUILDIDSOURCE | tr -d ' \r')/" DEBIAN/control
echo "Setting build number $BUILDID..."
sed -i "s/--BuildNumber--/$BUILDID/" DEBIAN/control
echo $BUILDID > $DEPLOYDIR/$TARGETDIR/BuildIdentity.txt
# Calculating new checksums
echo "Creating MD5 checksum file..."
@@ -157,7 +167,7 @@ rm swarmops-$PACKAGENAME-latest.deb
rm -rf debian
echo "Notifying developers that new build has deployed for test..."
echo "Package swarmops-$PACKAGENAME build $(cat $BUILDIDSOURCE | tr -d ' \r') has been deployed from continuous integration." > deploymsg.txt
echo "Package swarmops-$PACKAGENAME $BUILDID has been deployed from continuous integration." > deploymsg.txt
echo "" >> deploymsg.txt
echo "The package is available from repositories now, and can be tested at http://dev.swarmops.com/ as usual." >> deploymsg.txt
@@ -166,7 +176,9 @@ if [ ! "$2" == "" ]; then
echo "Note that this is a $2 package." >> deploymsg.txt
fi
mail -a "From: Swarmops Builder <builds@swarmops.com>" -s "Swarmops-$PACKAGENAME $(cat $BUILDIDSOURCE | tr -d ' \r') deployed" "swarmops.developers@groups.facebook.com" < deploymsg.txt
mail -a "From: Swarmops Builder <builds@swarmops.com>" -s "Swarmops-$PACKAGENAME $BUILDID deployed." "swarmops.developers@groups.facebook.com" < deploymsg.txt
rm deploymsg.txt
rm $BUILDIDSOURCE
rm BuildIdentity.txt
rm CommitIdentity.txt
Regular → Executable
+73 -7
View File
@@ -5,41 +5,95 @@
<artifactDirectory>C:\Lab\Swarmops\artifact</artifactDirectory>
<webURL>http://build.swarmops.com/server/auxiliary/project/Swarmops/ViewLatestBuildReport.aspx</webURL>
<sourcecontrol type="svn">
<trunkUrl>svn://repo.swarmops.com/Swarmops/trunk</trunkUrl>
<sourcecontrol type="git">
<repository>git://github.com/Swarmops/Swarmops</repository>
<branch>master</branch>
<cleanUntrackedFiles>true</cleanUntrackedFiles>
<autoGetSource>true</autoGetSource>
<fetchSubmodules>true</fetchSubmodules>
<executable>git</executable>
<tagOnSuccess>false</tagOnSuccess>
<commitBuildModifications>false</commitBuildModifications>
<commitUntrackedFiles>false</commitUntrackedFiles>
<tagCommitMessage>Build {0}</tagCommitMessage>
<tagNameFormat>Build-{0}</tagNameFormat>
<committerName>Swarmops Build</committerName>
<committerEMail>builds@swarmops.com</committerEMail>
<workingDirectory>c:\Lab\Swarmops\build</workingDirectory>
<timeout>180000</timeout>
</sourcecontrol>
<!--<sourcecontrol type="svn">
<trunkUrl>https://github.com/Swarmops/Swarmops/trunk</trunkUrl>
<workingDirectory>C:\Lab\Swarmops\build</workingDirectory>
<cleanCopy>true</cleanCopy>
<timeout>1800000</timeout>
</sourcecontrol>
</sourcecontrol>-->
<triggers>
<intervalTrigger name="continuous" seconds="30" />
<intervalTrigger name="continuous" seconds="60" />
</triggers>
<labeller type="assemblyVersionLabeller">
<major>5</major>
<minor>0</minor>
<revision>0</revision>
<incrementOnFailure>false</incrementOnFailure>
</labeller>
<tasks>
<!-- Clear various temp directories, or MSBuild will vomit -->
<!--<exec>
<executable>cmd.exe</executable>
<buildArgs>/c del /s /q %LocalAppData%\Temp\"Temporary ASP.Net Files"</buildArgs>
</exec>
<exec>
<executable>cmd.exe</executable>
<buildArgs>/c del /s /q C:\Windows\Microsoft.NET\Framework\v4.0.30319\"Temporary ASP.NET Files"</buildArgs>
</exec>-->
<!-- Build backend -->
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<executable>C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>C:\Lab\Swarmops\build</workingDirectory>
<projectFile>Swarmops.sln</projectFile>
<projectFile>Backend\Backend.csproj</projectFile>
<buildArgs>/p:Configuration=Release</buildArgs>
<targets>Build</targets>
<timeout>1200</timeout>
<logger>C:\Program Files (x86)\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll</logger>
</msbuild>
<!-- Build frontend -->
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>C:\Lab\Swarmops\build</workingDirectory>
<projectFile>Interface\Interface.csproj</projectFile>
<buildArgs>/p:Configuration=Release</buildArgs>
<targets>Build</targets>
<timeout>1200</timeout>
<logger>C:\Program Files (x86)\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll</logger>
</msbuild>
<exec>
<executable>C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe</executable>
<baseDirectory>C:\Lab\Swarmops\build</baseDirectory>
<buildArgs>-u -v / -p Site5 Site5-Deployment/</buildArgs>
</exec>
<exec>
<executable>C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\aspnet_merge.exe</executable>
<baseDirectory>C:\Lab\Swarmops\build</baseDirectory>
<buildArgs>Site5-Deployment -o Swarmops.Site.dll</buildArgs>
</exec>
<!-- deploy: only on success of all steps above -->
<!-- Deploy: only on success of all steps above -->
<exec>
<executable>cmd.exe</executable>
@@ -89,6 +143,13 @@
<buildArgs>/c echo %CCNetLabel% > \\swarmops-dev\builddrop\BuildDropped.txt</buildArgs>
</exec>
<!-- once build is deployed, delete the whole build dir to force a new git clone -->
<!--<exec>
<executable>cmd.exe</executable>
<buildArgs>/c del /s /q C:\Lab\Swarmops\build</buildArgs>
</exec>-->
<!-- Analysis: QA that is not build-breaking: FxCop etc. -->
<!--
<exec>
@@ -115,6 +176,10 @@
<mailhost>192.168.80.204</mailhost>
<users>
<user name="Rick Falkvinge" group="buildmaster" address="swarmops-builds@falkvinge.net" />
<user name="Leif Ershag" group="devs" address="leif@ershag.se" />
<user name="Tom Jeffries" group="devs" address="tom@safe-xchange.com" />
<user name="Christiaan de Die" group="devs" address="christiaan@droiddev.nl" />
<user name="Facebook dev group" group="devs" address="swarmops.developers@groups.facebook.com" />
<!-- <user name="Jörgen Lindell" group="buildmaster" address="jorgen.lindell@gmail.com" /> -->
</users>
<groups>
@@ -122,6 +187,7 @@
<notifications>
<notificationType>Failed</notificationType>
<notificationType>Fixed</notificationType>
<notificationType>Success</notificationType>
</notifications>
</group>
<group name="buildmaster">