jenkins-参数化构建(三)插件:Git Parameter

一、下载插件Git Parameter (更加省事)

在配置中branch和tag用的比较多

注意:Credential 可以添加密码,jenkins如果在root用户下载的请改   /etc/sysconfig/jenkins  为root否则会报错;或者新建普通用户XXXX在修改

然后重启即可:  service jenkins restart   

 二、配置好之后点击工程构建:

 

test分支为自己创建

[root@xiaoyuer test]# cd /root/test/app
[root@xiaoyuer app]# git branch test
[root@xiaoyuer app]# git branch
* master
  test
[root@xiaoyuer app]# git checkout test
Already on 'test'
[root@xiaoyuer app]# git branch
  master
* test
[root@xiaoyuer app]# touch a.html
[root@xiaoyuer app]# git add .
[root@xiaoyuer app]# git commit -m '1'
[test aaed40b] 1
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a.html
[root@xiaoyuer app]# git remote -v
origin    git@xx:/home/git/repos/app.git (fetch)
origin    git@xx:/home/git/repos/app.git (push)
[root@xiaoyuer app]# git push origin test
Counting objects: 4, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 262 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@47.75.44.121:/home/git/repos/app.git
 * [new branch]      test -> test
[root@xiaoyuer app]# ls
a.html  index.html

 

转载于:https://www.cnblogs.com/zhaojingyu/p/9862443.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值