Skip to main content

Using the CLI in a CI/CD pipeline

Because you can't login using the web browser authentication method, you need to provide your CLI with a service account, to request an IMS Service Account please contact your account manager.

Your service account details will include:

  • oauth-client-id - ID of the IMS Authentication Service OAuth 2.0 client which was created for your organization
  • oauth-client-secret - Secret of the OAuth 2.0 client
  • refresh-token - Refresh token for your IMS Service Account which provides access to your project

You can provide these values to the CLI using environment variables or using a config file.

Simply set the environment variables:

  • IMS_OAUTH_CLIENT_ID
  • IMS_OAUTH_SECRET
  • IMS_OAUTH_REFRESH_TOKEN
  • CI - set this to true (done for you by default on most CI providers)

Config file

If you wish to use a config file rather than environment variables you can store your OAuth details in a config file like so:

# config.yaml
ci: true
oauth-client-id: YOUR_OAUTH_CLIENT_ID
oauth-secret: YOUR_OAUTH_SECRET
oauth-refresh-token: YOUR_OAUTH_REFRESH_TOKEN

You have to provide a path to a config.yaml for every CLI command you run if you are running in a CI environment using the --config flag, for example:

ims image publish --project-id my-project --description "Initial Simplayers" --version "v0.0.1" --directory ./path/to/game/assets/ --config ~/.ims/ims-image-manager/config.yaml