Skip to content

Commit b2465f2

Browse files
author
Administrator
committed
2333
1 parent dc91051 commit b2465f2

15 files changed

+461
-4
lines changed

_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# SYAVING
44

5-
> 构建学习体系
5+
> S
66
77
[GitHub](https://github.com/15b883/Ops.git)
88
[首页](README)

_sidebar.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
* [GitLab](/code-management/gitlab.md)
99

1010
* [Pipeline](/pipeline/README.md)
11+
* [Jenkins](/pipeline/jenkins.md)
12+
* [Pipeline](/pipeline/pipeline.md)
1113
* [Maven](/pipeline/maven.md)
12-
14+
1315
* [常用链接](link.md)
1416
* [工作环境](/workspaces/README.md)
1517
* [VMware Workstation](/workspaces/vmware-workstation.md)
1618
* [Docker](/workspaces/docker.md)
19+
* [Windows10](/workspaces/window10.md)
1720

link.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
# 软件|工具|安装包
22

3-
## 工具
3+
## 常用软件
4+
5+
Mac局部截图快捷键:Command + Shift + 4
6+
7+
粘贴板历史记录
8+
[https://clipy-app.com/](https://clipy-app.com/)
9+
10+
截图软件
11+
[https://zh.snipaste.com/](https://zh.snipaste.com/)
12+
13+
本地hosts管理
14+
https://switchhosts.vercel.app/zh
15+
16+
前端工具
17+
[https://codepen.io/](https://codepen.io/)
18+
19+
在线画图工具
20+
[https://excalidraw.com/](https://excalidraw.com/) 白板
21+
[https://app.diagrams.net/](https://app.diagrams.net/) 思维导图
22+
23+
jinj2
24+
[https://j2live.ttl255.com/](https://j2live.ttl255.com/) 
25+
26+
匿名分享
27+
[https://anonfiles.com/](https://anonfiles.com/)
28+
29+
vscode 中文插件
30+
31+
https://marketplace.visualstudio.com/items?itemName=zhuyuanxiang.pangu-markdown-vscode
32+
33+
## 工具分析
434

535
| 名称 | 下载链接 |
636
| :----------------------------------- | :----------------------------------------------------------- |

pipeline/Jenkinsfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
pipeline {
2+
agent { node { label "master" // 执定运行节点的标签或者名称
3+
}
4+
}
5+
6+
options {
7+
timestamps() //日志会有时间
8+
skipDefaultCheckout() // 删除隐式checkout scm语句
9+
disableConcurrentBuilds() // 禁止并行
10+
timeout(time: 1, unit: 'HOURS') // 流水线超时设置1小时
11+
}
12+
13+
stages {
14+
// 下载代码
15+
stage("GetCode"){ // 阶段名称
16+
steps{ // 步骤
17+
timeout(time:5, unit:"MINUTES"){ // 步骤超时时间
18+
script{ //填写运行代码
19+
println('获取代码')
20+
}
21+
}
22+
}
23+
}
24+
// 构建
25+
stage("Build"){ // 阶段名称
26+
steps{ // 步骤
27+
timeout(time:20, unit:"MINUTES"){ // 步骤超时时间
28+
script{ //填写运行代码
29+
println('应用打包')
30+
}
31+
}
32+
}
33+
}
34+
35+
// 代码扫描
36+
stage("CodeScan"){ // 阶段名称
37+
steps{ // 步骤
38+
timeout(time:30, unit:"MINUTES"){ // 步骤超时时间
39+
script{ //填写运行代码
40+
println('代码扫描')
41+
}
42+
}
43+
}
44+
}
45+
}
46+
47+
48+
// 构建后操作
49+
post {
50+
always {
51+
scriptt{
52+
println("always")
53+
}
54+
}
55+
56+
success {
57+
script{
58+
currentBuild.description += "\n 构建成功"
59+
}
60+
}
61+
62+
failure {
63+
script{
64+
currentBuild.description += "\n 构建失败"
65+
}
66+
}
67+
68+
aborted {
69+
script{
70+
currentBuild.description += "\n 构建取消"
71+
}
72+
}
73+
}
74+
}
95.4 KB
Loading
29 KB
Loading
40.3 KB
Loading

pipeline/jenkins-share-libs.md

Whitespace-only changes.

pipeline/jenkins.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Jenkins
2+
3+
下载Jenkins的docker镜像
4+
5+
```shell
6+
docker pull jenkins/jenkins:latest
7+
```
8+
9+
为Jenkins建立挂载目录并未目录授权,我这里的目录为 /docker/data/jenkins/
10+
11+
```shell
12+
mkdir -p /docker/data/jenkins/
13+
chown -R 1000:1000 /docker/data/jenkins/
14+
```
15+
16+
17+
18+
docker-compose.yml
19+
20+
```yml
21+
version: "3.1"
22+
services:
23+
jenkins:
24+
image: jenkins/jenkins:latest
25+
container_name: jenkins
26+
restart: always
27+
ports:
28+
- '8080:8080'
29+
- '50000:50000'
30+
31+
volumes:
32+
- '/docker/data/jenkins/:/var/jenkins_home'
33+
```
34+
35+
`/var/jenkins_home` jenkins 家目录
36+
37+
![image-20230129143606705](./image/image-20230129143606705.png)
38+
39+
40+
41+
```shell
42+
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
43+
```
44+
45+
46+
47+
后面就是默认操作下载插件即可
48+
49+
50+
51+
52+
53+
插件
54+
55+
```
56+
Git Parameter
57+
Publish Over SSH
58+
```
59+
60+
61+
62+
63+
64+
把jdk 和maven 放到容器里面
65+
66+
```shell
67+
[root@pipeline-server jenkins]# cp -a /usr/local/jdk/ ./
68+
[root@pipeline-server jenkins]# cp -a /usr/local/maven/ ./
69+
[root@pipeline-server jenkins]# pwd
70+
/docker/data/jenkins
71+
[root@pipeline-server jenkins]# ls
72+
config.xml identity.key.enc jenkins.model.JenkinsLocationConfiguration.xml nodeMonitors.xml secret.key userContent
73+
copy_reference_file.log jdk jenkins.telemetry.Correlator.xml nodes secret.key.not-so-secret users
74+
hudson.model.UpdateCenter.xml jenkins.install.InstallUtil.lastExecVersion jobs plugins secrets war
75+
hudson.plugins.git.GitTool.xml jenkins.install.UpgradeWizard.state maven queue.xml.bak updates workflow-libs
76+
[root@pipeline-server jenkins]#
77+
78+
```
79+
80+
## 配置jdk
81+
82+
![image-20230129145059633](./image/image-20230129145059633.png)
83+
84+
85+
86+
87+
88+
## 配置maven
89+
90+
![image-20230129145155970](./image/image-20230129145155970.png)
91+
92+
93+
94+
95+
96+
## Jenkins 插件源
97+
98+
99+
100+
```
101+
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
102+
```
103+
104+
105+

pipeline/maven.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Jdk
22

3-
https://www.oracle.com/cn/java/technologies/javase/javase-jdk8-downloads.html
3+
[Java SE Development Kit 8 - Downloads](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
44

55
下载安装包`jdk-8u271-linux-x64.tar.gz` 并解压到`/usr/local/`并重名命名为**jdk**文件夹
66

@@ -49,7 +49,17 @@ OS name: "linux", version: "5.9.8-1.el7.elrepo.x86_64", arch: "amd64", family: "
4949
```
5050

5151
## maven仓库阿里云加速
52+
53+
54+
5255
```
56+
[root@pipeline-server conf]# pwd
57+
/usr/local/maven/conf
58+
[root@pipeline-server conf]# ls
59+
logging settings.xml toolchains.xml
60+
[root@pipeline-server conf]#
61+
##
62+
5363
<mirror>
5464
<id>aliyunmaven</id>
5565
<mirrorOf>*</mirrorOf>
@@ -58,6 +68,29 @@ OS name: "linux", version: "5.9.8-1.el7.elrepo.x86_64", arch: "amd64", family: "
5868
</mirror>
5969
```
6070

71+
72+
73+
```shell
74+
<!-- 全局JDK1.8配置 -->
75+
<profile>
76+
<id>jdk1.8</id>
77+
<activation>
78+
<activeByDefault>true</activeByDefault>
79+
<jdk>1.8</jdk>
80+
</activation>
81+
<properties>
82+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
83+
<maven.compiler.source>1.8</maven.compiler.source>
84+
<maven.compiler.target>1.8</maven.compiler.target>
85+
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
86+
</properties>
87+
</profile>
88+
```
89+
90+
91+
92+
93+
6194
## 修改默认仓库位置
6295

6396
打开maven目录 -> conf -> setting.xml

0 commit comments

Comments
 (0)