Jenkins安装

0. 安装git

yum -y install git

1.安装jdk yum search java (选jdk1.8安装)

vim /etc/profile    配置环境变量(为了jenkin后续配置做准备)

底部加入:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64

export PATH=${PATH}:${JAVA_HOME}/bin

加完存, 并执行 source /etc/profile

2. 安装maven  

a). /ect/profile中配置环境变量

export MAVEN_HOME=/usr/local/src/apache-maven-3.8.1

export PATH=${PATH}:${MAVEN_HOME}/bin

加完存, 并执行 source /etc/profile

b). 修改maven配置文件,两处

alimaven

aliyun maven

http://maven.aliyun.com/nexus/content/groups/public/

central       

/a/b/c/localMavenRepository

3. jenkins安装 

参见官网 https://pkg.jenkins.io/redhat-stable/

  sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

  sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

  yum install epel-release # repository that provides 'daemonize'

  yum install jenkins

4. 装完后 修改配置

vim /etc/sysconfig/jenkins

JENKINS_PORT="8090"  #默认8080,被其他服务占了,所以改下

5. 启动 

systemctl start jenkins

6. 浏览器访问 IP:8090/

会出现让输入初始化密码的弹层

初始密码 复制出来,贴到这,点下一步

/var/lib/jenkins/secrets/initialAdminPassword

7. 点击安装推荐插件 (要花几分钟)

8. 创建新用户

  用户:admin  密码:admin


9.jenkins URL: http://IP:8090/

10. 配置jdk, maven

JAVA_HOME:  /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64

MAVEN_HOME: /usr/local/src/apache-maven-3.8.1

GIT:/usr/bin/git

配置git:

配置JDK

配置MAVEN配置文件

配置化

配置MAVEN HOME

你可能感兴趣的:(Jenkins安装)