Commit 35c116b8 authored by runseb's avatar runseb

Add Vagrantfile for build

parent 46e7d6cb
Collection of convenience scripts
=================================
[Vagrantfile](Vagrantfile)
--------------------------
A Vagrantfile to create a standalone build environment for helm.
It is handy if you do not have Golang and the dependencies used by Helm on your local machine.
$ git clone https://github.com/kubernetes/deployment-manager.git
$ cd deployment-manager/hack
$ vagrant up
Once the machine is up, you can SSH to it and start a new build of helm
$ vagrant ssh
$ cd src/github.com/kubernetes/deployment-manager
$ make build
[dm-push.sh](dm-push.sh)
------------------------
Run this from deployment-manager root to build and push the dm client plus
kubernetes install config into the publicly readable GCS bucket gs://get-dm.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
GLIDE_VERSION = "0.9.1"
GO_VERSION = "1.6"
$bootstrap=<<SCRIPT
apt-get update
apt-get -y install wget
wget -qO- https://get.docker.com/ | sh
gpasswd -a vagrant docker
service docker restart
SCRIPT
$helm=<<SCRIPT
curl -L https://storage.googleapis.com/golang/go#{GO_VERSION}.linux-amd64.tar.gz -o go#{GO_VERSION}.linux-amd64.tar.gz
tar -C /usr/local -xzf go#{GO_VERSION}.linux-amd64.tar.gz
wget "https://github.com/Masterminds/glide/releases/download/#{GLIDE_VERSION}/glide-#{GLIDE_VERSION}-linux-amd64.tar.gz"
su vagrant -c "mkdir -p /home/vagrant/bin"
su vagrant -c "mkdir -p /home/vagrant/src/github.com/kubernetes/deployment-manager"
chgrp vagrant -R /home/vagrant/src
chown vagrant -R /home/vagrant/src
su vagrant -c "tar -vxz -C /home/vagrant/bin --strip=1 -f glide-#{GLIDE_VERSION}-linux-amd64.tar.gz"
su vagrant -c "echo 'export GLIDE_HOME=/home/vagrant/.glide' >> ~/.profile"
su vagrant -c "echo 'export PATH=$PATH:/usr/local/go/bin:/home/vagrant/bin' >> ~/.profile"
su vagrant -c "echo 'export GOPATH=/home/vagrant' >> ~/.profile"
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
config.vm.synced_folder "../", "/home/vagrant/src/github.com/kubernetes/deployment-manager"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provision :shell, inline: $bootstrap
config.vm.provision :shell, inline: $helm
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment