s3_config should be in lib.config
This commit is contained in:
parent
aa835ad38a
commit
6b1dd0d413
6 changed files with 19 additions and 17 deletions
|
@ -47,6 +47,17 @@ def get_target_arch():
|
||||||
return 'x64'
|
return 'x64'
|
||||||
|
|
||||||
|
|
||||||
|
def s3_config():
|
||||||
|
config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''),
|
||||||
|
os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''),
|
||||||
|
os.environ.get('ATOM_SHELL_S3_SECRET_KEY', ''))
|
||||||
|
message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, '
|
||||||
|
'$ATOM_SHELL_S3_ACCESS_KEY, and '
|
||||||
|
'$ATOM_SHELL_S3_SECRET_KEY environment variables')
|
||||||
|
assert all(len(c) for c in config), message
|
||||||
|
return config
|
||||||
|
|
||||||
|
|
||||||
def enable_verbose_mode():
|
def enable_verbose_mode():
|
||||||
print 'Running in verbose mode'
|
print 'Running in verbose mode'
|
||||||
global verbose_mode
|
global verbose_mode
|
||||||
|
|
|
@ -176,17 +176,6 @@ def parse_version(version):
|
||||||
return vs + ['0'] * (4 - len(vs))
|
return vs + ['0'] * (4 - len(vs))
|
||||||
|
|
||||||
|
|
||||||
def s3_config():
|
|
||||||
config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''),
|
|
||||||
os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''),
|
|
||||||
os.environ.get('ATOM_SHELL_S3_SECRET_KEY', ''))
|
|
||||||
message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, '
|
|
||||||
'$ATOM_SHELL_S3_ACCESS_KEY, and '
|
|
||||||
'$ATOM_SHELL_S3_SECRET_KEY environment variables')
|
|
||||||
assert all(len(c) for c in config), message
|
|
||||||
return config
|
|
||||||
|
|
||||||
|
|
||||||
def s3put(bucket, access_key, secret_key, prefix, key_prefix, files):
|
def s3put(bucket, access_key, secret_key, prefix, key_prefix, files):
|
||||||
args = [
|
args = [
|
||||||
's3put',
|
's3put',
|
||||||
|
|
|
@ -5,7 +5,8 @@ import hashlib
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from lib.util import download, rm_rf, s3_config, s3put
|
from lib.config import s3_config
|
||||||
|
from lib.util import download, rm_rf, s3put
|
||||||
|
|
||||||
|
|
||||||
DIST_URL = 'https://atom.io/download/atom-shell/'
|
DIST_URL = 'https://atom.io/download/atom-shell/'
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from lib.config import PLATFORM
|
from lib.config import PLATFORM, s3_config
|
||||||
from lib.util import execute, s3_config, s3put, scoped_cwd
|
from lib.util import execute, s3put, scoped_cwd
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
|
@ -7,8 +7,8 @@ import shutil
|
||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
from lib.config import PLATFORM, get_target_arch
|
from lib.config import PLATFORM, get_target_arch, s3_config
|
||||||
from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put
|
from lib.util import execute, safe_mkdir, scoped_cwd, s3put
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config
|
from lib.config import s3_config
|
||||||
|
from lib.util import execute, rm_rf, safe_mkdir, s3put
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue