1

We have a .NET Jenkins installation that builds a few .NET apps. These apps include a bunch of *.exe and *.exe.config files. Right now, I save the app as a zipfile containing all of the *.exe, the required DLLs and *.xml files, and the default *.exe.config files. The default *.exe.config get their value from what is in the Subversion repository and is tuned for the production environment.

The *.exe.config files contain the database name, the database server, the name of the server, etc. These are correct for the production environment, but not for UAT, QA, or developer testing.

What I'd like to do is have some sort of post-build task where a user can specify the particular build, and the values for those particular parameters that vary from environment to environment. If I got that, I could run an Nant or Ant task that unzips the zipfile, munges the *.exe.config file and either deploy it (my ultimate goal), or at least zip that up and put it somewhere the user can access it.

I know there's a parameterized build, and I know there are batch tasks, but I need a combination of the two. Is that possible?

David W.
  • 105,218
  • 39
  • 216
  • 337

1 Answers1

0

It's not as elegant, but I think you can implement what you want as a separate build. You need:

  1. A Parameterized Build (which you know about)
  2. A way to access artifacts from another build

Given these pieces, you should be able to create a Parameterized Build that does exactly what you describe: grabs the build artifact, munges the configuration and provides it somewhere for the user. Of course the devil is in the details, e.g. it may be tricky to make it easy for a user to "select the right build".


Update (now that I've learned about Batch Tasks - thanks!): I don't see a way to parameterize the batch task like you asked. I'm guessing that the combination of variables make it prohibitive to define a bunch of different batch tasks. You could define a couple of batch tasks for common release and testing configurations and also provide the "munger" program for more user-specific configuration.

Community
  • 1
  • 1
Dave Bacher
  • 15,652
  • 3
  • 63
  • 86
  • 1
    I actually decided to go with the Promotion plugin. That allows me to set parameters that I can use in an Ant script and do another build. This seems to be what I need. I can unzip the saved artifacts, munge the configuration files, and zip it up in a new artifact that the user can download. – David W. Jun 05 '11 at 02:44