From f3376d6e5fc40fa226ead2870f91e3af0628f92c Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Thu, 11 Sep 2014 21:03:22 +0200 Subject: [PATCH] Added Git revision to build id --- BuildFiles/Packaging/repackage | 32 +++++++++----- BuildFiles/ccnet.config | 80 +++++++++++++++++++++++++++++++--- 2 files changed, 95 insertions(+), 17 deletions(-) mode change 100644 => 100755 BuildFiles/ccnet.config diff --git a/BuildFiles/Packaging/repackage b/BuildFiles/Packaging/repackage index 9278a1ab..90982055 100755 --- a/BuildFiles/Packaging/repackage +++ b/BuildFiles/Packaging/repackage @@ -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 " -s "Swarmops-$PACKAGENAME $(cat $BUILDIDSOURCE | tr -d ' \r') deployed" "swarmops.developers@groups.facebook.com" < deploymsg.txt +mail -a "From: Swarmops Builder " -s "Swarmops-$PACKAGENAME $BUILDID deployed." "swarmops.developers@groups.facebook.com" < deploymsg.txt rm deploymsg.txt -rm $BUILDIDSOURCE +rm BuildIdentity.txt +rm CommitIdentity.txt + diff --git a/BuildFiles/ccnet.config b/BuildFiles/ccnet.config old mode 100644 new mode 100755 index 74753f01..e6637198 --- a/BuildFiles/ccnet.config +++ b/BuildFiles/ccnet.config @@ -5,41 +5,95 @@ C:\Lab\Swarmops\artifact http://build.swarmops.com/server/auxiliary/project/Swarmops/ViewLatestBuildReport.aspx - - svn://repo.swarmops.com/Swarmops/trunk + + git://github.com/Swarmops/Swarmops + master + true + true + true + git + false + false + false + Build {0} + Build-{0} + Swarmops Build + builds@swarmops.com + c:\Lab\Swarmops\build + 180000 + + + - + 5 0 + 0 false + + + + + + + + - C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe + C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe C:\Lab\Swarmops\build - Swarmops.sln + Backend\Backend.csproj + /p:Configuration=Release + Build + 1200 + C:\Program Files (x86)\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll + + + + + + C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe + C:\Lab\Swarmops\build + Interface\Interface.csproj /p:Configuration=Release Build 1200 C:\Program Files (x86)\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll + + C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe + C:\Lab\Swarmops\build + -u -v / -p Site5 Site5-Deployment/ + + C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\aspnet_merge.exe C:\Lab\Swarmops\build Site5-Deployment -o Swarmops.Site.dll - + + cmd.exe @@ -89,6 +143,13 @@ /c echo %CCNetLabel% > \\swarmops-dev\builddrop\BuildDropped.txt + + + + @@ -122,6 +187,7 @@ Failed Fixed + Success