当前位置:网站首页>jenkins的文件参数,可以用来上传文件
jenkins的文件参数,可以用来上传文件
2022-07-25 16:44:00 【低调说】
当我们希望上传文件到服务器上时,临时写一个上传页面是很麻烦的。好在 Jenkins 提供了文件参数控制器,方便我们上传文件到服务器上,并做进一步处理。本文详细介绍具体步骤。
参数
在Jenkins 的 Job 配置界面内,新建一个 File Parameter

这里有点坑,你上传完了,jenkins把文件名给改了。我找了很多文章,把这个问题给解决了。
首先这个名称是误导性的:『文件路径』和上传文件的路径毫无关系。实际的含义是,如果按上图中,在『文件路径』中填入 testfile ,当文件上传后,将发生两件事情:
文件上传到 jenkins 的 workspace 中,然后重命名为 test_file
文件上传前的名称(在用户的文件系统中的名称),保存在 ${test_file} 变量中
接下来,我们可以通过 ${testfile} 变量,将上传的文件改回原来的名字,或者做其他操作。
关键命令
mv test_file /tmp/$test_file
这两个test_file 不一样的 ,
第一个test_file是上传的文件,这个不能写成变量的样子,不然就错了,
第二个$test_file 文件上传前的名字 这就没问题了
参考链接
https://www.lfhacks.com/tech/jenkins-upload-portal/
边栏推荐
- C Music
- unity 最好用热更方案卧龙 wolong
- Talk about how to use redis to realize distributed locks?
- easyui下拉框,增加以及商品的上架,下架
- 02. Limit the parameter props to a list of types
- [image denoising] image denoising based on bicube interpolation and sparse representation matlab source code
- Understanding service governance in distributed development
- 华泰vip账户证券开户安全吗
- 复旦大学EMBA2022毕业季丨毕业不忘初心 荣耀再上征程
- 【数学建模绘图系列教程】二、折线图的绘制与优化
猜你喜欢

How to deploy applications on IPFs using 4everland cli
![[fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code](/img/9e/138e4b160fa9bd6486fac44a788d09.png)
[fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code

异常处理机制专题1

【obs】转载:OBS直播严重延迟和卡顿怎么办?

今天去 OPPO 面试,被问麻了

Fudan University EMBA peer topic: always put the value of consumers in the most important position

Automatic reply of wechat official account development message

Is the win11 dynamic tile gone? Method of restoring dynamic tile in Win 11

伦敦银K线图的各种有用形态

Talk about how to use redis to realize distributed locks?
随机推荐
方正期货网上开户靠谱吗,开户安全吗?
简述redis集群的实现原理
Fudan University EMBA peer topic: always put the value of consumers in the most important position
聊聊如何用 Redis 实现分布式锁?
China's chip self-sufficiency rate has increased significantly, resulting in high foreign chip inventories and heavy losses. American chips can be said to have thrown themselves in the foot
Test framework unittest test test suite, results output to file
Rebudget: balance efficiency and fairness in market-based multi-core resource allocation by reallocating the budget at run time
Quickly deploy mqtt clusters on AWS using terraform
使用Huggingface在矩池云快速加载预训练模型和数据集
Automatic reply of wechat official account development message
How does win11's own drawing software display the ruler?
气数已尽!运营 23 年,昔日“国内第一大电商网站”黄了。。。
MYSQL导入sqllite表格的两种方法
[MySQL] takes you to the database
Fastadmin TP installation uses Baidu rich text editor ueeditor
Sum arrays with recursion
百度富文本编辑器UEditor单张图片上传跨域
02. 将参数props限制在一个类型的列表中
新增批量删除
0x80131500 solution for not opening Microsoft Store