jenkins 安裝配置: centos-master windows/linux-slave + nginx代理 + node + job

來源:互聯網
上載者:User

標籤:

centos install jenkins:

1.sudo vi /etc/yum.repos.d/jenkins.repo

[jenkins]name=Jenkinsbaseurl=http://pkg.jenkins-ci.org/redhatgpgcheck=1

 

2.下載

cd /tmpwget http://ftp.yz.yamagata-u.ac.jp/pub/misc/jenkins/redhat/jenkins-2.1-1.1.noarch.rpm

 

3.安裝

rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.keyrpm -ivh jenkins-2.1-1.1.noarch.rpmservice jenkins start

 

4.訪問 http://localhost:8080

note: jenkins設定檔   /etc/sysconfig/jenkins

 

5.升級 可以在http://localhost:8080的系統管理頁直接下載升級檔案

替換/usr/lib/jenkins/下的jenkins.war檔案就可以升級了

service jenkins stop cp -a jenkins.war /usr/lib/jenkins/jenkins.warservice jenkins start

 

 

設定nginx:

1. 安裝nginx

2. 配置

  a. vi /etc/nginx/nginx.conf    
      尋找 # include /etc/nginx/conf.d/*.conf;
      去掉前面的 # 符號

  b. sudo vim /etc/nginx/conf.d/jenkins.conf      

#/etc/nginx/conf.d/jenkins.confserver {    listen       80;    server_name  jenkins.jobstreet.com;    #access_log /var/log/jenkins_access_log main;    #error_log  /var/log/jenkins_error_log  debug_http;    client_max_body_size 60M;    client_body_buffer_size 512k;    location / {        port_in_redirect on;        proxy_pass      http://localhost:8080;        proxy_redirect  off;        proxy_set_header Host $host;        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    }}              

  c. sudo vi /etc/hosts 

   加入 127.0.0.1  jenkins.jobstreet.com

      如果是其他機子訪問的話也需要加入到host檔案

 

jenkins 設定linux 節點

 

 

 

jenkins 設定windows 節點

修改windows設定

 

 

 jenkins上建立windows的node

 

jenkins 用jenkins-cli.jar

 

 

 

jenkins 設定jobs

 

note: 

slave:
   如果是windows, 並且用到了MSBuild,
   1.那麼需要在windows中配置msbuild的路徑到PATH。eg: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\
      配置完Slave以後需要重啟master的jenkins
   2.或者安裝msbuild 外掛程式, 並在系統管理 --》 Global Tool Configuration 中設定好msbuild的路徑等

 

jenkins 安裝配置: centos-master windows/linux-slave + nginx代理 + node + job

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.