Do not put the upload logic in make_zip
This commit is contained in:
parent
8f75f10239
commit
079a7a1a1c
3 changed files with 29 additions and 25 deletions
|
@ -3,7 +3,6 @@
|
|||
import atexit
|
||||
import contextlib
|
||||
import errno
|
||||
import hashlib
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
|
@ -16,7 +15,7 @@ import urllib2
|
|||
import os
|
||||
import zipfile
|
||||
|
||||
from config import is_verbose_mode, s3_config
|
||||
from config import is_verbose_mode
|
||||
from env_util import get_vs_env
|
||||
|
||||
BOTO_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'vendor',
|
||||
|
@ -133,22 +132,6 @@ def make_zip(zip_file_path, files, dirs):
|
|||
for f in filenames:
|
||||
zip_file.write(os.path.join(root, f))
|
||||
zip_file.close()
|
||||
upload_zip_sha256_checksum(zip_file_path)
|
||||
|
||||
|
||||
def upload_zip_sha256_checksum(zip_file_path):
|
||||
bucket, access_key, secret_key = s3_config()
|
||||
checksum_path = '{}.sha256sum'.format(zip_file_path)
|
||||
safe_unlink(checksum_path)
|
||||
sha256 = hashlib.sha256()
|
||||
with open(zip_file_path, 'rb') as f:
|
||||
sha256.update(f.read())
|
||||
|
||||
zip_basename = os.path.basename(zip_file_path)
|
||||
with open(checksum_path, 'w') as checksum:
|
||||
checksum.write('{} *{}'.format(sha256.hexdigest(), zip_basename))
|
||||
s3put(bucket, access_key, secret_key, os.path.dirname(checksum_path),
|
||||
'atom-shell/tmp', [checksum_path])
|
||||
|
||||
|
||||
def rm_rf(path):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue