File permissions from tgz file lost when unpackaged

Having a slight problem with tgz files. Before we package up the tgz, we set all the files in the ./bin directory to executable (+x). However, when OD extracts the package (/home/company/user/.octopus/Applications/OctopusServer/Development/package-name/version), those files are no longer +x. I copied the tgz file OD used (/home/company/user/.octopus/OctopusServer/Files/package-name.version.tgz-uid) and manually extracted it myself into a different directory. The permissions for the files in ./bin were correct when I did that, so it looks like permissions are lost when OD does its extracting.

My current work around is to have PostDeploy.sh chmod +x the files, but the reason we choose the tgz format was because it retains file permissions on Unix, and thus we wouldn’t have to do that.

Edit: we are using the ‘custom install’ feature, so when it gets copied from /home/company/user/.octopus/Applications/OctopusServer/Development/package-name/version to the custom install location, the files in that ./bin don’t have the executable bit set either.

Hi Keith,

Thanks for getting in touch. I reproduced the issue and you’re correct, we don’t currently support preserved permissions with tar/gzip files. We use SharpCompress to handle the uncompressing/unpacking ZIP, TAR, TGZ etc files and it does have some issues. That said, we found virtually every other library (free and commercial) has their own flaws and missing features. The great thing about SharpCompress is it’s open source and the community including Octopus can submit pull requests to improve it. We’ve already done this and it’s a good way to improve it.

I think your workaround is nice and simple but ideally it would be unnecessary. In the short term, I think there are two main options to improve it.

  1. Visit our user voice site at http://octopusdeploy.uservoice.com and add a suggestion for this. We review our user voice suggestions regularly and action the the popular ones.
  2. Review SharpCompress and submit a pull request (PR) with added support. We try to stay fairly up to date with its releases so we’d be able to easily pull in an updated release with a fix.

Hope this helps.

Thanks

Rob