automating builds with jenkins and unity · automating builds with jenkins and unity sebastian...

12
Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Upload: others

Post on 06-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Automating builds with Jenkins and UnitySebastian Dorda

GameDev Tech Talk

16.01.2016

Page 2: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Build automation is … … the process of automating the creation of a software build and the associated

processes including:

compiling computer source code into binary code,

packaging binary code

running automated tests.

(Wikipedia)

Page 3: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Why? Manually creating a build/release is boring and takes a lot of time

-> let the machine do the work

Documented process

Everybody can trigger it

Error checks and tests that nobody can forget to run

Collect statistics

History

Standards (improve communication, easier onboarding)

Page 4: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

The Exiled Tiny MMO

PC (win/linux/osx)

Unity Client

Photon Server

Formerly known as Das Tal

Page 5: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Jenkins Open source

Java

Tons of plugins

Runs on windows too

Formerly known as Hudson

Page 6: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

A build in The Exiled consists of Client PC

Windows

Linux

OSX

Patcher PC Windows

Linux

OSX

Server + Tests

Data LUA script files + Checks

Ini csv files

Translation

Map files

Deploy Upload Clients/Patchers/Servers/Data

Upload Translation

Upload Steam

Restart Servers

Page 7: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016
Page 8: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

das-tal-master-client-win Checkout git master branch

Run scripts/build-pre-bash.sh script to store commit, version, date into BuildInfo.cs sed -i "s/_COMMIT_/$MY_COMMIT/" client/Assets/Plugins/Code/Common/BuildInfo.cs

Run scripts/build-win-client.bat rmdir /S /Q builds

mkdir builds"%UNITY%" -nographics -quit -batchmode -projectPath "%CD%\client" -logFile"%CD%\build_client.log" -executeMethod BuildFromCommandLine.RunWin

Run scripts/build-post-client-win.sh SEVENZIP=7z

pushd builds/${MY_PLATFORM}$SEVENZIP a ../../zips/client-${MY_PLATFORM}.zip client

Send notifications

Page 9: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Issues Jenkins git checkout via ssh with key

-> local mirror of the repository (cron) + local checkout

Don‘t forget to backup the job xml files

No bash-> cygwin (Execute shell step)#!C:\cygwin64\bin\bash.exeexport PATH=$PATH:/usr/bindos2unix scripts/build-pre-bash.shbash -ex scripts/build-pre-bash.sh

Too many unity instances running-> Block Queued Job PluginJenkins Exclusion Plug-in

Page 10: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Issues Unity serial in case of VM without real graphic card

-> Unity has a command line flag to activate license key

Execute CS in the build process-> Unity can run static methods from cmdline„-executeMethod MyClass.MyMethod“

Executable flags for linux/osx broken-> chmod 777 builds/linux/client/exiled*.x86chmod 777 builds/linux/client/exiled*.x86_64

Where is the output log-> „-logFile "%CD%\build_client.log“

Page 11: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Future Automate UnityTestTools for client tests

Automate feature branches

Try Unity Cloud Build

Page 12: Automating builds with Jenkins and Unity · Automating builds with Jenkins and Unity Sebastian Dorda GameDev Tech Talk 16.01.2016

Thanks Sebastian Dorda

[email protected]

@schattenkindnet

http://www.the-exiled.co/