Skip to main content

From the very beginning of the Govt.nz project, we've been planning to open source our code. We're very happy to announce that we've just made our first open source release — which includes a module we're really excited about called Replicant.

You can find all our open source code on GitHub. If you've got feedback, technical questions or comments, leave them in the comments and one of our developers will get back to you.

For those not in the know, here's a very basic intro to open source and our first release...

What is open source?

Basically, the code used to build something is released to the public. Interested parties can take a copy of the code and reuse it in their own projects.

They can build on it, change it or just use it as-is. If they make changes, they can offer them back to the original developers, who can choose whether or not to include them in the original code.

Our site runs on the Common Web Platform (CWP), which uses several open source systems, including the SilverStripe content management system.

What we're releasing

Our first release includes a little thing we've named Replicant.

What Replicant does

Currently, there's no easy way in SilverStripe to copy between databases.

For example, our content editors edit on the live site, while the developers develop on 'dev' and the testers test on 'test' (try saying that ten times fast). This means we're adding content to the site that doesn't appear in other environments. To make dev and test match live, we have to ask SilverStripe to copy between databases for us.

With Replicant, we can take a copy of our entire live site and restore it in other environments, so we're always building and testing on the latest version. It's much quicker, and we can do it all ourselves.

How do we think this will be useful to others?

We think Replicant could be useful to anyone running SilverStripe who has multiple environments they develop and deploy on. Install it on your SilverStripe site and you'll be able to copy a database from one environment to another with just a couple of clicks.

Replicant uses a collection of different open source components, some of which you can use on their own. When you install Replicant, the installer will work out what you need and download the necessary bits and pieces.

Contributing to Replicant

If people expand or change our code, or fix any bugs, they can ask us to incorporate their changes into the main version of Replicant.

Our future plans

Our team are identifying other SilverStripe modules we've written for beta.govt.nz that we can open source. We’re looking at two modules in particular — one that works with Google Analytics, and one that makes improvements to the back-end CMS interface.

We've also been expanding on the existing SilverStripe RestfulServer module while building our API — we're planning on contributing that work back to SilverStripe once it's finished.

Utility links and page information