Skip to content

Instantly share code, notes, and snippets.

@MichalPekala
Last active April 12, 2016 14:08
Show Gist options
  • Save MichalPekala/afdc3e76c213d0f497a8 to your computer and use it in GitHub Desktop.
Save MichalPekala/afdc3e76c213d0f497a8 to your computer and use it in GitHub Desktop.
Swift Vagrant file
Vagrant.configure(2) do |config|
config.vm.box = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.hostname = "swift-developer"
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get install clang-3.6 libicu-dev -y
mkdir /opt/swift/
SWIFT_VERSION="2.2-RELEASE"
SWIFT_PLATFORM="ubuntu14.04"
wget -nv https://swift.org/builds/swift-2.2-release/$(echo "$SWIFT_PLATFORM" | tr -d .)/swift-$SWIFT_VERSION/swift-$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz
wget -nv https://swift.org/builds/swift-2.2-release/$(echo "$SWIFT_PLATFORM" | tr -d .)/swift-$SWIFT_VERSION/swift-$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz.sig
wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
gpg --keyserver hkp://pool.sks-keyservers.net --refresh-keys Swift
gpg --verify swift-$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz.sig
sudo tar xvzf swift-$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz --directory /opt/swift/ --strip-components=1
echo "export PATH=/opt/swift/usr/bin:\"${PATH}\"" >> .profile
echo "Swift has successfully installed on Linux"
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment