Hi,
I need to have a script that validate whether deployment should occur on a server. The problem with using “Deploy a Package” Octopus template is that it does not allow me to run a script before it distribute/extract the package. I cannot use the “Run Condition” to validate a variable as the variable I want to validate is at machine level and I have the understanding that this is not possible with Octopus (see Variable scope in Step Run Condion).
The only way I can think to get around this is to run the “Deploy a Package” within a script. Do you have an API that will allow me to do this or a better idea on how to accomplish this?
Based on the information provided in your query, it sounds like you could benefit from using the Custom Deployments Scripts feature within the Package Step, as shown in the screenshot provided below; specifically the pre-deployment script.
Alternatively, you could instead include the script as a stand-alone step prior to the package step depending on your requirements.
The problem with using “Custom Deployments Scripts feature within the Package Step” is that the script is run after the package is extracted. I want to be able to run a small script to validate whether the package should be extracted to reduce interaction time with target servers.