Create builds

Upload build information to enrich releases in your BugSnag dashboard. See Releases & versions for feature information.

For installation instructions for the BugSnag CLI, please see our Installation guide.

Overview

The create-build command wraps the Build API to provide an easy way to send extra data about your releases.

If you run the command from inside the top-level of a Git repository, the first remote URL and commit hash will be used for the source control parameters unless provided by the --provider, --repository or --revision options.

Example Usage

You can create a build using your API key and the version of the release:

$ bugsnag-cli create-build --api-key=YOUR_API_KEY --app-version=1.0.2

Available options

API key (--api-key)

Your project’s API key. Required.

You can find your API key in Project Settings from your BugSnag dashboard.

Build API root URL (--build-api-root-url)

The BugSnag On-premise build server hostname, optionally containing port number. The command will append the appropriate path to access the BugSnag API build endpoint.

Builder name (--builder-name)

The name of the person or entity who built the app. Defaults to the current username (whoami).

Bundle version (--bundle-version)

The bundle version of this build of the app. iOS/macOS/tvOS/watchOS only.

Log Level (--log-level)

Used to set the level of the logging. The available levels are debug, info, warn, and fatal. The default level is info.

Metadata (--metadata)

Custom build information to be associated with the release on your BugSnag dashboard. For example build configuration parameters, versions of dependencies or the reason for the build.

Metadata is specified as a comma-separated list of key-value pairs:

--metadata=key1=value,key2=value2

Provider (--provider)

The source control provider name of your project. This is used to help link events on your BugSnag dashboard to source code, for supported source control tools. If the value can be inferred from the repository URL then this option is not required.

Accepted values:

  • github
  • github-enterprise
  • bitbucket
  • bitbucket-server
  • gitlab
  • gitlab-onpremise

Release stage (--release-stage)

The release stage (eg, production, staging) that is being released.

Repository (--repository)

The URL of the repository containing the source code being deployed. For example, “https://github.com/owner/repo”. This is used to help link events on your BugSnag dashboard to source code, for supported source control tools. If you run the command from inside the top-level of a Git repository, the first remote URL will be set as the default value.

Retries (--retries)

The number of retry attempts before failing an upload. By default it is only attempted once.

Revision (--revision)

The source control SHA-1 hash for the code that has been built (short or long hash). This is used to help link events on your BugSnag dashboard to source code, for supported source control tools. If you run the command from inside the top-level of a Git repository, the current revision will be set as the default value.

Timeout (--timeout)

The number of seconds to wait before failing an upload attempt. By default the upload is given 300s (5 mins).

Version code (--version-code)

The version code of this build of the app. Android only.

Version name (--version-name)

The version of the app. Required.

Verbose (--verbose)

Used to set the level of the logging to its highest. This is the equivalent of setting log-level to debug.