Skip to content

Commit

Permalink
Merge pull request #91 from refgenie/staging
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
stolarczyk authored Jul 10, 2020
2 parents 88809df + fc8f749 commit 05c8a48
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.5.1] -- 2020-07-10
### Changed
- in `refgenieserver archive`:
- implement safer way of asset archive creation
- follow symlinks

## [0.5.0] -- 2020-07-06
### Added
- support for external asset sources via `remote_url_base` key in the config
Expand Down
2 changes: 1 addition & 1 deletion refgenieserver/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.0"
__version__ = "0.5.1"
18 changes: 10 additions & 8 deletions refgenieserver/server_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,16 @@ def _check_tgz(path, output, asset_name):
# of refgenie CLI. The difference is that refgenie < 0.7.0 requires the asset to be archived with the asset-named
# enclosing dir, but with no tag-named directory as this concept did not exist back then.
if os.path.exists(path):
# move the asset files to asset-named dir
cmd = "cd {p}; mkdir {an}; mv `find . -type f -not -path './_refgenie_build*'` {an} 2>/dev/null; "
# tar gzip
cmd += "tar -cvf - {an} | pigz > {o}; " if is_command_callable("pigz") else "tar -cvzf {o} {an}; "
# move the files back to the tag-named dir and remove asset-named dir
cmd += "mv {an}/* .; rm -r {an}"
_LOGGER.debug("command: {}".format(cmd.format(p=path, o=output, an=asset_name)))
run(cmd.format(p=path, o=output, an=asset_name), shell=True)
# copy the asset files to asset-named dir, excluding _refgenie_build dir, which may change digests
cmd = "rsync -rvL --exclude '_refgenie_build' {p}/ {p}/{an}/; cd {p}; "
# tar gzip the new dir
cmd += "tar -cvf - {an} | pigz > {o}; " if is_command_callable("pigz") \
else "tar -cvzf {o} {an}; "
# remove the new dir
cmd += "rm -r {p}/{an}"
command = cmd.format(p=path, o=output, an=asset_name)
_LOGGER.debug("command: {}".format(command))
run(command, shell=True)
else:
raise OSError("Entity '{}' does not exist".format(path))

Expand Down

0 comments on commit 05c8a48

Please sign in to comment.