Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Swift Vagrantfile #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions swift/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

hostname = "swift.box"
locale = "en_GB.UTF.8"

# Box
config.vm.box = "ubuntu/trusty64"

# Shared folders
config.vm.synced_folder ".", "/srv"

# Lang
# Provide additional packages/setup/etc
config.vm.provision "shell", inline: <<-SHELL
echo "Setting up..."
touch .hushlogin
hostnamectl set-hostname #{hostname} && locale-gen #{locale}
echo "Updating..."
apt-get update -f > /dev/null 2>&1
echo "Upgrading..."
apt-get upgrade -y > /dev/null 2>&1
echo "Creating installation directory /opt/swift..."
mkdir /opt/swift
echo "Changing to /opt/swift..."
cd /opt/swift
echo "Installing dependencies..."
apt-get install clang libicu-dev -y > /dev/null 2>&1
echo "Getting Swift..."
wget -q -O swift.tar.gz https://swift.org/builds/swift-2.2.1-release/ubuntu1404/swift-2.2.1-RELEASE/swift-2.2.1-RELEASE-ubuntu14.04.tar.gz > /dev/null 2>&1
echo "Extracting..."
tar xzf swift.tar.gz --strip-components=1
echo "Adding to PATH..."
PATH=/opt/swift/usr/bin/:$PATH
echo "Cleaning up..."
rm swift.tar.gz
echo "Installation successful."
SHELL
end