Documentation

Unity Gaming Services CLI


GitHub Repository

Unity Gaming Services CLI


Unity Build Automation

Learn how to integrate the CLI with Unity Build Automation.
Read time 1 minuteLast updated 21 hours ago

In your Dashboard, navigate to
DevOps
>
Build Automation
>
Configurations
and create a new configuration.
In the advanced settings for your new configuration, you can set environment variables. As an example, try setting the following environment variables:

Variable

Value

UGS_CLI_PROJECT_IDyour-project-id
UGS_CLI_SERVICE_KEY_IDyour-service-key-id
UGS_CLI_SERVICE_SECRET_KEYyour-service-secret-key
In the repository you've configured for your services, create a new
.sh
file that will contain your UGS CLI commands. Then, in your new configuration's advanced settings, set a script hook with the name of the
.sh
file. There are two fields
pre-build
which lets you execute your file before building, or
post-build
which executes your file after building.
Example content for the
.sh
file:
#!/bin/bashugs --versionugs config get environmentugs statusugs env listugs deploy <directory-with-service-configurations> -j