PostDeploy.ps1 doesn't execute

Hi - I’ve read all the posts about this but it’s not working for me.

I created a PostDeploy.ps1 script and set the Build Action to Content. The script is in my package and is being deployed to the application folder, but it’s either not being executed or failing with no error messages. There is nothing in the log. How do I fix or diagnose this?

Ok - I found the problem. I was using NuGet to package the files. OctoPack puts all the files in the root. NuGet puts then in a Lib folder and this is why the script wasn’t running.

I think it would be a good idea to mention this here: http://docs.octopusdeploy.com/display/OD/Using+NuGet.exe

Hi Jon,

Thanks for posting the solution!
Yeah the documentation for Using NuGet.exe is a little bare, so we will flesh it out today.
Thanks for pointing this out!

Vanessa

Well I’m a newbie with NuGet so what is obvious to some may be missed by me.

FYI – For my applications, I’m trying to have the projects to package controllable at the Build Definition level. So I have modified the XAML to accept a list of Projects to package on the Build Definition form, similar to specifying the projects to build. These then get packaged during build using NuGet. This way, the build master can configure this without having to modify the existing code base + have the ability to create different types of packages at the Build Definition level.

It works great, but I just need to figure out how to get NuGet to package the projects in an Octopus friendly manner! Any documentation about this would probably be helpful to others as well…but what I think will work is to further modify the XAML to allow overriding the default MSBuild output and then either use a wild-card in the .nuspec file or build it on the fly based on what’s in the output folder(s).