Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Handle FileNotFoundError when creating artifacts tar.gz file
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Sep 4, 2017
1 parent 07758db commit 625c07c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion badwolf/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ def _should_exclude(path):
artifacts_file = os.path.join(artifacts_commit_path, 'artifacts.tar.gz')
with tarfile.open(artifacts_file, 'w:gz') as tar:
for path in paths:
tar.add(os.path.join(self.context.clone_path, path), path)
file_path = os.path.join(self.context.clone_path, path)
try:
tar.add(file_path, path)
except FileNotFoundError as exc:
logger.error(str(exc))

run_command('shasum artifacts.tar.gz > SHASUM', cwd=artifacts_commit_path, shell=True)
logger.info('Saved artifacts to %s', artifacts_commit_path)
Expand Down

0 comments on commit 625c07c

Please sign in to comment.