zoukankan      html  css  js  c++  java
  • jenkins 安装配置: centos-master windows/linux-slave + nginx代理 + node + job

    centos install jenkins:

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

    [jenkins]
    name=Jenkins
    baseurl=http://pkg.jenkins-ci.org/redhat
    gpgcheck=1

    2.下载

    cd /tmp
    
    wget 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.key
    rpm -ivh jenkins-2.1-1.1.noarch.rpm
    service jenkins start

    4.访问 http://localhost:8080

    note: jenkins配置文件   /etc/sysconfig/jenkins
    修改端口号: vim /etc/sysconfig/jenkins          JENKINS_PORT="8082"    

    5.升级 可以在http://localhost:8080的系统管理页直接下载升级文件

    替换/usr/lib/jenkins/下的jenkins.war文件就可以升级了

    service jenkins stop 
    
    cp -a jenkins.war /usr/lib/jenkins/jenkins.war
    
    service 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.conf
    server {
        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:WINDOWSMicrosoft.NETFrameworkv4.0.30319
          配置完Slave以后需要重启master的jenkins
       2.或者安装msbuild 插件, 并在系统管理 --》 Global Tool Configuration 中设置好msbuild的路径等

  • 相关阅读:
    172. Factorial Trailing Zeroes
    96. Unique Binary Search Trees
    95. Unique Binary Search Trees II
    91. Decode Ways
    LeetCode 328 奇偶链表
    LeetCode 72 编辑距离
    LeetCode 226 翻转二叉树
    LeetCode 79单词搜索
    LeetCode 198 打家劫舍
    LeetCode 504 七进制数
  • 原文地址:https://www.cnblogs.com/dfg727/p/5509623.html
Copyright © 2011-2022 走看看