1.下载war包
官网:https://www.jenkins.io/download/
国内镜像:https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/
本文jenkins版本为:Jenkins 2.235.5 LTS
2. 环境准备
- 创建jenkins工作目录:/usr/local/jenkins
- 设置JENKINS_HOME环境变量:
- vim /etc/profile
- 添加 “export JENKINS_HOME=/usr/local/jenkins” 。保存退出
- source /etc/profile - 上传jenkins.war到/usr/local/jenkins
3. 运行jenkins
指定jenkins运行端口7070
- java -jar jenkins.war --httpPort=7070
查看控制台日志中出现初始密码:
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
041427829c754