【发布时间】:2020-06-27 23:04:26
【问题描述】:
我正在使用 Gitlab CI 来自动化我的统一构建。为此,我使用两台机器。 (一台 Mac 和一台 windows 机器。重要提示:构建应该只在第一台可用的机器上运行。)
unity-build:
script: "/Applications/Unity/Hub/Editor/2019.3.14f1/Unity.app/Contents/MacOS/Unity \
-projectPath pathXY \
-executeMethod BuildScript.PerformBuild
-quit"
stage: build
tags:
- unity-mac-runner, unity windows runner
有问题的行是:脚本:“/Applications/Unity/Hub/Editor/2019.3.14f1/Unity.app/Contents/MacOS/Unity,因为在我的 Windows 运行器上,统一路径是“S:\Unity\ 2019.3.14f1\Editor\Unity.exe" \
尝试通过以下更改来解决此问题:
windows job:
stage: setpaths
variables:
UNITY_PATH: "S:/Unity/2019.3.14f1/Editor/Unity.exe"
script: "set windows variables..."
tags:
- unity windows runner
#osx job:
# stage: setpaths
# variables:
# UNITY_PATH: "S:/Unity/2019.3.14f1/Editor/Unity.exe"
# script: "set mac variables..."
# tags:
# - unity-mac-runner
问题
- 我该怎么做?我应该使用什么?
- 我尝试根据构建运行器设置统一安装路径,但无法正常工作。
举个例子就好了。非常感谢 ;)
对 config.toml 解决方案的补充:我在 Windows 上遇到了这个问题(Mac 运行时没有问题。
In C:\WINDOWS\TEMP\build_script782418789\script.ps1:185 Zeichen:15
+ ${UNITY_PATH} -batchmode -projectPath ${BUILD_PROJECT_PATH} -runTests ...
+ ~~~~~~~~~~
Unerwartetes Token "-batchmode" in Ausdruck oder Anweisung.
In C:\WINDOWS\TEMP\build_script782418789\script.ps1:185 Zeichen:26
+ ${UNITY_PATH} -batchmode -projectPath ${BUILD_PROJECT_PATH} -runTests ...
+ ~~~~~~~~~~~~
Unerwartetes Token "-projectPath" in Ausdruck oder Anweisung.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
ERROR: Job failed: exit status 1
表达式或语句中出现意外的标记...。
这是我在 Windows 上的 config.toml:
executor = "shell"
shell = "powershell"
environment = [
"UNITY_PATH=S:/Unity/2019.4.1f1/Editor/Unity.exe",
"BUILD_PROJECT_PATH=S:/Gitlab-runner/builds/QZ5_yEjt/0/FussballManager/Game",
"UNITY_BUILD_PATH=S:/Gitlab-runner/builds/QZ5_yEjt/0/FussballManager/Game/WindowsBuild/"
]
【问题讨论】:
标签: unity3d continuous-integration gitlab gitlab-ci gitlab-ci-runner