A Vagrant base box for Mastodon
Go to file
Moritz Heiber ba46cdb7e7 Try to work around some issues with the build 2017-05-24 13:28:28 +02:00
ansible@ce3f400453 Updated Ansible scripts, update cleanup script, update README 2017-04-23 13:52:48 +02:00
config Try to work around some issues with the build 2017-05-24 13:28:28 +02:00
preseeds Preparing the build env for Packer Enterprise 2017-04-26 06:46:04 +02:00
scripts Updated Ansible scripts, update cleanup script, update README 2017-04-23 13:52:48 +02:00
.gitignore Add insecure Vagrant default key, set a default root password, update Ansible submodule, prepare Vagrant tests 2017-04-17 22:19:32 +02:00
.gitmodules Try to work around some issues with the build 2017-05-24 13:28:28 +02:00
LICENSE.md Added README, requirements.txt, removed unneded base packages, added submodule for Ansible provisioner 2017-04-16 22:22:32 +02:00
README.md Updated docs for Atlas again 2017-04-26 14:17:47 +02:00
Vagrantfile Add insecure Vagrant default key, set a default root password, update Ansible submodule, prepare Vagrant tests 2017-04-17 22:19:32 +02:00
packer.atlas.json Try to work around some issues with the build 2017-05-24 13:28:28 +02:00
packer.local.json - Move packer.json to a non-default filename to avoid confusion 2017-04-26 09:16:33 +02:00
requirements.txt Added README, requirements.txt, removed unneded base packages, added submodule for Ansible provisioner 2017-04-16 22:22:32 +02:00

README.md

A VirtualBox image for Mastodon development

This VirtualBox base image contains all the required packages and configuration for running/instantiating a Mastodon instance for development. It is build using Hashicorp's Packer, the provisioning is done with Ansible through a dedicated git submodule called mastodon-ansible. The tests are using ServerSpec. The image is build continuously using Hashicorp Atlas.

Note: Some of the content of the scripts in scripts/ is borrowed from the Bento project.

Prerequisites (for building on your own)

  • VirtualBox >= 5.1.x
  • Packer >= 1.0.0
  • Python >= 2.x
  • pip/python-pip >= 8.x

for testing purposes:

  • Vagrant >= 1.9.3

Setup

$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt

Building the box locally

Just execute:

$ packer build packer.local.json

Note: It will take at least roughly 5 - 10 minutes for the ISO to get preseeded ("pre-provisioned") by the Debian installer, hence the rather long timeout/waiting period before packer actually starts provisioning. If you're unsure whether there is any progress change the values headless in the packer.json from true to false and re-run the process. This will give have VirtualBox show you the output of the console the ISO is running on.

This will preseed the Ubuntu ISO image for Ubuntu Xenial 64bit with a couple of sane defaults and packages. Afterwards, the Ansible provisioner is run using the playbooks from the mastodon-ansible repository.

In the end you should have a box in builds/ with all the required components installed you can run directly in Vagrant.

Submitting to Atlas

HashiCorp's Atlas can be used to build new boxes. Usually it's either very difficult or impossible to build them on other SaaS offerings (because you need a fully virtualized environment to run VirtualBox). To push a new configuration to Atlas run:

$ packer push -token=<your-token> packer.atlas.json

Only files that are checked into git are uploaded/submitted to Packer Enterprise (i.e. everything in .gitignore stays where it is).

Note: There is a organization within Packer Enterprise called mastodon which is responsible for the Vagrant boxes under the same namespace. If you think you can/want to contribute send me a message on @moritzheiber@mastodon.social and I'll add your to the organization. This GitHub repository is bound to the Packer Enterprise configuration mastodon/ubuntu-xenial64 and will trigger a new build for each commit.

Testing

TODO