我一直在尝试使用 Gitlab CI 容器从 Ubuntu 映像构建 Unity3D 的几种方法,但似乎总是失败(Ubuntu 16.04.3 LTS)。
我收到以下错误,但我没有在那里找到有用的信息:
$ /opt/Unity/Editor/Unity -batchmode -nographics -silent-crashes -logFile ./unity.log -projectPath ./ -buildLinuxUniversalPlayer "./Build/linux/project" -quit
[0101/202644:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
该沙盒开发被标记为已弃用,我在这里缺少什么?
除此之外,当我尝试获得 chrome-sandbox 的帮助时,我得到以下信息:
$ /opt/Unity/Editor/chrome-sandbox --help
The setuid sandbox provides API version 1, but you need 0
Please read https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment.
close: Bad file descriptor
正如我在 Unity Cloud Build 平台中看到的,他们使用 MacOS 系统进行构建,我们在 GitLab CI(云服务)中有这个替代方案吗?Unity Cloud Build 的日志行:
42: + Building with Unity installed at /UNITY_PATH/Unity/Unity-2017_2_1f1/Unity.app/Contents/MacOS/Unity
更新:
我添加了我的 gitlab-ci.yml:
image: ubuntu
before_script:
- apt-get update
- apt-get install wget < wget.txt
- wget -q -O unity.deb http://beta.unity3d.com/download/fd37f3680b5f/unity-editor_amd64-2017.2.0b11.deb
- ls -la
- apt-get install gdebi < gdebi.txt
- gdebi --n unity.deb
stages:
- build
- log
windows:
stage: build
script:
- echo "Attempting to build for Windows"
- /opt/Unity/Editor/Unity -batchmode -nographics -silent-crashes -logFile $(pwd)/unity.log -projectPath $(pwd) -buildWindowsPlayer "$(pwd)/Build/windows/GameTest.exe" -quit
macos:
stage: build
script:
- echo "Attempting to build for OS X"
- /opt/Unity/Editor/Unity -batchmode -nographics -silent-crashes -logFile $(pwd)/unity.log -projectPath $(pwd)-buildOSXUniversalPlayer "$(pwd)/Build/osx/GameTest.app" -quit
linux:
stage: build
script:
- echo "Attempting to build for Linux"
- /opt/Unity/Editor/Unity -batchmode -nographics -silent-crashes -logFile $(pwd)/unity.log -projectPath $(pwd) -buildLinuxUniversalPlayer "$(pwd)/Build/linux/GameTest" -quit
log:
stage: log
script:
- echo 'Logs from build'
- cat ./unity.log