3
votes

I'm packaging up some mongo scripts along with the necessary binaries to run them into a Nuget package via Teamcity. Now what I want to do with Octopus is pull that package, extract the contents and run the scripts once per deployment. I don't want or need these to be deployed to any machines as these scripts are not target machine specific. I was thinking via powershell I could

  1. Download the package (possibly query the feed for a specific version)
  2. Extract it
  3. Run the scripts
  4. Clean up

Anyone experienced a similar problem?

1

1 Answers

3
votes

The solution is to install a Tentacle on the Octopus Server, assign it to all environments, give it a unique role along the lines of octopus-server, and then configure a script step to use the octopus-server role as your target. You can then write a PowerShell, C# or Bash script in that script step that will call and execute the mongo scripts that you have stored in your project. That way, it'll only run on your Octopus Server. I've done something similar to run MySQL scripts recently.

The OctopusDeploy docs provide a nice walkthrough here and an explanation of why they chose to handle it that way.