Jenkins相关环境部署

安装Java

  • 这里选择安装jdk8
  • 上传安装包到服务器并解压移动到合适位置
tar -zxvf jdk-xxxxx
mkdir -p /opt/jdk8
mv jdk-xxxxx/* /opt/jdk8/
  • 配置环境
vim /etc/profile

//追加/etc/profile文件内容
export JAVA_HOME=/opt/jdk8/
export PATH=$JAVA_HOME/bin:$PATH

//配置生效
source /etc/profile
  • 测试
java -version

安装Jenkins

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 jenkins
  • 修改Jenkins配置
vim /etc/syscofig/jenkins
//修改内容如下:
JENKINS_USER="root"
JENKINS_PORT="8000"
  • 启动Jenkins
service jenkins start

查看Jenkins登录密码

cat /var/lib/jenkins/secrets/initialAdminPassword

 

你可能感兴趣的:(系统架构,jenkins,服务器)