2021-05-31 02:57:40 +00:00
|
|
|
import sys
|
2021-06-09 16:34:44 +00:00
|
|
|
import s3
|
2021-05-31 02:57:40 +00:00
|
|
|
|
|
|
|
def help():
|
|
|
|
print('Usage:')
|
|
|
|
print('python manage_vcpkg_archive_cache.py <action> <dir> <os> <bucket> <access_key> <secret_key>')
|
|
|
|
|
|
|
|
if (len(sys.argv) != 7 and len(sys.argv) != 5):
|
|
|
|
help()
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
action_name = sys.argv[1]
|
|
|
|
dir_name = sys.argv[2]
|
|
|
|
os_name = sys.argv[3]
|
|
|
|
bucket_name = sys.argv[4]
|
|
|
|
|
|
|
|
if (action_name == 'upload' and len(sys.argv) == 7):
|
|
|
|
access_key = sys.argv[5]
|
|
|
|
secret_key = sys.argv[6]
|
2021-06-09 16:34:44 +00:00
|
|
|
s3.upload(os_name, dir_name, bucket_name, access_key, secret_key)
|
2021-05-31 02:57:40 +00:00
|
|
|
elif (action_name == 'download'):
|
2021-06-09 16:34:44 +00:00
|
|
|
s3.download(os_name, dir_name, bucket_name)
|
2021-05-31 02:57:40 +00:00
|
|
|
else:
|
|
|
|
help()
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
sys.exit(0)
|