Skip to content
This repository was archived by the owner on Feb 14, 2018. It is now read-only.

Commit b6aee8b

Browse files
committed
Use Vagrant to test with Ubuntu
1 parent 0170d1e commit b6aee8b

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ luac.out
4242
# npm
4343
npm-debug.log
4444

45+
# Vagrant
46+
.vagrant/
47+
4548
# Other
4649
*.lua.swp
4750
lib/

Vagrantfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
Vagrant.configure(2) do |config|
5+
config.vm.box = "ubuntu/trusty64"
6+
7+
# copy over handy configuration from host, like Git settings and SSH key
8+
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
9+
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: ".ssh/id_rsa"
10+
11+
# run provisioning script
12+
config.vm.provision :shell, :path => "provision-vagrant.sh"
13+
end

provision-vagrant.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
if [ -e "/etc/vagrant-provisioned" ];
4+
then
5+
echo "Vagrant provisioning already completed. Skipping..."
6+
exit 0
7+
else
8+
echo "Starting Vagrant provisioning process..."
9+
fi
10+
11+
host='nginx-jwt'
12+
# Change the hostname so we can easily identify what environment we're on:
13+
echo $host > /etc/hostname
14+
# Update /etc/hosts to match new hostname to avoid "Unable to resolve hostname" issue:
15+
echo '127.0.0.1 $host' >> /etc/hosts
16+
# Use hostname command so that the new hostname takes effect immediately without a restart:
17+
hostname $host
18+
19+
# Install core components
20+
apt-get update
21+
apt-get install -y make g++ curl git vim nfs-common portmap build-essential libssl-dev
22+
23+
# Install Node.js
24+
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
25+
apt-get install --yes nodejs
26+
27+
# Install Docker
28+
curl -sSL https://get.docker.com/ubuntu | sh
29+
30+
# Vim settings:
31+
echo 'syntax on' > /home/vagrant/.vimrc
32+
33+
touch /etc/vagrant-provisioned

0 commit comments

Comments
 (0)