docker image with unity for windows for CI with webgl support
84
Start the docker container like this:
docker run -v [some directory on the host]:C:/source --hostname [use a constant hostname for the docker containter] --name [the container name] -d --mac-address [use a constant mac-address] dominicullmann/unityciwin:2019.3.7f1
Connect to the container using the following:
docker exec -it buildenv powershell.exe
Follow then these steps:
Use manual activation to activate unity first (see https://docs.unity3d.com/Manual/ManualActivationGuide.html): C:\Tools\Unity\Editor\Unity.exe -batchmode -createManualActivationFile -logfile "C:\source\logActivationFileCreation"
Upload the Unity_v2019.3.7f1.alf file to https://license.unity3d.com/
And download the ulf file and ensure that it's availabie in the docker container as part of C:\source.
Then activate unity (must be done everytime a new container is created): C:\Tools\Unity\Editor\Unity.exe -batchmode -manualLicenseFile C:\source\Unity_v2019.x.ulf -logfile "C:\source\logActivation"
Create Build directory: mkdir C:\source\[build path]
Build: C:\Tools\Unity\Editor\Unity.exe -batchmode -nographics -logFile C:\source\unityBuild -quit -customBuildName WebGL -projectPath C:\source\[path to unity game] -buildTarget WebGL -customBuildTarget WebGL -customBuildPath C:\source\[build path] -executeMethod UnityBuilderAction.CustomBuilder.BuildProject
Note that the example above uses a custom builder. You can use e.g. the following as example for this: https://github.com/webbertakken/unity-builder/blob/master/action/default-build-script/Assets/Editor/Builder.cs
Content type
Image
Digest
Size
9.6 GB
Last updated
over 6 years ago
docker pull dominicullmann/unityciwin:2019.3.7f1