Iris Classon
Iris Classon - In Love with Code

Running one-off scripts remotely on deployment targets in Octopus Deploy

We have a peculiar situation with our Hangfire service, a service that kicks of jobs as separate processes using different queues for different tenants. When we add a new tenant we currently have to restart the application pool. I know. Not ideal. But it is what it is, until we get that sorted. Additionally, we have quite a few servers, representing different environments (EDGE, QA, AT and PROD). Remoting in to each server to check if there are current jobs running, and if not restarting the pool, is not fun. However, lately I’ve been using Octopus Deploy for this.
If you go to Tasks in the menu you will see a Script Control link on the right-hand side. This will take you to a script console where you can write and run one-off on-the-go scripts remotely.

Here is a simple example where I get a list of the pools on our PROD4 machine.

The output is printed, and I can choose to modify the script and re-run it (in my case I checked that no jobs were running and then restarted the pool).

This is really handy!- and lets us manage things from one place without using additional tools.

Comments

Leave a comment below, or by email.


Last modified on 2017-07-07

comments powered by Disqus