Jenkins 官网:http://jenkins-ci.org/
安装说明:https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins
On RPM-based distributions, such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora or Scientific Linux, you can install Jenkins through yum.
Recent versions are available in a YUM repository.
Installation
Add the Jenkins repository to the yum repos, and install Jenkins from here.
- sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
- sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
- sudo yum install jenkins
Installation of a stable version
There is also a LTS YUM repository for the LTS Release Line
- sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
- sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
- sudo yum install jenkins
Installation of Java
Jenkins requires Java in order to run, yet certain distros don‘t include this by default. To install the Open Java Development Kit (OpenJDK) run the following:
sudo yum install javaNote: If running CentOS, ensure you follow the guide below.
Start/Stop
- sudo service jenkins start/stop/restart
- sudo chkconfig jenkins on
因为初学,我直接把iptables关了,免得出现些没必要的错误。
查看jenkins运行状态:
[[email protected] ~]# ps -ef |grep jenkins jenkins 6691 1 0 06:27 ? 00:02:53 /etc/alternatives/java -Dcom.sun.akuma.Daemon=da/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --ajp13Port=8 root 7823 7346 0 12:42 pts/1 00:00:00 grep jenkins
安装完成之后在浏览器里打开: URL:8080就可以了。如192.168.179.128:8080
Jenkins 用户控制,第一个注册的用户为管理员。其他的注册用户都没有任何权限,需要管理员手动添加。
在“Configure Global Security”里勾选“启用安全”,“Jenkins专有用户数据库”,“允许用户注册”。
在授权策略里选“安全矩阵”。安全矩阵里可以针对每个用户进行权限控制。以后再慢慢分析具体的权限控制。
这样的用户控制大概意思是,管理员拥有所有权限,其他的素有用户需要注册,并且注册之后通知管理员赋予权限。