diff --git a/.circleci/config.yml b/.circleci/config.yml index 33bb8db26e..dc88679791 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -215,6 +215,17 @@ jobs: echo "$ANDROID_HOME" echo "$M2_HOME" bash CircleciScripts/maven-release.sh + - run: + name: install aws cli + command: | + sudo pip install awscli + aws configure --profile android_stage set region us-east-1 + echo -e "[android_stage]\naws_access_key_id=${AWS_ACCESS_KEY_ID_ANDROID}\naws_secret_access_key=${AWS_SECRET_ACCESS_KEY_ANDROID}\n" >> ~/.aws/credentials + - run: + name: upload to maven + command: | + version=$(echo "${CIRCLE_TAG}" | sed 's|.*v\([0-9\.]*\).*|\1|') + python3 CircleciScripts/s3_maven.py "$(pwd)" %version android_stage "aws-android-sdk-stage-csun/com/amazonaws" release_s3: docker: @@ -267,7 +278,9 @@ jobs: command: | aws configure --profile android_stage set region us-east-1 echo -e "[android_stage]\naws_access_key_id=${AWS_ACCESS_KEY_ID_ANDROID}\naws_secret_access_key=${AWS_SECRET_ACCESS_KEY_ANDROID}\n" >> ~/.aws/credentials - aws s3 cp "$sdkversion.zip" "s3://mylistname/test/$sdkversion.zip" --profile android_stage + aws s3 cp "$sdkversion.zip" "s3://aws-android-sdk-stage-csun/$sdkversion.zip" --profile android_stage + aws s3 cp "$sdkversion.zip" "s3://aws-android-sdk-stage-csun/latest/aws-android-sdk.zip" --profile android_stage + workflows: version: 2 build_test: diff --git a/.gitignore b/.gitignore index 6501f57c1f..7b50a210b6 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,6 @@ fastlane/readme.md # maven file target/ + +#python comile +__pycache__/ diff --git a/CircleciScripts/__pycache__/functions.cpython-37.pyc b/CircleciScripts/__pycache__/functions.cpython-37.pyc deleted file mode 100644 index 3ab6e78faf..0000000000 Binary files a/CircleciScripts/__pycache__/functions.cpython-37.pyc and /dev/null differ diff --git a/CircleciScripts/s3_maven.py b/CircleciScripts/s3_maven.py new file mode 100644 index 0000000000..eab2b48a70 --- /dev/null +++ b/CircleciScripts/s3_maven.py @@ -0,0 +1,24 @@ +import os +import sys +from functions import getmodules +from functions import runcommand +from shutil import copyfile +from pathlib import Path +root = sys.argv[1] +version = sys.argv[2] +s3profile = sys.argv[3] +s3prefix=sys.argv[4] +#"aws-android-sdk-stage-csun/com/amazonaws" + +modules = getmodules(root) +for module in modules: + target = os.path.join(root, module, "target") + s3maven = os.path.join(target, "s3maven") + runcommand("mkdir -p '{0}'".format(s3maven)) + for file in os.listdir(target): + sourcefile = os.path.join(target, file) + if os.path.isfile(sourcefile) and (version in file): + targetfile = os.path.join(s3maven, file) + copyfile(sourcefile, targetfile) + print("upload module {0} ...".format(module)) + runcommand('aws s3 sync "{0}" s3://{1}/{2}/{3} --profile {4}'.format(s3maven, s3prefix, module,version,s3profile))