@@ -17,11 +17,11 @@ Jenkins 支持各种运行方式,可通过系统包、Docker 或者通过一
17
17
18
18
CI(Continuous integration,中文意思是持续集成)是一种软件开发时间。持续集成强调开发人员提交了新代码之后,立刻进行构建、(单元)测试。根据测试结果,我们可以确定新代码和原有代码能否正确地集成在一起。借用网络图片对 CI 加以理解。
19
19
20
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310174528.png )
20
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310174528.png )
21
21
22
22
CD(Continuous Delivery, 中文意思持续交付)是在持续集成的基础上,将集成后的代码部署到更贴近真实运行环境(类生产环境)中。比如,我们完成单元测试后,可以把代码部署到连接数据库的 Staging 环境中更多的测试。如果代码没有问题,可以继续手动部署到生产环境。下图反应的是 CI/CD 的大概工作模式。
23
23
24
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310174544.png )
24
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310174544.png )
25
25
26
26
## Jenkins 安装
27
27
@@ -98,7 +98,7 @@ Jenkins 是一个强大的 CI 工具,虽然本身使用 Java 开发,但也
98
98
99
99
General 是构建任务的一些基本配置。名称,描述之类的。
100
100
101
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310221814.png )
101
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310221814.png )
102
102
103
103
重要配置项:
104
104
@@ -111,7 +111,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。
111
111
112
112
** Source Code Management** ,即源码管理,就是配置你代码的存放位置。
113
113
114
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310222110.png )
114
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310222110.png )
115
115
116
116
- ** Git:** 支持主流的 Github 和 Gitlab 代码仓库。因我们的研发团队使用的是 gitlab,所以下面我只会对该项进行介绍。
117
117
- ** Repository URL** :仓库地址。
@@ -124,7 +124,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。
124
124
125
125
** Build Triggers** ,即构建触发器,用于构建任务的触发器。
126
126
127
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310222608.png )
127
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310222608.png )
128
128
129
129
配置说明:
130
130
@@ -138,15 +138,15 @@ General 是构建任务的一些基本配置。名称,描述之类的。
138
138
139
139
** Build Environment** ,即构建环境,配置构建前的一些准备工作,如指定构建工具。
140
140
141
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310223004.png )
141
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310223004.png )
142
142
143
143
### Build
144
144
145
145
Build,即构建。
146
146
147
147
点击下图中的 Add build step 按钮,会弹出一个构建任务菜单,可以根据实际需要来选择。
148
148
149
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310223241.png )
149
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310223241.png )
150
150
151
151
【说明】
152
152
@@ -162,11 +162,11 @@ Build,即构建。
162
162
163
163
** Post-build Actions** ,即构建后操作,用于构建完本项目的一些后续操作,比如生成相应的代码测试报告。
164
164
165
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310224106.png )
165
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310224106.png )
166
166
167
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310224254.png )
167
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310224254.png )
168
168
169
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310224331.png )
169
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310224331.png )
170
170
171
171
个人较常用的配置:
172
172
@@ -182,13 +182,13 @@ Build,即构建。
182
182
183
183
### 开始构建
184
184
185
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310224927.png )
185
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310224927.png )
186
186
187
187
如上图所示,一切配置好后,即可点击 ** Build Now** 开始构建。
188
188
189
189
### 构建结果
190
190
191
- ![ img] ( https://raw.githubusercontent.com/dunwu/images/dev /snap/20200310225234.png )
191
+ ![ img] ( https://raw.githubusercontent.com/dunwu/images/master /snap/20200310225234.png )
192
192
193
193
- ** 构建状态**
194
194
- ** Successful 蓝色** :构建完成,并且被认为是稳定的。
0 commit comments