jenkins安装指南

jenkins是准备用来做和gitlab自动部署的,jenkins依赖于java所以我们需要先配置java环境


yum install java-1.8.0-openjdk* -y直接安装java1.8的所有文件

如果报错 请切换至阿里yum源


第一步:备份你的原镜像文件,以免出错后可以恢复。

(使用mv命令,mv有两个作用一个是移动,一个是重命名,这里用到的是重命名的作用)

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/


要查看自己CentOS版本命令

[root@localhost ~]# lsb_release -a



阿里云 

CentOS 5   wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6   wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7   wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo


执行

yum clean all
yum makecache

可以重新执行安装java jdk yum install java-1.8.0-openjdk*

java -version 查看是否安装成功


接下来安装jenkins

wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war


设置jenkins 根目录位置(linux centos 默认安装在/root/.jenkins目录下)

a. 编辑 bash_profile 文件

   vi /root/.bash_profile

b. 添加如下内容(设置jenkins根目录)   export JENKINS_HOME=/opt/jenkins

c. 生效更改

   source /root/.bash_profile


启动jenkins(默认启动是8080 手动启动改为8888,避免端口冲突)

java -jar jenkins.war --httpPort=8888 &

查看启动情况

ps aux | grep jenkins

接下来就可以访问了

http://ip:8888

剩下的按照操作走就可以了中文的,稳得不行

博客
请先登录后发表评论
  • 最新评论
  • 总共0条评论