Skip to content

Instantly share code, notes, and snippets.

@Lucky-Loek
Last active October 26, 2018 13:47
Show Gist options
  • Save Lucky-Loek/dee5e617935c313db1779bff6c5114e6 to your computer and use it in GitHub Desktop.
Save Lucky-Loek/dee5e617935c313db1779bff6c5114e6 to your computer and use it in GitHub Desktop.
Vagrantfile for Ubuntu 18.04 and an inline provisioner
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "generic/ubuntu1804"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "/my_computer", "virtual_computer", "options"
config.vm.synced_folder ".", "/code"
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
echo ">>>>> Updating apt <<<<<"
apt-get update
echo ""
echo ">>>>> Installing NodeJS LTS PPA <<<<<"
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
echo ""
echo ">>>>> Installing NodeJS <<<<<"
sudo apt-get install -y nodejs
echo ">>>>> NodeJS + NPM installed <<<<<"
echo "Node version:" $(node --version)
echo "NPM version:" $(npm --version)
echo ""
echo ">>>>> Installing Typescript <<<<<"
sudo npm install -g typescript
echo ""
echo ">>>>> Typescript installed <<<<<"
echo "Typescript version:" $(tsc --version)
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment