安装
地址 https://www.jenkins.io/download/
ubuntu
安装 Java环境
sudo apt-get install openjdk-8-jre
jekins
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
/etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
centos
安装java环境 http://openjdk.java.net/install/index.html
yum install java-1.8.0-openjdk
安装
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
sudo yum install jenkins
启动
sudo systemctl start jenkins
查看启动结果
sudo systemctl status jenkins
获取初始化密码
查看初始化密码
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
docker 权限
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post
查看jekins 用户
cat /etc/passwd |grep jenkins
jenkins:x:112:116:Jenkins,,,:/var/lib/jenkins:/bin/bash
增加用户到jekins
sudo gpasswd -a jenkins docker
Adding user jenkins to group docker
重启jenkins
systemctl restart jenkins
Please wait while Jenkins is getting ready to work
查找文件 hudson.model.UpdateCenter.xml
# find / -name "hudson.model.UpdateCenter.xml"
/var/lib/jenkins/hudson.model.UpdateCenter.xml
修改文件
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>https://updates.jenkins.io/update-center.json</url>
</site>
</sites>
执行vim /var/lib/jenkins/hudson.model.UpdateCenter.xml
将 url 中的 https://updates.jenkins.io/update-center.json 更改为https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json 是国内的清华大学的镜像地址。
重启Jenkins
systemctl restart jenkins
docker插件
groovy.lang.MissingPropertyException: No such property: docker for class: groovy.lang.Binding
blueocean
Blue ocean 是Jenkins的一种新的UI 界面
选择插件安装Blue ocean
然后重启jekins 打开blue Ccean
参考
https://www.jenkins.io/doc/book/installing/linux/
https://github.com/jenkinsci/docker/blob/master/README.md
https://www.cnblogs.com/qiaozhuangshi/p/11762330.html
https://juejin.cn/post/6844904159838208013
https://blog.csdn.net/wade3015/article/details/95633077