Skip to content
spikeybill edited this page Nov 7, 2014 · 7 revisions

If like us you use an (semi-)automated deployment system, we use Octopus, then you might need to generate packages to be used by the deployment system. Octopus makes use of deployment flavoured nuget packages and does have a tool that will generate these, but for a couple of reasons we use NuGet.exe to generate our packages. So to support this there are some functions available in Build.Tools to support this, these though are not included in the set of Targets included in Core.fsx.

So how do I use these functions?

Follow the directions in Changing the default build process and then modify the config, targets and build order to include the additional functions and configuration that you need.

What functions are available?

Versioning

The Versioning.fsx script includes a function called updateDeploy which looks for NuSpecs contained in a Deploy folder. Any that are found then have their version updated to reflect the current build.

Packaging

The 'Packaging.fsx` script includes a few functions :

  • packageDeploy which looks for Nuspecs contained in a deploy folder and then uses NuGet.exe to compile the nupkg file. This function expects an additional configuration item named packaging:deployoutput that is the location that nupkg files will be generated.

  • pushDeploy which looks for nupkg files in the folder defined by packaging:deployoutput and if any are found attempts to push them to a NuGet library. This expects a couple of additional configuration items, packaging:deploypushurl which is the url of the NuGet library and packaging:deployapikey which is the API access key required to upload packages to the NuGet library. Also supported is pushing packages to a directory or UNC, achieved by setting packaging:deploypushto to dir and setting the destination path in the packaging:deploypushdir configuration item.

  • constrain allows you to post process the nupkg output directory to change unconstrained dependencies (e.g. "1.2.3") to a more sensible HighestMinor strategy (e.g. "[1.2.3,2)")

Grunt

The 'Grunt.fsx` script requires that node js and the grunt-cli node module is installed globally : The following functions are available :

  • install which installs all node packages specified in the package.json within the current directory.

  • run which will run grunt using the gruntfile.js in the current directory. The configuration passed to this function can enable grunt to run in --verbose mode by specifying "grunt:verbose","true". The grunt environment --env can also be specified via the "grunt:environment","your environment name".