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
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:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\
配置完Slave以后需要重启master的jenkins
2.或者安装msbuild 插件, 并在系统管理 --》 Global Tool Configuration 中设置好msbuild的路径等