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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM