Cloud Build supports projects stored in Git repositories. Your repository can be hosted on GitHub, GitLab, Bitbucket, or private servers.
This topic covers:
To configure Cloud Build to build your Project from a GitHub repository:
You can configure access to your repository using the following authorization protocols:
To configure Cloud Build to use OAuth to access your repository:
Note: Cloud Build uses your current credentials to retrieve the repository list if you are currently signed into the source code management service. 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 Setting up a target build platform.
To configure Cloud Build to use SSH to access your repository:
In the Source Control window, click the Manual tab.
In the SCM URL field, enter the URL of your Git server in either of the following formats:
To connect to your repository, you must specify the URL to your Git server. For information on the format of the URL, see URL syntax. Note: If you are hosting Git on a private server, you must use SSH to connect to your repository.
From the SCM Type drop-down menu, select GIT.
Click the NEXT: ACCESS button.
When 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 repositories section.
To connect to your repository, you must specify the URL to your Git server. You can specify the URL to use the https:// protocol.
Note: Git has depricated the git:// URL. If you are connecting via SSH, there are new security steps. See Improving Git protocol security on GitHub for more information.
The following are examples of URLs for GitHub, bitbucket, and GitLab:
Note: If you are hosting Git on a private server, you must use SSH to connect to your repository.
Unity Cloud Build automatically re-writes the URL into the format it needs.
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.
To add your SSH key to your project in GitHub:
Sign in to GitHub.
In the upper-right corner of any GitHub page, click your profile photo, then click Your profile.
On your profile page, click Repositories, then click the name of your repository.
In your repository, click the Settings tab.
In the sidebar, click Deploy Keys, then click the Add deploy key button.
In the Title textbox, type name to identify this key.
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.
To add your SSH key to your Bitbucket account:
Log in to Bitbucket.
Click your avatarAn interface for retargeting animation from one rig to another. More info
See in Glossary in the lower left of the page.
Click Bitbucket settings.
On the Settings page, in the SECURITY section, click SSH Keys.
In SSH Keys, click the Add key button.
In the Label field, enter a recognizable name for the key (such as Unity Cloud BuildA continuous integration service for Unity projects that automates the process of creating builds on Unity’s servers. More info
See in Glossary.)
Paste the Unity Cloud Build SSH key from the Grant us access to your source control window into the Key field.
Click Add Key.
On the Grant us access to your source control window, click Next: Target Setup.
In the dashboard, on the NEW BUILD TARGET: BASIC INFO window:
In the Target Label field, enter a name for the build.
If the root folder of your repository doesn’t contain your Assets and Project settingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
See in Glossary, in the Project Subfolder field, enter the URL of the folder that contains your Assets and Project settings.
From the Unity Version drop-down menu, select the version of Unity with which to build the Project.
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.
In the SIGNING CREDS window, provide the following information:
A Bundle ID to uniquely identify your app on the device and in Google Play Store.
Enter your Android keystoreAn Android system that lets you store cryptographic key entries for enhanced device security. More info
See in Glossary credentials or select Auto Generated Debug Keystore to use a development keystore. For more information on Android keystores, see Android Keystore System.
In the iOS SIGNING CREDS window provide 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.
If your project uses private Git submodules, make sure that the URLs present in your .gitmodules file uses the git@
syntax instead of https://
.
For example:
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
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.