jenkins
2019-10-30 本文已影响0人
胸口砕大石
安装jdk
yum install -y java-1.8.0-openjdk-devel.x86_64
安装jenkins
官方传送门 阿帕奇千秋万代 ★,°:.☆( ̄▽ ̄)/$:.°★。撒花!
yum -y install wget
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum -y install jenkins
重启 reboot
重启 reboot 重启 reboot
登录docker私有仓库
docker login 192.168.7.80
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
jenkins配置
官方传送门https://jenkins.io/zh/doc/book/installing/
访问jenkinshttp://192.168.7.69:8080
界面卡住
Please wait while Jenkins is getting ready to work
修改/var/lib/jenkins/hudson.model.UpdateCenter.xml中的url为如下网址
然后重启(我暂时没找到重启jenkins方法 ,我reboot)
http://mirror.xmission.com/jenkins/updates/update-center.json

获取初始密码
我是通过日志的方法 按照界面提示的也行
cat /var/log/jenkins/jenkins.log

报错404

百度后解决方案:
这是一个Jenkins的Bug。临时解决方法是:在浏览器中手工输入:http://<ip>:<port>
。不要访问"/jenkins"这个路径。
安装插件
安装推荐插件

等待....吃饭
新建用户
白屏了 .....
http://192.168.7.69:8080/restart
重启 jenkins

安装语言包

设置语言

亲测 无鸟用~
下一话题
安装maven此方法有时候不好用.....
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum -y install apache-maven
安装maven B方案,第一种多试几次好用了....
配置阿里云镜像
配置文件在/etc/maven/settings.xml
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>;
<mirrorOf>central</mirrorOf>
</mirror>
mvn -v
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T15:58:13+08:00)
Maven home: /usr/share/apache-maven
Java version: 1.8.0_232, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1062.4.1.el7.x86_64", arch: "amd64", family: "unix"
配置SODU免密,不然docker构建镜像报错
chmod u+w /etc/sudoers
vi /etc/sudoers
root ALL=(ALL) ALL下面加入要免密用户
....................
root ALL=(ALL) ALL
jenkins ALL=(ALL) NOPASSWD:ALL
.......................
chmod u-w /etc/sudoers
我知道一定要配一张图你们才能安心
springboot 应用
- 从svn下载源码
- maven打Jar包
- 生成docker镜像
- 推送到私有仓库
