Copy a specific folder from one step to another already installed

Hi all
I would like to copy a folder that is inside the root “D:\Octopus\Applications\Main\webapp2\1.0.0.54\build” (Copy the carpeta Build only) to another application "D:\Octopus\Applications\Main\WebApp1\1.0.0.54\App "found in previous steps.

how could I do this?

Regards
Aldo

Hi Aldo,

Thanks for reaching out!

From your second step, you can reference the path of the first step by using the Output variable $OctopusParameters['Octopus.Action[FIRST STEP NAME].Output.Package.InstallationDirectoryPath']. This variable will give you the full path where the First Step deployed the app (in your case that would be D:\Octopus\Applications\Main\webapp2\1.0.0.54 ). Then with some powershell magic you could do something like:

$FirstStepDeployPath = $OctopusParameters['Octopus.Action[NAME OF THE DEPLOY STEP].Output.Package.InstallationDirectoryPath']
$Destination = "C:\WhereverYouWantToSendTheFiles"

copy-item -path $firstStepDeployPath -Destination $destination

Let me know if that makes sense.

Kind regards,

Kenny

Notice:

This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.