CentOS7安装Jenkins
2018-01-13 本文已影响132人
GoGooGooo
1. 安装前的准备
如果安装2.0之后的需要安装jdk1.8以上,安装方法在结尾
2. 下载安装包并上传至服务器
3. 安装
# 进入上传目录,执行
rpm -ih jenkins-2.89.2-1.1.noarch.rpm
成功提示
warning: jenkins-2.89.2-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 82e6: NOKEY
########################################### [100%]
########################################### [100%]
文件目录
/usr/lib/jenkins/jenkins.war WAR包
/etc/sysconfig/jenkins 配置文件
/var/lib/jenkins/ 默认的JENKINS_HOME目录
/var/log/jenkins/jenkins.log Jenkins日志文件
4. 启动
service jenkins start
如果遇到以下错误提示
Starting Jenkins Jenkins requires Java8 or later, but you are running 1.7.0_99-mockbuild_2016_05_11_05_30-b00 from /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.99.x86_64/jre
java.lang.UnsupportedClassVersionError: 51.0
at Main.main(Main.java:124)
[ OK ]
# 说明需要安装jdk1.8
正确提示
[root@192 sofeware]# service jenkins start
Starting Jenkins [ OK ]
5. 访问
访问地址,修改自己的服务器ip
http://192.168.1.130:8080/
初次进入访问密码在
vim /var/lib/jenkins/secrets/initialAdminPassword
➡️ yum jdk1.8安装
# 列出所有安装包
yum -y list java*
#列内容
java-1.8.0-openjdk.x86_64
# 安装命令
yum -y install java-1.8.0-openjdk.x86_64
➡️ RPM卸载
首先通过 rpm -q <关键字> 可以查询到rpm包的名字
然后 调用 rpm -e <包的名字> 删除特定rpm包
如果遇到依赖,无法删除,使用 rpm -e --nodeps <包的名字> 不检查依赖,直接删除rpm包
如果恰好有多个包叫同样的名字,使用 rpm -e --allmatches --nodeps <包的名字> 删除所有相同名字的包, 并忽略依赖
如果你的Jenkins服务器没有外网访问权,往下看⬇️
找一台可以联网的机器,安装Jenkins,然后进入JENKINS_HOME目录,把plugins这个目录打包下载下来,然后上传到你的Jenkins服务器,最后重启服务!
# 在可以联网服务器的 JENKINS_HOME 目录中压缩
tar czvf plugins.tar plugins/
# 在不可以联网服务器的 JENKINS_HOME 目录中解压
tar xzvf plugins.tar
—— | —— | —— | —— |
---|---|---|---|
Security Plugin | Command Agent Launcher Plugin | Folders Plugin | bouncycastle API Plugin |
Structs Plugin | Pipeline: Step API | SCM API Plugin | Pipeline: API |
JUnit Plugin | Pipeline: Supporting APIs | Pipeline: Job | Token Macro Plugin |
Build Timeout | Credentials Plugin | SSH Credentials Plugin | Plain Credentials Plugin |
Credentials Binding Plugin | Timestamper | Durable Task Plugin | Pipeline: Nodes and Processes |
Matrix Project Plugin | Resource Disposer Plugin | Workspace Cleanup Plugin | Ant Plugin |
Gradle Plugin | Pipeline: Milestone Step | JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin | Jackson 2 API Plugin |
JavaScript GUI Lib: ACE Editor bundle plugin | Pipeline: SCM Step | Pipeline: Groovy | Pipeline: Input Step |
Pipeline: Stage Step | Pipeline Graph Analysis Plugin | Pipeline: REST API Plugin | Pipeline: Stage View Plugin |
Pipeline: Build Step | Pipeline: Model API | Pipeline: Declarative Extension Points API | Display URL API |
Mailer Plugin | Matrix Authorization Strategy Plugin | JSch dependency plugin | Git client plugin |
GIT server Plugin | Pipeline: Shared Groovy Libraries | Branch API Plugin | Pipeline: Multibranch |
Authentication Tokens API Plugin | Docker Commons Plugin | Docker Pipeline | Pipeline: Declarative Agent API |
Pipeline: Basic Steps | Pipeline: Declarative | Pipeline | GitHub API Plugin |
Git plugin | GitHub plugin | GitHub Branch Source Plugin | Pipeline: GitHub Groovy Libraries |
MapDB API Plugin | Subversion Plug-in | SSH Slaves plugin | PAM Authentication plugin |
LDAP Plugin | Email Extension Plugin |