Continuous integration Gitlab执行下一阶段,即使其中一个阶段失败(具有依赖性)
我正在建立一个包含多个阶段的gitlab管道,每个阶段至少有两个站点。如何有条件地允许下一阶段继续进行,即使第一阶段中的一个站点失败(整个阶段标记为失败)?例如:我想准备、构建和测试,我想在Windows和Linux runner上完成这项工作。因此,如果我的Linux runner在准备过程中失败,但是我的Windows runner成功了,那么下一阶段应该在不构建Linux包的情况下开始,因为这已经失败了。但是windows构建应该启动 我的意图是,如果一个系统出现故障,至少第二个系统能够继续 我添加了依赖项,我认为这会解决我的问题。因为若站点“构建窗口”依赖于“准备窗口”,那个么“准备Linux”失败就无关紧要了。但事实并非如此:/Continuous integration Gitlab执行下一阶段,即使其中一个阶段失败(具有依赖性),continuous-integration,gitlab,Continuous Integration,Gitlab,我正在建立一个包含多个阶段的gitlab管道,每个阶段至少有两个站点。如何有条件地允许下一阶段继续进行,即使第一阶段中的一个站点失败(整个阶段标记为失败)?例如:我想准备、构建和测试,我想在Windows和Linux runner上完成这项工作。因此,如果我的Linux runner在准备过程中失败,但是我的Windows runner成功了,那么下一阶段应该在不构建Linux包的情况下开始,因为这已经失败了。但是windows构建应该启动 我的意图是,如果一个系统出现故障,至少第二个系统能够继
image: node:10.6.0
stages:
- prepare
- build
- test
prepare windows:
stage: prepare
tags:
- windows
script:
- npm i
- git submodule foreach 'npm i'
prepare linux:
stage: prepare
tags:
- linux
script:
- npm i
- git submodule foreach 'npm i'
build windows:
stage: build
tags:
- windows
script:
- npm run build-PWA
dependencies:
- prepare windows
build linux:
stage: build
tags:
- linux
script:
- npm run build-PWA
dependencies:
- prepare linux
unit windows:
stage: test
tags:
- windows
script:
- npm run test
dependencies:
- build windows
artifacts:
paths:
- dist/
- package.json
expire_in: 5 days
unit linux:
stage: test
tags:
- linux
script:
- npm run test
dependencies:
- build linux
artifacts:
paths:
- dist/
- package.json
expire_in: 5 days
见选项:
allow_failure允许作业失败,而不会影响CI套件的其余部分
例如:
job1:
stage: test
script:
- execute_script_that_will_fail
allow_failure: true
欢迎光临。请不要在帖子中大喊大叫,使用强调或粗体。在发布之前,您还应该打开英语拼写检查器。谢谢。在不影响CI套件其余部分的情况下,CI套件是我的重要组成部分:)