[author: alex]
Disclaimer: This post is in no way endorsed by Atlassian. For more information on Stash, please visit Atlassian.
Since the launch of the Jidoteki beta, we’ve been trying to find ways to show people what it does, how it works, and how it can be useful. Today, we will show by example.
I’m going to demonstrate how we used Jidoteki to create an easy to distribute virtual appliance containing Atlassian’s Stash.
Why Stash?
For those who are not familiar with Stash, it’s basically a downloadable version of Bitbucket. Atlassian created it to help people use their own self-hosted version of Bitbucket. I guess you can say it’s similar to GitHub Enterprise, but affordable enough for small teams.
Stash, unlike GitHub Enterprise, is actually just a standalone Java application. This means getting up and running with Stash might require you to:
In all honesty, it’s not that difficult, but there’s still way more steps compared to GitHub Enterprise:
Using Jidoteki
Ironically, we published this example’s source code, scripts, puppet manifests, etc on our GitHub account.
To start, we created a Debian 7.1.0 OS image using a custom preseed:
You can download the preseed from here:
https://github.com/unscramble/jidoteki-examples/blob/master/atlassian-stash/installation/preseed.cfg
Customizing the OS
Once our Debian OS was fully installed (after only 6 minutes), we then proceeded to provision it with some custom Puppet manifests we created.
We simply provided a URL for our provisioning / bootstrapping script, and then a URL of the entire compressed Git repository. Jidoteki will download both files onto the custom installed OS, and then run the provisioning script.
You can see the provisioning script, and Puppet manifests here:
https://github.com/unscramble/jidoteki-examples/tree/master/atlassian-stash
Downloading the virtual appliance
That’s all! Now we can download the virtual appliance and run it on our own servers. Jidoteki allows you to build virtual appliances that run on Xen, KVM, VMware, Virtualbox, and even Hyper-V. It can export images as .OVA files and Vagrant .boxes for your convenience.
A bit about Puppet
Our Puppet manifests were loosely based off this Atlassian blog post. I made a few tweaks to it, basically using Puppet’s standard package, file, user and service resource types. We also skipped the headache of Oracle’s JVM and opted for OpenJDK.
In our next example, we’ll show how to build a new Stash virtual appliance using Stash v2.7.0 and our REST API. The best part, we can provision it from the same OS installation we created earlier.