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

Swift Vagrantfile #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ cd /srv
| [rust][raw-rust] | [`Cargo`][cargo] | `stable` | |
| [scala][raw-scala] | [`SBT`][sbt] | `2.11.5` | `Java 8` |
| [scheme][raw-scheme] | | `latest mit-scheme` | |
| [swift][raw-swift] | | `5.0` from [`swift.org`][ppa-swift] | `Clang` |


## Template
Expand Down Expand Up @@ -115,6 +116,7 @@ The content of this library is released under the **MIT License** by
[ppa-nodejs]: https://launchpad.net/~chris-lea/+archive/node.js
[ppa-ocaml]: https://launchpad.net/~avsm/+archive/ubuntu/ppa
[ppa-php]: https://launchpad.net/~ondrej/+archive/php5-5.6
[ppa-swift]: https://swift.org/download/
[src-erlang]: https://www.erlang-solutions.com/downloads/download-erlang-otp
[src-golang]: https://golang.org/dl/
[src-iojs]: https://iojs.org/dist
Expand Down Expand Up @@ -156,3 +158,4 @@ The content of this library is released under the **MIT License** by
[raw-rust]: https://raw.githubusercontent.com/adlawson/vagrantfiles/master/rust/Vagrantfile
[raw-scala]: https://raw.githubusercontent.com/adlawson/vagrantfiles/master/scala/Vagrantfile
[raw-scheme]: https://raw.githubusercontent.com/adlawson/vagrantfiles/master/scheme/Vagrantfile
[raw-swift]: https://raw.githubusercontent.com/adlawson/vagrantfiles/master/swift/Vagrantfile
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-5.0-release/ubuntu1404/swift-5.0-RELEASE/swift-5.0-RELEASE-ubuntu14.04.tar.gz > /dev/null 2>&1
echo "Extracting..."
tar xzf swift.tar.gz --strip-components=1
echo "Adding to PATH..."
echo "PATH=/opt/swift/usr/bin/:$PATH" >> /etc/profile
echo "Cleaning up..."
rm swift.tar.gz
echo "Installation successful."
SHELL
end