以下是Gitlab控制台的输出,现在我想将文件夹Jun-06-1560275587的所有内容(包括文件夹名称Jun-06-1560275587)移动到MongoDB,我的问题是我如何配置mongodb与awscli对话控制台,然后将文件夹内容推送到MongoDB
我将AWS与Gitlab结合使用
$ 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-1560275587的所有内容(包括文件夹名称Jun-06-1560275587)从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