Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Add support for zip archives. #20

Merged
merged 1 commit into from Dec 21, 2013
Merged

Add support for zip archives. #20

merged 1 commit into from Dec 21, 2013

Conversation

ghost
Copy link

@ghost ghost commented Dec 18, 2013

This adds support for zip archives. This is the first step to getting this suggestion (http://feedback.gitlab.com/forums/176466-general/suggestions/4498612-zip-download-format-for-tags) into GitLab.

@ghost
Copy link
Author

ghost commented Dec 18, 2013

@randx It appears that commit 9e49c20 broke the Travis CI builds due to the Gemfile.lock not being updated. If this could get merged, I would love to finish this feature in GitLab.

@ghost
Copy link
Author

ghost commented Dec 18, 2013

I should have noted, it will not affect current functionality.

@dosire
Copy link
Member

dosire commented Dec 18, 2013

Also see Jason his comment in http://feedback.gitlab.com/forums/176466-general/suggestions/4498612-zip-download-format-for-tags

@randx Can you give some feedback on this PR?

@@ -99,13 +99,14 @@ def discover_default_branch
# Already packed repo archives stored at
# app_root/tmp/repositories/project_name/project_name-commit-id.tag.gz
#
def archive_repo(ref, storage_path)
def archive_repo(ref, storage_path, zip = false)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about changing this to accept format (tgz, tar.gz, zip, bz2). In the long term, this will be more flexible. There would then be a case statement below to setup the proper file extension and format and pipe arguments for grit.archive_to_file. If the format is not in the list, it would fallback to tar.gz.

@ghost
Copy link
Author

ghost commented Dec 21, 2013

@dosire @randx The GitLab portion of this can be found at gitlabhq/gitlabhq#5891. This one must be merged before the other.


extension = ".tar.gz"
git_archive_format = nil
pipe_cmd = nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better put these lines under else case.

Additionally, this adds support for bz2 compression and uncompressed tar
files.

Any unknown format falls back to tar.gz.
@ghost
Copy link
Author

ghost commented Dec 21, 2013

@randx Updates have been made. I also went ahead and added the gzip pipe command to be a little more explicit.

dzaporozhets added a commit that referenced this pull request Dec 21, 2013
@dzaporozhets dzaporozhets merged commit b446cf3 into gitlabhq:master Dec 21, 2013
@dzaporozhets
Copy link
Member

@jhollingsworth thank you

@ghost ghost deleted the feature/zip-archive branch December 22, 2013 13:24
@ghost
Copy link
Author

ghost commented Mar 4, 2014

@jacobvosmaer You are correct. The command should be bzip2. It appears that sometime back a bzip symlink had been created pointing to bzip2 on the machine I was developing on (I don't remember why that was done). I will submit an update shortly to fix this problem and extend the tests to check for a non-zero file size as well.

I will also create a fresh install to develop on to avoid having something like this happen in the future. Sorry for the mistake.

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

Successfully merging this pull request may close these issues.

3 participants