Skip to content

spox/developer-environment

 
 

Repository files navigation

developer-environment

overview

This project produces an Ubuntu OS Vagrant box, which is built using Hashicorp Packer for consumption by Hashicorp Vagrant, tailored to run on VirtualBox. The box is provisioned using Ansible, and aims to provide developers with an environment containing some of the most common development tools and packages.

validate

To validate the packer configuration, navigate to the root of the project and run:

packer validate developer-environment.json

build

To build the project, navigate to the root of the project and run:

packer build developer-environment.json

You'll need to set the VAGRANTCLOUD_TOKEN, ATLAS_USERNAME & ATLAS_NAME environment variables to push this artefact up to Vagrant Cloud

download

The built vagrant artefact is available here. You'll also require VirtualBox and Vagrant to use this base box.

run

You can create a basic Vagrantfile which will download the box and setup an environment:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Check and Install required plugins if missing
installed_plugins = false
required_plugins=%w( vagrant-vbguest )
required_plugins.each do |plugin|
  if !Vagrant.has_plugin?plugin
    system "vagrant plugin install #{plugin}"
    installed_plugins = true
  end
end

if installed_plugins
  puts "Please re-run 'vagrant up' command"
  exit
end

Vagrant.require_version ">= 1.9.5"

$windows = (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
$mac = (/darwin/ =~ RUBY_PLATFORM) != nil
$linux = (/linux/ =~ RUBY_PLATFORM) != nil

Vagrant.configure(2) do |config|

  config.vm.box = "cooperc/developer-environment"
  config.vm.box_version = "0.99"

  if Vagrant.has_plugin?("vagrant-vbguest")
    config.vbguest.auto_update = true
    config.vbguest.iso_path = "http://download.virtualbox.org/virtualbox/%{version}/VBoxGuestAdditions_%{version}.iso"
  end

  config.vm.provider "virtualbox" do |v|
    v.gui = true
    v.name = "development-environment"
    v.customize ["modifyvm", :id, "--cpus", "2"]
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
    v.customize ["modifyvm", :id, "--monitorcount", "1"]
    v.customize ["modifyvm", :id, "--memory", "2048"]
    v.customize ["modifyvm", :id, "--vram", "128"]
    v.customize ["modifyvm", :id, "--ioapic", "on"]
    v.customize ["modifyvm", :id, "--accelerate3d", "on"]
    v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
  end
  config.vm.synced_folder ".", "/vagrant"
end

Save the file (Vagrantfile) and within the same directory, run:

vagrant up

See Vagrant cli commands for more information.

About

A developer environment using ubuntu xenial 64bit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%