我想将 GitLab CI 与 .gitlab-ci.yml 文件一起使用,以使用单独的脚本运行不同的阶段。第一阶段产生一个工具,必须在稍后阶段使用它来执行测试。我已将生成的工具声明为工件。
现在我如何在后期工作中执行该工具?什么是正确的路径,它周围会有哪些文件?
例如,第一阶段构建 artifacts/bin/TestTool/TestTool.exe 并且该目录包含其他所需的文件(DLL 和其他文件)。我的 .gitlab-ci.yml 文件如下所示:
releasebuild:
script:
- chcp 65001
- build.cmd
stage: build
artifacts:
paths:
- artifacts/bin/TestTool/
systemtests:
script:
- chcp 65001
- WHAT TO WRITE HERE?
stage: test
如果相关,构建和测试将在 Windows 上运行。
最佳答案
使用 dependencies
.使用此配置测试阶段将下载在构建阶段创建的未跟踪文件:
build:
stage: build
artifacts:
untracked: true
script:
- ./Build.ps1
test:
stage: test
dependencies:
- build
script:
- ./Test.ps1
关于gitlab - 如何将工件传递到另一个阶段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38140996/