当前位置:网站首页>Jenkins - access the Jenkins user-defined parameter variable, and handle the variable value containing spaces
Jenkins - access the Jenkins user-defined parameter variable, and handle the variable value containing spaces
2022-06-28 02:12:00 【wumingxiaoyao】
introduction
Jenkins job Some variables will be customized in , These variables will be accessed by different plug-ins . I encountered a pit in my work , Is when the variable value contains spaces , When a variable is called as a parameter Python Function time , The content after the space will be truncated , This article will solve this problem .
Summary :
- Defining variables
- Execute Python script Plug in access variables
- Execute shell Plug in access variables
Defining variables
Jenkins job Pass through Add Parameter A variable is defined String Variable of type Project_Name, The default value is... With spaces .
Execute Python script Plug in access variables
perform Python Script , adopt os.getenv(‘Project_Name’) Access variables , The printed value is Project XXX
Execute shell Plug in access variables
perform Shell command , Can pass ${Project_Name} or %{Project_Name}% Access variables
adopt echo The variable value output by the command is normal Project XXX
But called as a parameter python Script , There will be unexpected results . Pass in $ {Project_Name } As a parameter , A variable's value is Project, The content after the space is truncated .
In order to get the complete variable value , Need to add " ", " ${Project_Name} " The obtained value is complete Project XXX
边栏推荐
- Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
- [Yocto RM]9 - QA Error and Warning Messages
- 网络爬虫是什么
- Implementation of timed tasks in laravel framework
- Cesium color color (assignment) random color
- 零基礎多圖詳解圖神經網絡
- 数据库的新选择 Amazon Aurora
- [Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
- Class initialization and callback usage
- Numpy----np.reshape()
猜你喜欢

MapReduce elementary programming practice

Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)

Adobe Premiere Basics - general operations for editing material files (offline files, replacing materials, material labels and grouping, material enabling, convenient adjustment of opacity, project pa

Cesium 多边形增加文字标签(polygon 加 label)多边形中心点偏移问题解决

Jenkins - Pipeline 概念及创建方式

TIA botu_ Concrete method of making analog input and output Global Library Based on SCL language

What problems should be evaluated before implementing MES management system

Evaluation - grey correlation analysis

Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)

Neural network of zero basis multi map detailed map
随机推荐
解决ionic4 使用hammerjs手势 press 事件,页面无法滚动问题
Where can I open an account for foreign exchange futures? Which platform is safer for cash in and out?
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
[Yocto RM] 2 - Yocto Project Terms
Evaluation - rank sum ratio comprehensive evaluation
【嵌入式基础】串口通信
geojson 格式说明(格式详解)
766. 托普利茨矩阵
PV操作原语
Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)
面试官问:能否模拟实现JS的new操作符
Neural network of zero basis multi map detailed map
Cesium Click to draw polygons (dynamically draw polygons)
Cesium obtains the latitude and longitude range of the screen
MySQL十种锁,一篇文章带你全解析
Differences between cesium polygon extrudedheight and height
指南针股票开户是会有什么风险吗?指南针开户安全吗
Jenkins - Groovy Postbuild 插件丰富 Build History 信息
将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)
Is it safe to open an online futures account?