|
@@ -11,7 +11,7 @@ Jenkins 会根据根目录中的 [Jenkinsfile](./Jenkinsfile) 进行自动编译
|
|
|
|
|
|
推荐 vscode 插件:[JenkinsFile Support](https://marketplace.visualstudio.com/items?itemName=ivory-lab.jenkinsfile-support)
|
|
推荐 vscode 插件:[JenkinsFile Support](https://marketplace.visualstudio.com/items?itemName=ivory-lab.jenkinsfile-support)
|
|
|
|
|
|
-#### 构建一个 Jenkins 多分支项目
|
|
|
|
|
|
+### 构建一个 Jenkins 多分支项目
|
|
|
|
|
|
1. 在 Jenkins 中创建一个 Jenkins 多分支项目
|
|
1. 在 Jenkins 中创建一个 Jenkins 多分支项目
|
|
2. 在 Jenkins 中填入必要的信息
|
|
2. 在 Jenkins 中填入必要的信息
|
|
@@ -22,10 +22,12 @@ Jenkins 会根据根目录中的 [Jenkinsfile](./Jenkinsfile) 进行自动编译
|
|
3. 在项目中创建并编辑 Jenkinsfile
|
|
3. 在项目中创建并编辑 Jenkinsfile
|
|
4. 添加凭据对应协作人和应有权限
|
|
4. 添加凭据对应协作人和应有权限
|
|
5. 在 Jenkins 中点击扫描和构建并尝试构建
|
|
5. 在 Jenkins 中点击扫描和构建并尝试构建
|
|
-6. 测试 webhook 推送 (触发构建或者扫描日志时间改变就可以了)
|
|
|
|
|
|
+6. 在项目中添加 webhook
|
|
|
|
+7. 测试 webhook 推送 (触发构建或者扫描日志时间改变就可以了)
|
|
|
|
|
|
-#### 注意事项
|
|
|
|
|
|
+### 注意事项
|
|
|
|
|
|
- 如果只是要测试微调后 Jenkinsfile 可以用 Jenkins 的回放功能(点击具体构建,左边),然后再放进项目里,这样就不用一直 commit push
|
|
- 如果只是要测试微调后 Jenkinsfile 可以用 Jenkins 的回放功能(点击具体构建,左边),然后再放进项目里,这样就不用一直 commit push
|
|
- 对当前分支的 Jenkinsfile 更新不会影响到其他分支,在开发或者测试分支可以不用担心影响生产
|
|
- 对当前分支的 Jenkinsfile 更新不会影响到其他分支,在开发或者测试分支可以不用担心影响生产
|
|
-- 对 Jenkinsfile 的改动尽量独立为一个commit, 方便 git cherry-pick 合并单一commit到其他需要的分支
|
|
|
|
|
|
+- 对 Jenkinsfile 的改动尽量独立为一个commit, 方便 git cherry-pick 合并单一commit到其他需要的分支
|
|
|
|
+- 多节点下尽量不要使用 agent any,鬼知道在哪执行去了
|