1,安装 centos下: 如果没有jenkins库 需要先添加库 - $ wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo
- $ rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
复制代码2,启动 jenkins安装好以后 查看jenkins启动状态 如果没有启动可能是端口占用,jenkins默认的启动端口为8080 修改启动端口: jenkins的war包存放在/usr/lib/jenkins目录下,配置文件jenkins在/etc/sysconfig有个jenkins文件,修改端口为8888 ubuntu上该文件在 /etc/default/jenkins - ## Type: integer(0:65535)
- ## Default: 8080
- ## ServiceRestart: jenkins
- #
- # Port Jenkins is listening on.
- # Set to -1 to disable
- #
- JENKINS_PORT="8888"
复制代码可以看到jenkins的主目录 - ## Path: Development/Jenkins
- ## Description: Jenkins Continuous Integration Server
- ## Type: string
- ## Default: "/var/lib/jenkins"
- ## ServiceRestart: jenkins
- #
- # Directory where Jenkins store its configuration and working
- # files (checkouts, build reports, artifacts, ...).
- #
- JENKINS_HOME="/var/lib/jenkins"
复制代码建议修改一处配置增加一个参数 - -Dhudson.util.ProcessTree.disable=<span class="hljs-keyword" style="box-sizing: inherit;">true</span>
复制代码以后会用到: - ## Type: string
- ## Default: "-Djava.awt.headless=true"
- ## ServiceRestart: jenkins
- #
- # Options to pass to java when running Jenkins.
- #
- JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Dhudson.util.P
- rocessTree.disable=true"
复制代码3,修改密码: 启动成功以后访问: 进入密码登陆页面:第一次进入,随机密码在配置文件中 - /var/lib/jenkins/secrets/initialAdminPassword
复制代码
|