Created
March 3, 2016 13:43
-
-
Save kreeger/9823c7af81cdc3520f03 to your computer and use it in GitHub Desktop.
My Vagrantfile for setting up and provisioning a Swift-ready environment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
# Every Vagrant development environment requires a box. You can search for | |
# boxes at https://atlas.hashicorp.com/search. | |
config.vm.box = "ubuntu/wily64" | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
# config.vm.network "private_network", ip: "192.168.33.10" | |
# config.vm.network "public_network" | |
# config.vm.synced_folder "../data", "/vagrant_data" | |
# config.vm.provider "virtualbox" do |vb| | |
# # Display the VirtualBox GUI when booting the machine | |
# vb.gui = true | |
# | |
# # Customize the amount of memory on the VM: | |
# vb.memory = "1024" | |
# end | |
# config.push.define "atlas" do |push| | |
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" | |
# end | |
config.vm.provision "shell", inline: <<-SHELL | |
## 2 | |
sudo apt-get update | |
sudo apt-get upgrade --assume-yes | |
sudo apt-get --assume-yes install clang build-essential linux-headers-`uname -r` git-core vim zsh | |
su vagrant <<'EOF' | |
git clone git://github.com/kylef/swiftenv.git $HOME/.swiftenv | |
echo 'export SWIFTENV_ROOT="$HOME/.swiftenv"' >> ~/.bashrc | |
echo 'export PATH="$SWIFTENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(swiftenv init -)"' >> ~/.bashrc | |
git clone git://github.com/rbenv/rbenv.git $HOME/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
mkdir -p $HOME/.rbenv/plugins | |
git clone git://github.com/rbenv/ruby-build.git $HOME/.rbenv/plugins/ruby-build | |
git clone --recursive https://github.com/kreeger/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" | |
cd $HOME/.zprezto | |
git checkout kreeger-custom-swift | |
ln -sfv $HOME/.zprezto/runcoms/zlogin $HOME/.zlogin | |
ln -sfv $HOME/.zprezto/runcoms/zlogout $HOME/.zlogout | |
ln -sfv $HOME/.zprezto/runcoms/zpreztorc $HOME/.zpreztorc | |
ln -sfv $HOME/.zprezto/runcoms/zprofile $HOME/.zprofile | |
ln -sfv $HOME/.zprezto/runcoms/zshenv $HOME/.zshenv | |
ln -sfv $HOME/.zprezto/runcoms/zshrc $HOME/.zshrc | |
EOF | |
chsh -s /bin/zsh vagrant | |
echo "Done provisioning." | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment