一、安装
jenkins下载地址:https://www.jenkins.io/zh/download/ jdk1.8下载地址:https://www.oracle.com/cn/java/technologies/javase/javase8-archive-downloads.html tomcat下载地址:https://tomcat.apache.org/download-80.cgi
Linux
Binary
# 下载 jenkins.war、jdk1.8、tomcat8
# 配置jdk环境
# 配置tomcat8
# 部署jenkins.war
# 启动tomcat
# 尝试访问
Docker(最简单)
# 初始化
container_name=jenkins
image_name=jenkins
container_data_path=/data/$container_name
mkdir $container_data_path
docker pull $image_name
# 部署
chown -R 1000:1000 $container_data_path
docker run \
--name $DOCKER_NAME \
--restart always \
--privileged true \
-v $container_data_path:/var/jenkins_home \
-p 8000:8080 \
-p 50000:50000 \
-u root \
-d $image_name
# 修改代理地址,加速插件下载
sed -i 's/http:\/\/updates.jenkins-ci.org\/download\\/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins\\/g' $container_data_path/default.json
sed -i 's/http:\/\/www.google.com/http:\/\/www.baidu.com/g' $container_data_path/updates/default.json
Source
Windows(后续补充)
二、配置
Web页初始化
常用插件(建议全部安装)
功能 | 插件 |
---|---|
汉化 | Locale plugin、Localization: Chinese (Simplified) |
SSH支持 | SSH Credentials、SSH Build Agents、Publish Over SSH |
Maven支持 | Maven Integration |
Git支持 | Git Parameter、Git client、Git 、Git server |
权限管理 | Role-based Authorization Strategy |
文件夹管理 | Folders |
特殊依赖 | JSch dependency |