Vla*_*ezy 6 yaml gitlab gitlab-ci
这是我的 yml 文件:
stages:
- testing
- deploy
docker_job:
stage: testing
tags:
- docker
image: atools/chrome-headless:java11-node14-latest
before_script:
- npm ci
- npx playwright install
- npm install allure-commandline --save-dev
script:
- npm run BookingTestDEV --project=BookingTesting
- npx playwright test --project=BookEngineTests
- npm run BookingTestNEO --project=BookingTesting
after_script:
- npx allure generate allure-results --clean
rules:
- when: always
allow_failure: true
artifacts:
when: always
paths:
- ./allure-report
expire_in: 7 day
pages:
stage: deploy
script:
- mkdir public
- mv ./allure-report/* public
artifacts:
paths:
- public
rules:
- when: always
Run Code Online (Sandbox Code Playgroud)
如果第一个脚本 - npm run BookingTestDEV --project=BookingTesting 失败,其他脚本将被跳过,如何运行它们?有没有 if(): 类似的类似 github 上的东西?
小智 8
在大多数情况下,如果其中一个命令抛出不为 0 的退出代码,管道就会失败。但是,在某些情况下,其余命令无论如何都应该运行。 || true一个可能的解决方案是在命令末尾添加。
例如:
script:
- npm run BookingTestDEV --project=BookingTesting || true
- npx playwright test --project=BookEngineTests
- npm run BookingTestNEO --project=BookingTesting
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4065 次 |
| 最近记录: |