Archive for the ‘General’ Category
Building FubuMVC with a portable version of rake
To build FubuMVC you need to install ruby, rake etc. Unfortunately for me the firewall at work will not allow me to get the rake gem (I’ve downloaded gems before using the HTTP_PROXY setting before but no luck this time). Any hoose I remember reading Stephen Balkum post on packaging up Rake as an executable. I followed Stephens guide and created a portable rake package which got around my firewall problem but FubuMVC required another gem rubyzip to allow a build.
Adding another gem
Luckily using Stephen’s guide its really easy to add extra gems, you just need to have them installed before you build your exe. So we follow the first part of the process outlined in Stephen’s guide then do the following:
NOTE: In this case we need rubyzip but it could be any old gem.
- Download rubyzip and extract to contents to c:\rubywork\zip
- To install rubyzip, at a command prompt in c:\rubywork\zip, run ..\ruby\bin\ruby install.rb
- Download zlib and extract the zlib1.dll to C:\rubywork\ruby\lib\ruby\1.8\i386-mswin32
- Rename zlib1.dll to zlib.dll (rubyzip required this extra dll other gems may not)
Now continue part two of the process from Stephen’s guide to compile your very own allinoneruby.exe which includes, rake and rubyzip.
You should now have allinoneruby.exe and rake.rb file.
Building FubuMVC
We can now drop these files into to the FubuMVC project under the build support folder:
We need a helper batch file in the root folder of FubuMVC called rake.bat which contains:
@.\build_support\allinoneruby.exe .\build_support\rake.rb %*
This will be called when we run the build.
Run the build already
Drop to the command prompt and cd into the FubuMVC project root and simply type build. You should get something like:
Download
Don’t want to go through all that? You can download my version of portable rake here (I don’t think I’m breaking any licensing agreements here, this is all open source software. If I am let me know and I’ll remove the link)
DISCLAIMER: I offer no guarantees I can only confirm this works on my machine!
One final note
I’ve used this method to build some of the other open source projects out there which use rake (all the cool kids seem to be using rake) and so far I’ve not had any problems. This could be pretty frictionless way to introduce rake to a team of .net developers who don’t want the overhead of installing ruby on their machines. Just add it to a tools folder check it in to source control they’ll never know!
HOWTO: Download and run Microsoft Report Builder 1.0
Assuming you have an SQL Server 2005 running reporting services you can run Report builder as a ClickOnce app using the following url:
http://<servername>/reportserver/reportbuilder/reportbuilder.application
TortoiseSVN + Global ignore pattern
build_log.xml *.suo *.user _ReSharper* *.resharper bin obj class build
SAP Portal Developer Guide
Looking for help on the SAP Portal? HTMLB syntax and lots of other goodies this way…
Continuous Integration + CruiseControl.Net + Subversion + MSBuild + .Net 2.0
I’ve read quite a bit about Continuous Integration and the .Net implementation CruiseControl.Net. It always seemed like a really good idea but I’ve never gotten around to trying it out, until now…
By the way setting up the server was a lot easier than I thought it would be! Here’s what I did:
CruiseControl.Net Setup
Download and run CruiseControl.Net setup
http://sourceforge.net/project/showfiles.php?group_id=71179&package_id=83198
I’ve used version 1.0.1:
CruiseControl.NET-1.0.1-Setup.exe
NOTE: After setup if your server has .Net 1.1 and 2.0 as mine did you may need to change the ccnet website to use .Net 2.0. This can be done through the IIS control panel, get the properties of the ccnet site and change via the ASP.NET tab.
Subversion Client
Your server will need the subversion console client on the server to allow CruiseControl to checkout your source.
.Net 2 SDK
To allow us to build .Net 2 projects without the need for Visual Studio we need to download and install .Net 2 SDK onto the server
Setup MSBuild
To use MSBuild with CC.Net we need the logger dll -ThoughtWorks.CruiseControl.MsBuild.dll from:
http://ccnetlive.thoughtworks.com/MSBuildXmlLogger%2DBuilds/
Download and copy to:
C:\Program Files\CruiseControl.NET\webdashboard\bin\
Directory structure
Setup your directory structure:
C:\CI\Myproject\
C:\CI\Myproject\build
C:\CI\Myproject\logs
Using your subversion client checkout source to C:\CI\MyProject\build
ccnet.config
Add the project config to ccnet.confg:
<cruisecontrol>
<project name="MyProject">
<!-- after a change is detected, wait 10 mins and then kick off the build-->
<schedule type="schedule" sleepSeconds="600" />
<!--set the sourcecontrol type to subversion and point to the subversion exe-->
<sourcecontrol type="svn">
<executable>C:\Program Files\Subversion\bin\svn.exe</executable>
<workingDirectory>C:\CI\MyProject\build</workingDirectory>
<trunkUrl>svn://svnserver/MyProject/trunk</trunkUrl>
<autoGetSource>true</autoGetSource>
<username>myuser</username>
<password>mypassword</password>
</sourcecontrol>
<tasks>
<!-- Configure MSBuild to compile the updated files -->c:\
<msbuild>
<executable>C:\windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<workingDirectory>C:\CI\MyProject\build\src\</workingDirectory>
<projectFile>MyProject.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug</buildArgs>
<targets></targets>
<timeout>15</timeout>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\webdashboard\bin\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</tasks>
<!--Publishers will be done after the build has completed-->
<publishers>
<xmllogger>
<logDir>C:\CI\MyProject\Logs</logDir>
</xmllogger>
</publishers>
<modificationDelaySeconds>10</modificationDelaySeconds>
</project>
</cruisecontrol>
CC Tray
You will also want to install the CC Tray monitoring software on your pc:
It will allow you to keep an eye on the server from the comfort of your own pc.
That’s it we’re down!
Subversion server + windows + backup
So you want to backup your repository?
Unfortunately you cannot do a straight backup of your repository as someone may have a file open/locked which will cause problems on restore. So you should do a “hot copy” to prevent any locking issues when the actual backup is made. My “hot copy” is created using the following batch file:
REM Reset hot copy rmdir /S /Q c:\\svnrepos_hotcopy mkdir c:\\svnrepos_hotcopy REM Initiate SVN backup. Use svadmin hotcopy --help for details svnadmin hotcopy c:\\svnrepos c:\\svnrepos_hotcopy --clean-logs
I run this batch file daily as a scheduled task before the actual backup.
This batch file is a modification of the batch file described over at:
Ruby unit testing – Setting up your project folder for testing
Its a good idea to keep your test cases seperate from your production code:
myproject
lib/
workomatic.rb
test/
test_workomatic.rb
When you have your project setup in this way add the following line to the top of your test cases:
Inside test_workomatic.rb
$:.unshift File.join(File.dirname(__FILE__), "..", "lib") require workomatic.rb
Now when you run this test case the workomatic.rb file and all supporting files in the lib folder will be picked up.
My first wordpress post
I’ve defected from blogger.com, so far I’m impressed. Categories, stats, lots of nice skins and the import feature just saved me a boat load of time!
My first post
I hope to use this every day but who knows this might be my only post!