Best Template for Deploying to a Network File Share

I have a windows application that I am building and packaging and sending to the Octopus Deploy build in package feed.

I am now working on getting that package deployed to a Network Share (on our local network). I am struggling to find a template to do this. I looked at the Deploy a Package template, but it wants to run on the “Deployment Target” (It seems this cannot be changed). Since I am copying to network file share, I don’t really have a “Deployment Target”.

I tried using a Powershell Script to just copy the files, but ended up having lots of problems with mapping a PS Drive (in order to have the needed credentials).

Does Octopus Deploy have a supported way to deploy a package to a network file share? (Using a UNC path like \\MyNetworkShare\SomeLocation\MyApp)

Hi @OctopusSchaff,

Thank you for reaching out, and I would be happy to help with your questions on deploying to a network file share via Octopus Deploy!

In doing some initial thinking on this, a Run-A-Script step with a referenced package seems like the best approach for this scenario. We have a nice blog post on referencing packages via script steps, which I’ll link for your reference/review since it goes into this topic in great detail:

https://octopus.com/blog/script-step-packages

Regarding the permissions side of things, as long as the user running the process has access to these network share(s), then you should be able to connect to them via the standard Windows commands.

Typically I’ll use Robocopy in these scenarios, but Robocopy has some file name length limitations, so sometimes XCopy can be a more robust solution in these cases.

I’ve also run into some personal headaches in dealing with the exit codes from Robocopy (as they aren’t super intuitive), so I wanted to include some information on this from a StackOverflow post I found, in case you run into similar issues (if you end up using Robocopy):

I hope this initial information helps, but let me know if I can be of any more assistance.

Regards,

Britton

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.