Updating package content

How can I update package contents?
I am using TeamCity to compile and package using OctoPack, What I want to achieve is to write a powershell script to update package contents… mainly running aspnet precompile to a temp folder then move that temp folder back to the package

Hi Mohamed,

Thanks for getting in touch.

Packages in Octopus Deploy are treated as immutable during a deployment, so you cannot update the contents of a package.

You could have a step that does the ASP.NET pre-compile step on the target deployment machine, and then the output of that operation will be available on that target machine for later steps in that deployment.

Have you considered using TeamCity to do the ASP.NET pre-compile operation? This sort of operation is more of a building/packaging concern, rather than a deployment concern, which means that Octopus Deploy is probably not a good fit for this task.

Hope that helps,
Tom

Hi …

Thanks, I needed it in Octopus as we need to precompile for certain environment (staging and production) not all environments.

Anyway I managed to do this in the pre-deployment script as it runs in the context folder of extracted package, so I did write a script to precompile to temp folder then replace all current folder’s content to the precompiled ones and worked.

Thanks anyway