当前位置:网站首页>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/
边栏推荐
猜你喜欢

152. 乘积最大子数组

Sum arrays with recursion

为什么 4EVERLAND 是 Web 3.0 的最佳云计算平台

吴恩达逻辑回归2
![[xiao5 chat] check the official account < the service provided by the official account has failed, please wait a moment>](/img/b2/cbba006e5d1ada959f494336e93f39.png)
[xiao5 chat] check the official account < the service provided by the official account has failed, please wait a moment>

easyui修改以及datagrid dialog form控件使用

进程之间的通信(管道详解)

今天去 OPPO 面试,被问麻了

Rebudget汇报PPT

激荡20年,芯片产能从零起步到反超美国,中国制造的又一大成就
随机推荐
Ilssi certification | the course of Six Sigma DMAIC
ILSSI认证|六西格玛DMAIC的历程
Birui data joins Alibaba cloud polardb open source database community
链游开发现成版 链游系统开发详细原理 链游源码交付
MySQL视图
【知识图谱】实践篇——基于医疗知识图谱的问答系统实践(Part4):结合问题分类的问题解析与检索语句生成
为什么 4EVERLAND 是 Web 3.0 的最佳云计算平台
fastadmin tp 安装使用百度富文本编辑器UEditor
[MySQL] takes you to the database
[xiao5 chat] check the official account < the service provided by the official account has failed, please wait a moment>
easyui修改以及datagrid dialog form控件使用
MyBaits
测试框架-unittest-命令行操作、断言方法
气数已尽!运营 23 年,昔日“国内第一大电商网站”黄了。。。
What is the shortcut key for win11 Desktop Switching? Win11 fast desktop switching method
Test Driven Development (TDD) online practice room | classes open on September 17
【数学建模绘图系列教程】二、折线图的绘制与优化
首页门户分类查询
Two methods of importing sqllite table from MySQL
Today, I went to oppo for an interview and was asked numbly