I’m using the “Run a script” step after deploying the package to my server. The script itself is stored within the package, as I want to be able to update it in future releases.
Now the script runs on the server correctly, but it’s running within the context of the temporary folder. So with the Linux tentacle I’m using, it’s running in a temporary folder in /etc/octopus/default/Work/. After the script runs, that folder is moved to it’s final destination, /home/Octopus/Applications/dev/my-app/1.0.0.
The problem is I really need the script to be running in the context of the final destination, as one step of the script is registering a new service that references the content of the package. Since the temporary folder gets cleaned up after the deployment is done, the service ends up referencing files that don’t exist anymore.
So in short, how can I run a script that’s present in the deployed package, after it has finished deploying to its final destination?