ubuntu 系统安装配置搭建jenkins(官方文档小结)

  • On Debian-based distributions, such as Ubuntu, you can install Jenkins through apt-get.

  • 使用apt方式在给予debian的linux发行版上搭建jenkins;

  • Recent versions are available in an apt repository. Older but stable LTS versions are in this apt repository.

  • 最新版本的安装包可以在apt仓库中下载;

  • You need to have a JDK and JRE installed. openjdk-7-jre and openjdk-7-jdk are suggested. As of 2011-08 gcj is known to be problematic - see https://issues.jenkins-ci.org/browse/JENKINS-743.

  • 需要安装jdk环境,因为jenkins是java项目;建议安装openjdk 7以上版本;

  • Please make sure to back up any current Hudson or Jenkins files you may have.

  • 注意:备份好你之前的jenkins文件,以免丢失!!

Installation 安装

# wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
# sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
# sudo apt-get update
# sudo apt-get install jenkins

Upgrade 升级jenkins

Once installed like this, you can update to the later version of Jenkins (when it comes out) by running the following commands:

sudo apt-get update
sudo apt-get install jenkins

(aptitude or apt-get doesn’t make any difference.)这两种安装方式会有所不;

  • What does this package do? jenkins安装包会执行一下操作;

  • Jenkins will be launched as a daemon up on start. See /etc/init.d/jenkins for more details. 启动一个守护进程;

  • The ‘jenkins’ user is created to run this service. 创建一个jenkins用户来允许jenkins服务(这个在使用jenkins的docker镜像时要注意,因为docker默认用root用户,所以需要docker run -u ‘jenkins_uid’ xxxx );

  • Log file will be placed in /var/log/jenkins/jenkins.log. Check this file if you are troubleshooting Jenkins.
    /etc/default/jenkins will capture configuration parameters for the launch like e.g JENKINS_HOME

  • By default, Jenkins listen on port 8080. Access this port with your browser to start configuration.默认监听在8080端口,如果你机器上的8080端口被占用你可以按照下面的方式配一个没有占用的端口给jenkins服务;
    If your /etc/init.d/jenkins file fails to start jenkins, edit the /etc/default/jenkins to replace the line
HTTP_PORT=8080  #默认

by

HTTP_PORT=8081  #修改位8081 当然你也可以配置其他空闲端口;

Here, 8081 was chosen but you can put another port available.

更进一步的配置可以在官方文档中查阅;建议查阅官方文档,好多百度的东西容易误导!!

官方文档

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值