jenkins - 如何使用 httprequest 插件 jenkins 发送文件(zip)
问题描述
我需要将 zip 文件上传到 appDynamics,我需要使用我的 jenkins 管道中的 httpsrequest 插件
上传 appdynamics 请求:
curl -v -H Content-Type:application/octet-stream --upload-file UISampleApp.app.dSYM.zip --user Example account:Example-License-Key-4e8ec2ae6cfe https://api.eum-appdynamics.com/v2/account/Example+account/ios-dsym
我们现在正在使用 shell 执行上述请求,但我正在尝试找出如何使用httpsRequest 插件发送多个 zip 文件
解决方案
以下代码对我有用:
def response = httpRequest(acceptType: 'APPLICATION_JSON', contentType: 'APPLICATION_ZIP',
customHeaders : [[name: "authorization" , value : "${authToken}"],[name: 'x-username' , value: 'admin']],
httpMode: 'POST', ignoreSslErrors: true,
multipartName: '<fileName>', timeout: 900,
responseHandle: 'NONE', uploadFile: "<filePath>",
url: "${url}")
推荐阅读
- error-handling - 有没有办法在任意 `&dyn std::error::Error` 特征对象上获取 SNAFU 的 `.backtrace()`?
- at-command - AT 命令:文本模式选择不起作用
- vbscript - 以管理员身份执行脚本时找不到文件
- python - continue 是否会阻止 else 块在 for/else 语句中运行?
- java - 不同的 SimpleDateFormat 解析
- python - Matplotlib Auto Annotate max 不注释并将图表推离页面
- nginx - Nginx通过UNC列出网络共享的内容?
- python - 尝试覆盖 QTreeView.edit() 时出现最大递归错误
- javascript - 两个使用 Javascript 的 HTML 页面链接
- ssl - 重网站负载下的 IIS SSL 问题——非 SSL 工作正常