jenkins安装

最近spring-boot项目用到了持续集成(CI)工具Jenkins进行部署,使用nginx作为反向代理

jenkins的安装

1
2
3
# ubuntu 16.04 LTS 安装
apt-get update
apt-get install -y jenkins

使用nginx配置jenkins

  • nginx反向代理配置
1
2
3
4
5
6
7
8
# jenkins
location ^~ /jenkins {
proxy_pass http://127.0.0.1:8080/jenkins;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
  • /etc/default/jenkins添加--prefix=$PREFIX配置

    1
    JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --prefix=$PREFIX"
  • 启动jenkins

    1
    service jenkins start

参考链接

分享到