如果你还不知道怎么安装配置,请看我上上一篇文章哦~~~
地址 : https://www.jianshu.com/p/008375eff5df
如果你还不知道简单使用,请看我上一篇文章哦~~~
地址 : https://www.jianshu.com/p/c85a26cbc445
ok,直奔主题吧.

上面的图片中可以看到我有两个分支和一个 tag.
第一步,安装插件

选择
Git Parameter Plug-In
安装,安装完成了,重启一下 jenkins.把 Tomcat 关掉,重进来一次就即可.不重启,有时候不生效~~~

安装好了,是在已安装里面就会看到
Git Parameter Plug-In

第二步 配置
打开 HelloWorld 项目,点击配置

勾选
This project is parameterized

选择
Git Parameter
,不安装 Git Parameter Plug-In
插件,是没有这个选项的哦~~~
填写信息

第三步 引用参数
TAG
是我们刚才写名称,引用方式就是用${TAG}

然后保存,开始构建
选择哪个就构建哪个啦~~~

成功咯~~~~

以上,我们 git 参数说完了咯.够用啦~~~
我们接下来再说说其他的参数怎么使用吧~~~~
老地方

如图,我添加一个
String Parameter
的参数和一个 Password Parameter
参数,我实在构建执行python脚本的时候用到的,先给大家打印演示一下吧,等后面的文章在具体说.执行 python 脚本的时候,也需要插件哦,
Python Plugin
和 Python Wrapper Plugin
安装完了也要重启一下哈,防止不生效.

然后在下面的构建中点击Execute python script

来一下小段 python 代码,就去打印一下用户名个密码

点击保存,回到首页,开始构建

再看看控制台打印

成功~~~
以上,参数的使用差不多了~~~够用啦
下一篇,我们来说说,把 apk 上传到蒲公英上去,并发送钉钉通知~~~~
网友评论