20 February 2013

Getting started with Hudson Continuous Integration

This documents my first attempt to use Hudson for building preview and release versions of a .Net ClickOnce application. The version control system is CVS.


Install Hudson

Download Hudson from eclipse.org/hudson (currently 3.0)

Install a cvs client e.g. cvsnt

Drop the war file in tomcat (I'm using v7)

Add 'set "HUDSON_HOME=d:\HUDSON"' to tomcat's startup.bat. This is where all the build configurations and workspaces are saved so there needs to be enough space.

Start Hudson and install the recommended plugins

Install plugins: Manage Hudson->Plugins. Need MSBuild, CVS, CVS-Tag

Configure Hudson





Create a job

My approach is to debug and test the application locally. Only when I want to create a preview/stage or production version do I need Hudson. Hudson should do a build and publish. When successful, a new CVS tag should be created.

The following job settings do not contain any deploy location information (stage/prod). The job always publishes to a temp location on D:. I want to change this later.





01 August 2012

Using a connection profile store with BIRT

After a bit of trial-and-error I managed to get connection profiles to work with BIRT. It is important to keep to the following sequence.

  • Open the Data Source Explorer view
  • Create all the connection profiles you need. e.g. test, staging and production for each connection type. Give them names which indicate the environment they are in (MS_SQL_Test, MS_SQL_Prod etc.)
  • Export the required connection profiles to a file in the report project e.g. connectionStore.xml
  • In the report project, create a new DataSource and select the second radio button 'Create from a connection profile in the profile store'
  • Select the profile store file and choose a connection profile. Perhaps deselect the 'Use default data source name' and enter a environment-independant name (e.g. MS_SQL instead of MS_SQL_Test). Choose Ok to end
  • Open the Data Source and select 'Property Binding'
  • Edit 'Connection Profile Name' -- params["__runtime"].value.toLowerCase() == 'prod' ? 'MS SQL Prod' : 'MS SQL Test' -- or something similar. The returned value must correspond to the name of a connection profile in the store.
  • Define a parameter named '__runtime' and use the Combo Box option to set the valid values: 'test', 'prod' etc
  • That's it
You should now be able to select the connection environment using the report parameter.
Update
When I deployed this to the server (websphere) the profile switching between prod & test did not work. This was because the profile store was not being found. Unfortunately, there is no error message - it just takes the default connection settings. The connection store needs to be placed in the server's context root.

16 March 2012

Success with pvc.webcontainer

Finally got my little app working with com.ibm.pvc.webcontainer. I installed the Domino upgrade 8.5.3 and my plugin works! Seems there were problems with 8.5.2.

One important point is to refresh the target definition in eclipse: Window->Prefs->Plug-in Dev->Target. Reload. Otherwise there will be unresolved plugins in the projects.


06 September 2011

15 June 2011

Mixing Linq-to-SQL and Linq-to-XMl

I have been trying to select a column containing XML text from a database and then selecting nodes from the XML using Linq. It didn't work. My guess is that deferred execution causes the queries to be mixed and taken as Linq-to-SQL. As a result the XML stuff causes problems.

My solution was to force an intermediate result so that there is a break between SQL and XML queries. My code for LinqPad is as follows.

var all = from bm in mytable
          select new { name=bm.SPP_USER_ID, xml=(string)bm.SPP_BOOKMARKS_XML};

var docs = from x in all
           select XDocument.Parse(x.xml);
var docs2 = docs.ToList(); // FORCE RESULT

XNamespace ns = "http://acme/bookmarks";
var href = from h in docs2.Descendants(ns + "href")
           select h.Value;  

15 April 2011

Strange and annoying problem with {NOBR}

I wrote a web app about 10 years ago which used Javascript to pop up a hidden table when an input field gets focus. Each cell in the table contains a checkbox and text which are surrounded by a NOBR to keep them together.

Recently users with IE8 complained that the first cell is not visible when the table pops up. After MUCH trial and error I narrowed it down to the NOBR tag. I replaced it with a SPAN with style set to white-space : nowrap and this seems to solve the problem :-/