Keep uploads directory

Greetings,

Overall very happy with Octopus, thank you very much for your efforts so far, one issue I am struggling to overcome is having a persistent uploads directory,

I am using the ‘OctopusPackageDirectoryPath’ to keep my site deployed to the same location but I am finding this is still leaving behind orphaned files that are not in the current package,

I have tried:

  • Removing all files (excluding _uploads) in my PreDeploy.ps1 but this isn’t very helpful as I am essentially wiping out the recently deployed package
  • Creating a Powershell step before and after nuget package deployment to move _uploads directory, this step is failing no matter what I put into the script content (even a write-host, I just get " ERROR Running job on the tentacle failed:" with no message, powershell step bug? log output here )
  • Using the ‘OctopusPurgePackageDirectoryBeforeCopy’ setting is a step in the right direction but unfortunately this wipes out my ‘_uploads’ directory entirely so I can’t use this either,

I have read around including the following two links but unfortunately moving the _uploads to another location on the filesystem is not an option,

http://help.octopusdeploy.com/discussions/questions/210-keep-directory-instead-of-replacing
http://help.octopusdeploy.com/discussions/questions/83-cleanup-target-directory-before-deployment

So my questions are:

  • What could be causing a blank error on Powershell script steps? this could solve my issue immediately as I can work around issue above using that, if this could be a bug whats the best location to submit this?
  • Is there scope for some kind of ‘ExcludeDirectoryFromPurge’ setting to be used in conjunction with ‘PurgePackageDirectoryBeforeCopy’
  • Is there some other obvious method I am missing for preserving a single directory between deployments?

I am running version 1.4…0.1592 on Windows 7, any help is infinitely appreciated and if there is anything I can clarify please let me know,

Michael

I have tracked down the issue of the Powershell script not executing , I hadn’t thought to check the Application log:

ERROR Octopus- Error while executing job: The variable ‘version’ contains a reference to another variable named ‘OctopusPackageVersion’, which is not defined.

I can now get around the issue above,

I am curious if there is any possibility that ‘ExcludeDirectoryFromPurge’ etc may still be an option? Is this sort of thing getting too deployment platform specific and best accomplished using the Powershell steps?

Using PowerShell is probably the best approach to this problem.

I’m sorry for the bug regarding variables not appearing in the log - this will be fixed in the next release.

Paul

Excellent thanks very much!