Jenkins Pipeline-如何将文件夹上传到S3? [英] Jenkins Pipeline - How to upload folder to S3?

查看:1076
本文介绍了Jenkins Pipeline-如何将文件夹上传到S3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为,当jenkins构建静态网站时,我有一个简单的用例,因此在构建结束时,我有一个类似于$ WORKSPACE/site-result的文件夹.

I have, as I think, simple use case, when jenkins builds static website, so in the end of the build, I have a folder like $WORKSPACE/site-result.

现在,我想将此文件夹上载到S3(如果已有的话,则清理存储桶).我该怎么做?

Now I want to upload this folder to S3 (and clean bucket if something already there). How can I do it?

我正在使用管道,但如有必要,可以切换到自由样式项目.到目前为止,我已经安装了S3插件(S3发布者插件).已创建IAM用户.向配置系统"部分添加了凭据.并且找不到任何进一步的信息.谢谢!

I'm using pipeline, but can switch to freestyle project if necessary. So far I installed S3 Plugin (S3 publisher plugin). Created IAM user. Added credentials to "Configure system" section. And can't find any further info. Thanks!

推荐答案

如果答案提示管道AWS插件不起作用,则您在使用sh的管道中始终可以有一个upload步骤,请致电AWS CLI:

If the answer suggesting the Pipeline AWS Plugin doesn't work, you could always have an upload step in your pipeline where you use sh call the AWS CLI:

aws s3 cp $WORKSPACE/site-result s3://your/bucket --recursive --include "*"

来源: http://docs.aws.amazon.com/cli/latest/reference/s3/

这篇关于Jenkins Pipeline-如何将文件夹上传到S3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆