When deploying the package it will always deploy the entire thing, there isn’t any way of choosing to only push certain folders.
I’ve tried to think of a way to achieve this, and the only one I can think of feels messy.
You could have a step that deploys/extracts on the Octopus Server or a shared location and then a second step to copy the contents of the required folder to the deployment target based on the environment. This does bypass the tentacle transfer mechanisms though.
That’s too bad. We did consider the “via other server” approach, but as you say, it’s a bit messy
Originally we had a script to copy files from correct folder, then recursive delete all folders.
We did this on the target server. Thank God we put in some error checks, or the machine would’ve died
The solution will probably be to just leave all env-folders on each env-server. It’s not alot of bytes in total. Mostly my cleanliness-needs that I wanted to fulfill
To keep things a little tidier on the targets, you could have Octopus extract the package in the default directory (C:\Octopus\Applications) and then use a script to copy the required folder from there to where you want the virtualDir to run from.
Tentacle retention policies that are set within the lifecycle will keep the Applications folder from growing too large and the additional folders are kept separate from the virtualDir.