centos7安装jenkins..

无聊,弄点事情干.
安装方式很多,找个最简单的方式安装.

修改yum源为国内的.(清华大学的.)

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

安装jdk

1.  自己下载二进制包解压安装
    http://openjdk.java.net/install/index.html openjdk主页,下载最新的或者你喜欢的.  `tar xvf openjdk-12.0.1_linux-x64_bin.tar.gz`  然后把 openjdk..\bin\ 加入到`PATH`中 `vim  /etc/profile` 等方式  
 2. `yum install java-1.8.0-openjdk -y` 安装,自己会加 PATH的 [√]

安装maven

wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
tar xvf apache-maven-3.6.1-bin.tar.gz
mv apache-maven-3.6.1 /usr/local/maven3

vim /etc/profile

export MAVEN_HOME=/usr/local/maven3
export PATH="${MAVEN_HOME}/bin:$PATH"


source /etc/profile

安装jenkins

wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.164.3-1.1.noarch.rpm
yum install jenkins-2.164.3-1.1.noarch.rpm
systemctl restart jenkins
systemctl enable jenkins

登录jenkins

http://jenkins服务器ip:8080
获取第一次管理员密码
cat /var/lib/jenkins/secrets/initialAdminPassword
登录后设置一个管理员.

配置国内插件源.

1.进入jenkins系统管理
2.进入插件管理
3.点击高级,修改升级站点的地址为清华大学镜像地址
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

点提交即可,之后刷新下 插件就出来了.

其实下载插件的时候还是到github上去下载的

假设你密码忘记了.
参考这个页面操作(为啥你会忘?当真是忘了? ๑乛◡乛๑):
https://blog.csdn.net/wh211212/article/details/76825305

猜你喜欢

转载自www.cnblogs.com/lovesKey/p/10908579.html