当前位置:网站首页>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
边栏推荐
- The interviewer asked: this point of JS
- MySQL十种锁,一篇文章带你全解析
- The interviewer asked: can you simulate the new operator of JS
- Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection
- Adobe Premiere foundation - sound adjustment (volume correction, noise reduction, telephone tone, pitch shifter, parameter equalizer) (XVIII)
- [Yocto RM]9 - QA Error and Warning Messages
- Supervised, unsupervised and semi supervised learning
- JS random number (random number decimal)
- Adding text labels to cesium polygons the problem of polygon center point offset is solved
- Cesium 获取屏幕所在经纬度范围
猜你喜欢

面试官问:能否模拟实现JS的new操作符

Cesium obtains the latitude and longitude range of the screen

Maimai hot post: Why are big factories keen on making wheels?
![[embedded foundation] serial port communication](/img/b7/18fec20e2d5fa5f226c6f8bb1e93d2.png)
[embedded foundation] serial port communication

Using redis bitmap to realize personnel online monitoring

Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection

MapReduce elementary programming practice

数据库的新选择 Amazon Aurora

766. toplitz matrix

Adobe Premiere foundation - sound adjustment (volume correction, noise reduction, telephone tone, pitch shifter, parameter equalizer) (XVIII)
随机推荐
Centos8 operation record command version Yum redis MySQL Nacos JDK
Appium automation test foundation - Supplement: app package name and appactivity
Chapitre 4: redis
Cesium color color (assignment) random color
【嵌入式基础】串口通信
1382. balancing binary search tree - General method
[Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
Numpy----np.meshgrid()
Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)
TD Hero 线上发布会|7月2日邀你来
OS模块与OS.path 模块的学习
Cesium Click to draw polygons (dynamically draw polygons)
Hi, you have a code review strategy to check!
学习 pickle
Cesium 抗锯齿(线,边框等)
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
嵌入式必学,硬件资源接口详解——基于ARM AM335X开发板 (上)
geojson 格式說明(格式詳解)
数据库的新选择 Amazon Aurora
Cesium obtains the latitude and longitude range of the screen