jenkins使用Git為源碼管理(windows master && linux slave)

來源:互聯網
上載者:User

標籤:jenkins   git   windows master && linux slave   

作為一個不太經常總結的人,工作以來碰到過太多問題!往往解決之後沒有有效記錄,導致再次碰到需要重新查資料解決。現在改變下習慣,努力搞的了技術。


公司最近提倡開源(以前啥都機密,即使開源也沒改變多少),代碼從SVN遷移至Git管理,這樣導致原來記錄項目日誌的wiki持續整合job需要重新設定。之前的設定為:每分鐘檢查SVN變化,有變化就執行編譯發布。改為Git後,碰到坑坑窪窪,一併列在下面。


  1. jenkins的Git外掛程式安裝

git plugin,git client plugin,github plugin,往往安裝的時候會把關聯依賴的一遍進行安裝。


2. Windows Master && Linux Slave中Git的配置

windows上安裝git,很簡單;linux上安裝git,“很簡單”。但是git problems for windows master and linux slave == 頭大!

2.1 

Cannot run program "C:\Program Files (x86)\Git\bin" (in directory "/home/jenkins/workspace/Wiki_Git")

這個問題很初級,在jenkins的系統配置中把Git的配置改為

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/74/4F/wKioL1YY4XfjIIpSAADCe4tii10123.jpg" title="TimLine圖片20151010175804.png" alt="wKioL1YY4XfjIIpSAADCe4tii10123.jpg" />

這樣方便在windows和linux中通用


2.2 

ERROR: Error fetching remote repo ‘origin‘hudson.plugins.git.GitException: Failed to fetch from http://source.jd.com/app/im4.1-wiki.gitat hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:763)at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)at hudson.scm.SCM.checkout(SCM.java:484)at hudson.model.AbstractProject.checkout(AbstractProject.java:1259)at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)at hudson.model.Run.execute(Run.java:1759)at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)at hudson.model.ResourceController.execute(ResourceController.java:89)at hudson.model.Executor.run(Executor.java:240)Caused by: hudson.plugins.git.GitException: Command "/usr/libexec/git-core/git config --local credential.username guoweiwei" returned status code 129:stdout: stderr: error: unknown option `local‘usage: git config [options]


linux中安裝的git版本過低,需要升級版本


2.3

fatal: Unable to find remote helper for ‘http‘

升級版本之後,原因為編譯時間,libcurl未安裝等,具體步驟如下:

a. 下載需要安裝的git版本

b. 解壓縮

c. yum install libcurl-devel

d. yum install perl-ExtUtils-MakeMaker package(Can‘t locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 3.)

e. yum install tk zlib-devel openssl-devel perl cpio expat-devel gettext-devel(MSGFMT po/de.msg make[1]: *** [po/de.msg] Error 127)  

f. ./configer --with-curl --with-expat

g. make && make install


2.4

Git Polling Log提示“FATAL: hudson.plugins.git.GitException: Error performing command: C:\Windows\TEMP\hudson11232435”,且無法檢測到git更新進行自動構建

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/74/52/wKiom1YY5jCxB3dHAAHFOC0btXo179.jpg" title="TimLine圖片20151010181907.jpg" alt="wKiom1YY5jCxB3dHAAHFOC0btXo179.jpg" />




本文出自 “搞不了技術” 部落格,請務必保留此出處http://jdcdyjy.blog.51cto.com/10778026/1701639

jenkins使用Git為源碼管理(windows master && linux slave)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.