Skip to content

Feature/tgz bundle support #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 7, 2020

Conversation

zappan
Copy link

@zappan zappan commented Jan 7, 2020

@virgofx Hi. Here's a PR for the deployment bundle creation as tgz (#11). Let me know if this works. Thanks

@virgofx
Copy link
Member

virgofx commented Jan 7, 2020

Looks great. Thanks!

Fixes #11

@zappan Can you test with 1.0.11 and confirm working?

@virgofx virgofx merged commit 87f4b19 into techpivot:master Jan 7, 2020
@zappan
Copy link
Author

zappan commented Jan 8, 2020

@virgofx I can confirm it working.

The only difference between tar and zip is that tar preserves the file ownership in a different way, so on the server I get files unpacked as owned by the user ID from the CI server. But that's not an issue, as ownership change can be done in the deployment script after unbundling

Tar behaviour depends on the user doing the unarchiving, different for root and non-root, and that's by design. What can be done is something like this https://unix.stackexchange.com/questions/278011/anonymous-tarballs when creating the tar archive, setting it to root owner, and then untar will probably take care of it in a way if a non-root user is untaring, it will be set to that user instead of root (as non-root user can't create files in the name of other users).

Leaving all that up to you, as for the general functionality - I confirm it works.

@zappan zappan deleted the feature/tgz-bundle-support branch January 8, 2020 14:40
@virgofx
Copy link
Member

virgofx commented Jan 11, 2020

Zappan - Thanks for the confirmation and feedback. Very interesting how the differences in the TAR. If we potentially add flags for the user/group equal to "root" ... that shouldn't impact actual users/groups on the system at all if they exist or not? But again, I believe AWS code deploy and via scripts in the workflow, the user should be appropriately setting permissions as necessary.

@zappan
Copy link
Author

zappan commented Jan 11, 2020

I agree that the user can set ownership through the rest of the workflow, I did that.

I think adding the flags wouldn’t affect actual users/groups in any practical way, as you don’t expect to have the same user/group on dev or CI machine and the server.

Flags do set the owner to root when packing the tar, and unpacking the tar as root would keep the root as the owner, but in case of unpacking as non-root, ownership would be set to the unpacking user - that’s how I read the tar documentation, but haven’t tried it out in practice to confirm I understood the docs correctly.

Also, I can’t really judge what’s a better approach. You might simply leave it as is, keeping this detail in mind - in case someone opens an issue with this behaviour and offers a case for the other approach, it’s easy to add those flags.

@zappan
Copy link
Author

zappan commented Jan 11, 2020

Actually, thinking from a user perspective, if I download some tar archive and unpack it on my machine, I’d expect the unpacked files to be owned by my current user, and not some non-existing user id.

If we look at it from that side, setting tar files to root for distribution could make sense. If I come across some software packaged as tar file, I’ll check it out from the inside and report how is it packaged and we can take that as a guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants