基础配置
jenkins 插件源修改
进入/home/devops/.jenkins/updates
目录
[devops@devops updates]$ pwd
/home/devops/.jenkins/updates
[devops@devops updates]$ ls
default.json hudson.tasks.Maven.MavenInstaller
[devops@devops updates]$
执行
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
进入jenkins的插件管理,病设置Update Site
,网址为:
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
重启tomcat生效
汉化插件
Role-based Authorization Strategy 插件
此插件暂未启用
凭据插件
进入凭据配置页面【有些版本首页没有凭据菜单,可以手动输入地址进入】
gitee 插件
帮助文档: https://gitee.com/help/articles/4193
git ssh 多用户配置
将来有可能使用gitlab
删除全局git用户信息
多用户情况下,尽量不要设置全局用户信息
# 添加全局用户信息
git config --global user.name "用户名"
git config --global user.email "邮箱"
#删除全局用户信息
git config --global --unset user.name
git config --global --unset user.email
生成 key
$ ssh-keygen -t rsa -C "github@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): id_rsa_github
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa_github.
Your public key has been saved in id_rsa_github.pub.
The key fingerprint is:
SHA256:K8ZzHA4rrhgHlv7qyP+dAmvpQIq+jPUpbMdjXZncAnE github@qq.com
The key's randomart image is:
+---[RSA 2048]----+
| |
| . E |
| o |
| . . |
|.+ .oS+ |
|*. . . =*o. |
|++o.=.*.=. |
|*=**==o+. |
|=OBO=o.o |
+----[SHA256]-----+
使用同样的方式生成另一个Key,并将key添加至相应网站
配置 config
文件位置 ~/.ssh/config [注意不可有注释]
Host gitee.com
User sanren2016
Hostname gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_gitee
将密匙加入密匙管理器
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa_github
Enter passphrase for /c/Users/Administrator/.ssh/id_rsa_github:
Identity added: /c/Users/Administrator/.ssh/id_rsa_github (/c/Users/Administrator/.ssh/id_rsa_github)
$ ssh-add ~/.ssh/id_rsa_gitlab
Enter passphrase for /c/Users/Administrator/.ssh/id_rsa_gitlab:
Bad owner or permissions on .ssh/config的解决
chmod 600 config
克隆后的操作
git config user.name "xxx"
git config user.email "xxx"
手动部署项目
gitee 新建项目
https://gitee.com/sanren2016/shop-boot
添加一个简单接口,参见:https://gitee.com/sanren2016/shop-boot/commit/ce3771c208b3fbaaa2f577d78ff9669279457dc1
spring boot 脚本启动
启动脚本与配置文件
- 目录结构
[stest@shopboot shop-boot]$ pwd
/home/stest/shop-boot
[stest@shopboot shop-boot]$ tree
.
├── conf
│ ├── application.yml
│ └── logback-spring.xml
├── logs
├── sbin
│ └── control.sh
└── shop-boot.jar
3