如何将awscli内容移动到MongoDB
下面是Gitlab控制台的输出,现在我想将Jun-06-156075587文件夹的所有内容(包括文件夹名Jun-06-156075587)移动到MongoDB,我的问题是如何配置MongoDB与Gitlab的awscli控制台对话,然后将文件夹内容推送到MongoDB 我在Gitlab中使用AWS如何将awscli内容移动到MongoDB,mongodb,gitlab-ci,aws-cli,Mongodb,Gitlab Ci,Aws Cli,下面是Gitlab控制台的输出,现在我想将Jun-06-156075587文件夹的所有内容(包括文件夹名Jun-06-156075587)移动到MongoDB,我的问题是如何配置MongoDB与Gitlab的awscli控制台对话,然后将文件夹内容推送到MongoDB 我在Gitlab中使用AWS $ aws s3 cp s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} s3://${BUCKET_NAME}/PreviousExecuted/$(date +
$ aws s3 cp s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} s3://${BUCKET_NAME}/PreviousExecuted/$(date +"%h-%m-%s") -- recursive --include "binaries/${filename}*"
Completed 108.5 KiB/83.7 MiB (240.2 KiB/s) with 359 file(s) remaining
copy: s3://gitlabgatlingreport/master/index.html to s3://gitlabgatlingreport/PreviousExecuted/Jun-06- 1560275587/index.html
Completed 108.5 KiB/83.7 MiB (240.2 KiB/s) with 358 file(s) remaining
Completed 140.1 KiB/83.7 MiB (294.6 KiB/s) with 358 file(s) remaining
copy: s3://gitlabgatlingreport/master/js/moment.min.js to s3://gitlabgatlingreport/PreviousExecuted/Jun-06- 1560275587/js/moment.min.js
Completed 140.1 KiB/83.7 MiB (294.6 KiB/s) with 357 file(s) remaining
Completed 140.2 KiB/83.7 MiB (286.9 KiB/s) with 357 file(s) remaining
copy: s3://gitlabgatlingreport/master/js/assertions.xml to s3://gitlabgatlingreport/PreviousExecuted/Jun-06- 1560275587/js/assertions.xml
Completed 140.2 KiB/83.7 MiB (286.9 KiB/s) with 356 file(s) remaining
Completed 153.3 KiB/83.7 MiB (309.9 KiB/s) with 356 file(s) remaining
copy: s3://gitlabgatlingreport/master/js/all_sessions.js to s3://gitlabgatlingreport/PreviousExecuted/Jun-06- 1560275587/js/all_sessions.js
Completed 153.3 KiB/83.7 MiB (309.9 KiB/s) with 355 file(s) remaining
Completed 156.9 KiB/83.7 MiB (311.0 KiB/s) with 355 file(s) remaining
copy: s3://gitlabgatlingreport/master/js/gatling.js to
s3://gitlabgatlingreport/PreviousExecuted/Jun-06-
1560275587/js/gatling.js
我需要将Jun-06-156075587文件夹的所有内容(包括文件夹名Jun-06-156075587)从gitlab awscli移动到MongoDB
这是我的Gitlab yaml,如果我需要在我的Gitlab yaml中添加一些MongoDB映像,以便MongoDB和Gitlab awscli可以相互连接,请务必让我知道
displayresults:
image: python:latest
stage: displayresults
tags:
- docker
dependencies:
- cleanup
before_script:
- pip install awscli # Install the SDK
script:
- 'find /builds/LOT/perftestsgeneric'
- 'find binaries'
- 'cd /builds/LOT/perftestsgeneric/binaries/${filename}* && ls && hostname -i' - 'aws s3 cp /builds/LOT/perftestsgeneric/binaries/${filename}* s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} --recursive' # Replace example-bucket with your bucket
- 'aws s3 cp s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} s3://${BUCKET_NAME}/PreviousExecuted/$(date +"%h-%m-%s") -- recursive --include "binaries/${filename}*"'
environment:
name: ${CI_COMMIT_REF_SLUG}
url: http://${BUCKET_NAME}.s3-website.${AWS_DEFAULT_REGION}.amazonaws.com/${CI_COMMIT_REF_SLUG} # This is the url of the bucket we saved before
on_stop: clean_s3 # When the branch is merged, we clean up after ourself
clean_s3:
image: "python:latest"
stage: displayresults
tags:
- docker
before_script:
- pip install awscli
script:
- aws s3 rm s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} --recursive #
Replace example-bucket with your bucket
environment:
name: ${CI_COMMIT_REF_SLUG}
action: stop
when: manual