Version: 2020.2
Sistemas de control de versiones
Using the Unity Developer Dashboard to configure Unity Cloud Build for Mercurial

Using the Unity Developer Dashboard to configure Unity Cloud Build for Git

Unity Cloud Build supports projects stored in Git repositories. Your repository can be hosted on GitHub, GitLab, Bitbucket, or private servers.

Note: This feature requires a subscription to Unity Teams Advanced. For more information, see the Unity Teams page.

This topic covers:

Configuring Git on the Dashboard

To configure Cloud Build to build your Project from a GitHub repository:

  1. Sign in to the Unity Developer Dashboard.
  2. On the Projects page, select your Project.
  3. In the dashboard Overview window, on the Cloud Build tile, click OPEN CLOUD BUILD DASHBOARD.
  4. In the Build History window, click Set up Cloud Build.

You can configure access to your repository using the following authorization protocols:

  • OAuth (default)
  • SSH

To configure Cloud Build to use OAuth to access your repository:

  1. In the Source Control window, click the GitHub, Bitbucket, or GitLab tile.
  2. Authorize access to your account as appropriate for the selected source code control service.
  3. In the Select a Repository window, choose a repository from which to build the Project and then click the NEXT: TARGET SETUP button.

Note: If you are currently signed into the source code management service, Cloud Build uses your current credentials to retrieve the repository list. To configure a Project that retrieves a repository from a different account, sign out of the source code management service first, then configure the Project.

For the next step, see the Setting up a target build platform section.

To configure Cloud Build to use SSH to access your repository:

  1. In the Source Control window, click the Manual tab.

  2. In the SCM URL field, enter the URL of your Git server in either of the following formats:

    • Non-SSL: host:port
    • SSL: ssl:host:port
  3. To connect to your repository, you must specify the URL to your Git server. For information on the format of the URL, see the URL syntax section below.

  4. From the SCM Type drop-down menu, select GIT.

  5. Click the NEXT: ACCESS button.

When Unity Cloud Build connects to the hosting site, it automatically detects whether your repository is public or private. If your repository is public, Cloud Build automatically connects to it and you can skip to Setting up a target build platform. If your repository is private, see the Using private repositoriessection.

When Unity Cloud Build connects to the hosting site, it automatically detects whether your repository is public or private. If your repository is public, Cloud Build automatically connects to it and you can skip to Setting up a target build platform.

URL syntax

To connect to your repository, you must specify the URL to your Git server. You can specify the URL to use the following protocols:

  • HTTPS
  • GIT
  • SSH

The following are examples of URLs for GitHub, bitbucket, and GitLab:

  • https://github.com/youraccount/yourrepo
  • git://github.com/youraccount/yourrepo.git
  • git@bitbucket.org:youraccount/yourrepo.git
  • git@gitlab.com:youracccount/yourrepo.git

Note: If you are hosting Git on a private server, you must use SSH to connect to your repository.

Use the format that is most convenient for you.; Unity Cloud Build automatically re-writes the URL into the format it needs.

Using private repositories

If your repository is private, Cloud Build must use SSH to connect to it. When Cloud Build detects that the repository is private, it displays the Grant us access to your source control screen.

Setting your SSH key on GitHub

To add your SSH key to your project in GitHub

  1. Sign in to GitHub.

  2. In the upper-right corner of any GitHub page, click your profile photo, then click Your profile.

  3. On your profile page, click Repositories, then click the name of your repository.

  4. In your repository, click the Settings tab.

  5. In the sidebar, click Deploy Keys, then click the Add deploy key button.

  6. In the Title textbox, type name to identify this key.

  7. In the Key field, paste in your public key from the Grant us access to your source control window, and then click the Add key button.

For more information on deploy keys, see Managing Deploy Keys in the GitHub documentation.

You can also add your SSH key to your GitHub account so that all repositories in your account are accessible to Cloud Build. For more information, see Adding a new SSH key to your GitHub account in the GitHub documentation.

Setting your SSH key on Bitbucket

To add your SSH key to your Bitbucket account:

  1. Log in to Bitbucket.

  2. Click your avatar in the lower left of the page.

  3. Click Bitbucket Settings.

  4. On the Settings page, in the SECURITY section, click SSH Keys.

  5. In SSH Keys, click the Add key button.

  6. In the Label field, enter a recognizable name for the key (such as Unity Cloud Build.)

  7. Paste the Unity Cloud Build SSH key from the Grant us access to your source control window into the Key field.

  8. Click Add Key.

On the Grant us access to your source control window, click Next: Target Setup.

Setting up a target build platform

In the dashboard, on the NEW BUILD TARGET: BASIC INFO window:

  1. In the Target Label field, enter a name for the build.

  2. If the root folder of your repository doesn’t contain your Assets and Project settings, in the Project Subfolder field, enter the URL of the folder that contains your Assets and Project settings.

  3. From the Unity Version drop-down menu, select the version of Unity with which to build the Project.

  4. If you do not want the Project to automatically build whenever your repository is updated, click the Auto-build toggle to disable this feature.

If you are building for the iOS or Android platforms, your next step is to enter credentials for the build. Click Next: Credentials. For all other platforms, click Next: Build to complete the configuration and start the initial build.

Android credentials

In the IOS SIGNING CREDS window supply the following information:

  • A Bundle ID to uniquely identify your app on the device and in Google Play Store.

  • Enter your Android keystore credentials or select Auto Generated Debug Keystore to use a development keystore. For more information on Android keystores, see Android Keystore System.

iOS Credentials

In the IOS SIGNING CREDS window supply the following information:

  • A Bundle ID to uniquely identify your app on the device.

  • The Xcode version with which to build the app.

  • Enter your IOS credentials. For more information on iOS credentials, see Building for iOS.

Using Git submodules

If your project is using private Git submodules, make sure that the URLs present in your .gitmodules file are using the git@ syntax instead of https:// or git://.

Por ejemplo:

  • git@github.com:youraccount/yourrepo.git (for GitHub)

  • git@bitbucket.org:youraccount/yourrepo.git (for Bitbucket)

  • git@gitlab.com:youracccount/yourrepo.git (for GitLab)


2018–07–16Page amended

Sistemas de control de versiones
Using the Unity Developer Dashboard to configure Unity Cloud Build for Mercurial