如何解决Gitlab-Runner Shell 自动删除文件
我一直在尝试使用 gitlab-runner 和 shell 命令行使用 yml 让 CI 工作。我的测试运行和工作没有问题。我唯一的问题是,当测试结束时,测试结果会从目录中删除,我不知道为什么。当测试运行时,它存在大约一分钟,然后消失。没有显示错误。 gitlab-runner.exe --debug run
也没有显示任何有用的信息。我的代码如下。
stages:
- edit
- play
- build
unit-test:
script: C:/"Unity projects"/2019.3.0f6/Editor/Unity.exe -batchmode -projectPath=. -runTests -testPlatform editmode -logFile -testResults "./unit-tests-edit.xml" | Out-Default
stage: edit
tags:
- Desktop
play-test:
script: C:/"Unity projects"/2019.3.0f6/Editor/Unity.exe -batchmode -projectPath=. -runTests -testPlatform editmode -logFile -testResults "./unit-tests-play.xml" | Out-Default
stage: play
tags:
- Desktop
unity-build:
script: C:/"Unity projects"/2019.3.0f6/Editor/Unity.exe -batchmode -logFile -projectPath=. -executeMethod WindowsBuildScript.PerformBuild -quit
stage: build
tags:
- Desktop
据我了解,这段代码应该是正确的。我在自动构建 Unity 项目时遇到了同样的问题。在向我的项目添加更多内容后,它根本不再构建或其他东西,我不确定发生了什么。有人知道为什么文件会自动删除吗?有问题的文件是 unit-tests-edit.xml 和 unit-tests-play。我认为如果我能够解决这些问题,构建也应该正确显示。
解决方法
那是因为每个作业都有自己的 shell 环境。您需要使用 artifacts
将文件从一个作业传递到另一个作业。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。