How can I download a folder from s3 to local in the bitbucket pipeline?How I can execute a shell script in the pipeline?
Hi @NIJO We use Python to Achieve this`python /tmp/s3_artifact_downloader.py`Downloader, looks something like:```import sysimport boto3def download_from_s3(aws_public_key, aws_private_key, s3bucket, from_key, to_file): boto3.client( 's3', aws_access_key_id = aws_public_key, aws_secret_access_key = aws_private_key ).download_file(s3bucket, from_key, to_file)if __name__ == "__main__": hg_bucket = 'build-artifacts' hg_key = 'master/latest' # get key from commnd line if necessary if len(sys.argv) > 1: hg_key = sys.argv[1].replace('/', '-') + '/latest' aws_public_key = sys.argv[2] aws_private_key = sys.argv[3]print('Downloadingfrom s3://{}/{}'.format(hg_bucket, hg_key)) download_from_s3( aws_public_key = aws_public_key, aws_private_key = aws_private_key, s3bucket = hg_bucket, from_key = hg_key, to_file = 'HG.zip')
The formatting sucks!Here is a PasteBin:https://pastebin.com/k51DQup7
It looks like you're new here. Sign in or register to get started.