Warning 17:19:22
The script file “ServerAppSQLs\PostDeploy.ps1” contained within the package will not be executed because it is contained within a child folder. As of Octopus Deploy 2.4, scripts in sub folders will not be executed.
Thanks for getting in touch! You need to have the script at the root of your package (meaning not inside of a subfolder like “ServerAppSQLs”) if you want Octopus to execute it automatically during your deployment. See attached screenshot for better reference
Can you please tell me what will be syntax to run this PS script on below server calling the .bat file from C:\ServerAppSQLs ?
param([string]$Server=“ALAWQCPM005\TEST5,50426”,[string]$ServerID =“dltest5”, [string]$BatFile=“Octopus.1.0.bat”)
cd
cd C:\ServerAppSQLs
I am getting error:
Tentacle script execution
Error 11:59:03
cd : Cannot find path ‘C:\ServerAppSQLs’ because it does not exist.
Error 11:59:03
At C:\WINDOWS\system32\config\systemprofile\AppData\Local\Tentacle\Temp\5478b7a
Error 11:59:03
8-9254-43a4-bd4f-62b593cea67d.ps1:3 char:1
Error 11:59:03
According to the error message, the path C:\ServerAppSQLs doesnt seem to exist. Make sure this path exists before you try to call the executable that is supposed to be there.
Please try using this script inside of PostDeploy.ps1 and let me know how it goes
I am still not able to run the post deploy script on the server. Looks like powershell script is not getting executed on the server where code has been deployed.
I have created a Nuget package called test5.
Created Deploy a Nuget package step in octopus Deploy website and created a release and deployed it to server. All the folder are getting created but postdeploy.ps1 is not getting executed on the server.
execute the postdeploy.ps1 from Powershell ISE works correctly.
What trigger the postdeploy.ps1 to execute on server : alawqpm005 ?
Please see blow the screen shots for more details.
Acording to image005.png you are still using the same script, which doesnt seem to work. Could you please test with the script i provided and let me know the results?
The good news is that the bat is being executed by the postdeploy.ps1 script now(yay!). The bad news is that i’m not sure how your batch file is supposed to work, hence i cant be that helpful troubleshooting it. Specially taking into account that this executes scripts on your database, which is something i’d really rather not mess around with.
Now that you know how to execute the bat from an Octopus deployment, please proceed to do a careful troubleshooting of the code inside of the batch file.
---------------------------------------- The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message.
Its not possible to read the error message on that resolution while being highlighted. Please copy the text or (better) send a screenshot with a higher resolution.
You need to test this in the context of an Octopus Deployment, as its your final goal to run the script from there and not from the ISE. I made one last change to the script, please try it from Octopus this time.