Who we are

We are the developers of Plastic SCM, a full version control stack (not a Git variant). We work on the strongest branching and merging you can find, and a core that doesn't cringe with huge binaries and repos. We also develop the GUIs, mergetools and everything needed to give you the full version control stack.

If you want to give it a try, download it from here.

We also code SemanticMerge, and the gmaster Git client.

Connect Unity Cloud Build to Plastic Cloud

Thursday, March 21, 2019 Ma Nu 0 Comments

UPDATE (09/10/2020): Cloud Build is now officially supported!

UPDATE (07/21/2020): We are super excited to share Unity has added native support for Plastic SCM at the Unity Cloud Build system, more information here: https://docs.unity3d.com/Manual/UnityCloudBuildVcsPlastic.html


This blog post explains how to build your Unity project stored inside a Plastic Cloud Edition repository.

Unity Cloud Build does not provide native support to download code from Plastic, but it is possible to take advantage of the Plastic ability to synchronize with Git to solve the problem.

We explain how to use GitLab as an intermediate storage for Plastic repos so that Unity Cloud Build can access them.

What the workflow looks like

The workflow is simple—all the development will take place inside Plastic SCM.

Developers and artists will work together using the same repository and one day they will ship a cool game.

To achieve this, the game has to be properly built and tested multiple times before the release date. And, that's where Unity Cloud Build enters the scene.

Use GitLab as the intermediate storage

Unity Cloud Build provides a great platform to build and test the game; the only issue is you can't connect it to Plastic SCM (yet!).

We will use GitLab, GitHub, Bitbucket or any other Git hosting service as a bridge between Plastic Cloud and Unity Cloud Build.

Every time the team needs a new build, they will synchronize the Plastic Cloud repository with the Git cloud repository. This action triggers a new Unity build because Unity Cloud is constantly checking for new changes to appear.

Let's review it in depth.

Use GitSync to push from Plastic to a Git repo

Plastic supports the GitSync feature.

GitSync allows the Plastic SCM user to sync a Plastic repository with a Git hosted repository.

We will use GitSync to push the Plastic SCM changes to the Git hosting service to trigger builds for Unity Cloud Build.

GitLab

I chose GitLab as the bridge between Plastic SCM Cloud and Unity Cloud Build because this is what one of our customers suggested. They are actually using this setup. They are using a Free intermediate GitLab repo to achieve it.

The following figure shows how you can create a free private repo to send your projects to Unity Cloud Build.

A few remarks: it is mandatory to initialize an empty Git repository; skip adding any gitignore, readme or license files since the Git repository will synchronize with the Plastic SCM repo, which already contains all the data and history needed.

Unity Cloud Build

Unity Cloud Build needs to know where the Unity project is hosted; select Gitlab as the data source:

Provide the Gitlab credentials and select the repository that contains the Unity game:

Finish the configuration defining the build target information. Here, you can specify the branch to track for new changes.

The example shows master as the branch that will trigger changes once new changes appear on it:

Trigger a new build

Now that Unity Cloud Build is monitoring the "master" branch, it's time to make it work.

To trigger a new build, we need to GitSync the Plastic repo to GitLab.

You can use either the GUI or the CLI to execute the Gitsync operation. The CLI allows the teams to schedule periodic and automatic syncs operations from a headless machine. Check what the GitSync command looks like:

cm sync default@myORG@cloud git git://URL/to/repository

The Plastic GUI allows you to do it even from Unity.

Open the Branch Explorer (the action is inside the "Version control" view). From the Branch Explorer, select any of your branches and select "Replication -> Sync with Git". This will synchronize the entire Plastic SCM repository with the Git repository. It doesn't matter which branch you choose to run the operation; the GitSync operation applies to all the repository at once.

As soon as the Plastic SCM changes reach the GitLab repository, Unity Cloud Build will notice it; that will result in a new build operation:

That closes the ring; your Unity game can be built at Unity Cloud in just two clicks! :)

Why not use GitLab directly then?

You might wonder: ok, if I already have my repos in GitLab, why shouldn't I simply skip Plastic altogether and just keep my projects in Git?

This is exactly what we asked of the team that told us they were working this way; and this is what they told us about why they use Plastic SCM:

  • It's much easier to create and update branches.
  • It's visual and makes tracking changes much faster.
  • The automatic merge does a great job.
  • You can see what's going on in the project in seconds.
  • Big files support, for real; no patches or workarounds.

We are sure you will also find some of the topics above interesting to use for your next game development :-)

Manuel Lucio
I'm in charge of the Customer Support area.
I deal with complex setups, policies and working methodologies on a daily basis.
Prior to taking full responsibility of support, I worked as software engineer. I have been in charge of load testing for quite some time, so if you want to know how well Plastic compares to SVN or P4 under a really heavy load, I'm your guy.
I like to play with Arduino GPS devices, mountain biking and playing tennis.
You can find me hooked to my iPhone, skate-boarding or learning Korean... and also here @mrcatacroquer.

0 comentarios: