text:文本, 可包括多行 booleanParam:布尔参数 choice:choice 参数 password:密码参数 示例脚本: pipeline { agent any parameters { string(name: 'DEPLOY_ENV', defaultValue: 'staging', description: '') text(name: 'DEPLOY_TEXT', defaultValue: 'One\nTwo\nThree\n', description: '') booleanParam(na...
参数(parameters) 不是必须, 定义参数化构建的参数可选参数, 参数类型 booleanParam,choice,file,text,password,run,string 示例: parameters { string(name: 'PERSON', defaultValue: 'Jenkins', description: '输入的文本参数') choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'P...
2、方案二:安装Persistent Parameter Plugin,适用范围广,string、text、bool、choice也都适用。 或两个方案混合使用都可 方案一 、 安装Groovy Postbuild 插件。 Groovy Postbuild | Jenkins plugin 方案二 、安装Persistent Parameter Plugin插件。、 Jenkinsfile中通过parameters中的choice(下拉框)类型获取输入参数的方法...
} 参数parameters 不是必须, 定义参数化构建的参数可选参数, 参数类型 booleanParam,choice,file,text, password,run,string 示例: parameters { string(name: 'PERSON', defaultValue: 'Jenkins', description: '输入的文本参 数') choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description:...
不是必须,预定义 Pipeline 专有的配置信息,仅可定义一次 示例: 参数parameters 不是必须, 定义参数化构建的参数可选参数, 参数类型 booleanParam,choice,file,text, password,run,string 示例: 触发器 triggers 不是必须,定义 Pipeline 被自动触发的方式选项 cron、pollSCM、upstream 示例:...
参数(parameters) 不是必须, 定义参数化构建的参数可选参数, 参数类型 booleanParam,choice,file,text,password,run,string 示例: parameters { string(name: 'PERSON', defaultValue: 'Jenkins', description: '输入的文本参数') choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: '...
参数parameters 不是必须, 定义参数化构建的参数可选参数, 参数类型 booleanParam,choice,file,text, password,run,string 示例: parameters { string(name: 'PERSON', defaultValue: 'Jenkins', description: '输入的文本参 数') choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: ...
参数(parameters) 不是必须, 定义参数化构建的参数可选参数, 参数类型 booleanParam,choice,file,text,password,run,string 示例: parameters { string(name: 'PERSON', defaultValue: 'Jenkins', description: '输入的文本参数') choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: '...
properties([parameters([string(name: 'LIB_VERSION', defaultValue: 'master')])]) library "my-shared-library@${params.LIB_VERSION}" 注意,虽然可以在@Library中覆盖默认的版本,但是library步骤可能无法用来覆盖隐含加载的库的版本:因为在脚本启动时已经加载了库,给定名字的库无法加载两次; ...
一、Jenkinsfile语法简介 Jenkinsfile支持两种语法形式: Declarative pipeline - v2.5之后引入,结构化方式 Scripts pipeline -基于groovy的语法 image.png 二、Jenkinsfile语法-Declarative pipeline 必须包含在一个pipeline块内,具体来说是:pipeline { } 基本的部分是“steps”,steps告诉Jenkins要做什么 ...