Linking Managed Projects with your Git Server using Altium Concord Pro
There’s been a bit of chatter on the forums lately discussing linkages between managed projects within Altium Concord Pro, and version control using external Git servers (such as GitHub or Bitbucket). In this article, we will be taking a closer look at the backend of Altium Concord Pro’s managed project system and how we can link back to your Git server.
Altium Concord Pro Managed Projects: A Closer Look
Historically, the Altium Vault—which eventually became Altium Concord Pro—used Subversion (SVN) for its managed projects. This meant an SVN client ran in the background and did all the committing for you. SVN has been widely used as a version control system for ECAD designers and was also the backbone for Mentor Graphics PADS Archrive Management as well. As Altium started to support Git as a Version Control System (VCS), the Altium Concord Pro team migrated to a Git server for the Managed Projects back end.
When you create a project in Altium Concord Pro, you will discover that a new “.git” address has been assigned to the repository. This can be viewed in the project details like so:
Just like one would have with a software project, each PCB design project contains its own Git repository. For example, if you have 100 managed projects within your Altium Concord Pro server, then Altium Concord Pro has created 100 unique Git repositories to host these projects. One can manually view each Git address via the project details (see above), or a list of repositories can be retrieved via the Altium Concord Pro (Vault) SDK. A third method (though the most convoluted) is to retrieve the list of repository GUIDs via the Firebird Database, like so:
Now that we have a better understanding on how the Managed Projects work and where they live within Altium Concord Pro, let’s review a standard workflow using an external Git server.
Using Third Party Git Servers with Altium Concord Pro
By now, many people have been exposed to the Git integration feature of Altium Designer. Most PCB design software files are in binary, which means they do not play well with Git. Realizing that Git was becoming more popular, the software development team took the plunge to start supporting a native Git client within Altium Designer—which includes many bug improvements and features in the latest version, Altium Designer 20.
There is an option in Altium Concord Pro to add your own Git repositories so they show up as a managed project location:
I found this to be a bit cumbersome, as it requires you to set up a single Git repository at a time. If you are using one Git repository per project, this can blow up into a very messy operation. A different route would be to manage your projects externally, such as via GitHub or Bitbucket and ditch Altium Concord Pro Managed Projects altogether. This is the method many take: using Altium Designer in conjunction with GitHub (or other Git servers). A lot of work has been done on the Managed Projects, end and the internal hooks between Altium Concord Pro and its Git server should be leveraged (especially if you’re looking to automate things via the SDK). So how can we continue to use our corporate Git server (where we store everything else), yet still leverage all the work done by Altium Concord Pro?
The Missing Link
A lot of the folks I’ve met on the forums or in person have complained that maintaining two servers (Altium Concord Pro Managed Projects and a Git server such as GitHub) is too difficult, so they opt out of Managed Projects within Altium Concord Pro completely. This, to me, seems like such a shame as there is quite a simple “hack” that will link the two together. The backbone of this hack is to use a “Git push --mirror” command to push all content from the Altium Concord Pro Git server to your Git server of choice. The simplest form of this would be to issue the following sample command after every commit and push:
Git push --mirror <address of Git repo on your Git server>
You can now turn this into a script that runs on time intervals or using a polling scheme. You can also iterate over all repositories (see above) and run the same script for each repository. To make it easier I created a task in Bamboo to poll my Altium Concord Pro server every 60 seconds. If it detects a change in that specific repository then it automatically mirrors the latest commits to my Bitbucket repository using the same name as my bamboo project (hence the Bamboo variable bamboo.ShortPlanName).
Conclusion
With the new adoption of Git for PCB design, Altium Designer and Altium Concord Pro have followed the trend. Altium Designer now supports Git client integration as a VCS, and Altium Concord Pro uses a Git server as the backbone of its managed projects. For people who like to maintain their company’s Git server, the solution to “mirror” the Managed Projects into the corporate Git server has been proposed as an option in this article. Using this mirroring technique, one can leverage all the heavy lifting done in Altium Concord Pro and continue to use their company’s existing infrastructure.