2 min read

Mirroring Github to Stash behind the firewall

JB
Jon Bevan
Tue, 7 Apr 2015
Mirroring Github to Stash behind the firewall

Mirroring Github to Stash behind the firewall

 

Many teams rely on GitHub for server builds and infrastructure management. But have you thought about what happens if GitHub is unreliable or unavailable?

At Adaptavist we make heavy use of Puppet. It's great for automating everything from building Bamboo agents, to creating and managing the servers that run Atlassian applications, and even supporting infrastructure. The diversity of the servers that we build means we have a large number of Puppet modules to manage, maintain and track. As part of module management we use Puppet Librarian which allows us to use only the modules we need.

You might be wondering why I'm telling you all this. Well, it means that we rely on GitHub for building our servers. Or, rather, we did until GitHub came under a huge distributed denial of service attack last week.

GitHub is great until

On Monday 30th March we had no build agents and each attempt to build one failed as GitHub started to block us as part of its self-defence strategy. We needed to remove our reliance on GitHub and do it fast.

Mirroring GitHub to Stash

Since we already have our own Stash instance and many of our Puppet modules are already hosted on Stash, it made sense to move all our modules to the same server. Incidentally this is a problem that many of our customers have: namely, how to use source on GitHub and behind the firewall.

As it happens we are currently working on an Add-On for Stash. One of its features is to allow us to mirror all of the repositories in our Adaptavist GitHub organisation into our Stash. We can then keep them up do date by installing a hook into GitHub.

More resilient repos

This means that when anything changes in the upstream GitHub repository we're able to see the changes almost instantly in Stash. This way we can continue to pull in changes from GitHub and contribute back and be constantly mirrored.

Once we had all the repos in Stash it was a simple case of updating all the affected Puppet files and we were back in business. We've included a screenshot of the configuration below.

If you need help mirroring GitHub for more resilience or you want to know more about our new Stash Add-On contact us today.


Stay up to date by signing up for monthly Adaptanews