2025-04-13 17:24:31 -04:00
|
|
|
import boto3
|
2025-04-13 17:45:42 -04:00
|
|
|
import dcc.config
|
2025-04-15 22:49:22 -04:00
|
|
|
import dcc.doom_base
|
2025-04-13 17:24:31 -04:00
|
|
|
|
2025-04-15 22:49:22 -04:00
|
|
|
class Put(dcc.doom_base.WadMap):
|
2025-04-24 18:39:41 -04:00
|
|
|
def get_parser(self, prog_name):
|
|
|
|
parser = super().get_parser(prog_name)
|
|
|
|
return parser
|
|
|
|
|
2025-04-13 17:24:31 -04:00
|
|
|
# TODO: accept configuration for bucket name
|
|
|
|
def take_action(self, parsed_args):
|
|
|
|
s3_client = boto3.client('s3')
|
2025-05-13 05:46:26 -04:00
|
|
|
demo = self.demo_in_path()
|
|
|
|
bucket = self.target_bucket()
|
|
|
|
print("Uploading {} to bucket {}.".format(demo, bucket))
|
|
|
|
s3_client.upload_file(demo, 'yrriban', bucket,
|
2025-04-24 18:39:41 -04:00
|
|
|
ExtraArgs={'ContentType': 'binary/octet-stream', 'ACL': 'public-read'})
|