From b43bb58aa78b5ba47d8bfbae9dc368b88dd48ab3 Mon Sep 17 00:00:00 2001 From: Mark Winterbottom Date: Tue, 18 Apr 2017 08:36:50 +0100 Subject: [PATCH] Added a Vagrantfile and hello_world script. --- Vagrantfile | 39 +++++++++++++++++++++++++++++++++++++++ hello_world.py | 1 + 2 files changed, 40 insertions(+) create mode 100644 Vagrantfile create mode 100644 hello_world.py diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..b560c80 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,39 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| + # The most common configuration options are documented and commented below. + # 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://atlas.hashicorp.com/search. + config.vm.box = "ubuntu/xenial64" + + config.vm.network "forwarded_port", host_ip: "127.0.0.1", guest: 8080, host: 8080 + + config.vm.provision "shell", inline: <<-SHELL + # Update and upgrade the server packages. + sudo apt-get update + sudo apt-get -y upgrade + # Set Ubuntu Language + sudo locale-gen en_GB.UTF-8 + # Install Python, SQLite and pip + sudo apt-get install -y python3-dev sqlite python-pip + # Upgrade pip to the latest version. + sudo pip install --upgrade pip + # Install and configure python virtualenvwrapper. + sudo pip install virtualenvwrapper + if ! grep -q VIRTUALENV_ALREADY_ADDED /home/ubuntu/.bashrc; then + echo "# VIRTUALENV_ALREADY_ADDED" >> /home/ubuntu/.bashrc + echo "WORKON_HOME=~/.virtualenvs" >> /home/ubuntu/.bashrc + echo "PROJECT_HOME=/vagrant" >> /home/ubuntu/.bashrc + echo "source /usr/local/bin/virtualenvwrapper.sh" >> /home/ubuntu/.bashrc + fi + SHELL + +end diff --git a/hello_world.py b/hello_world.py new file mode 100644 index 0000000..f301245 --- /dev/null +++ b/hello_world.py @@ -0,0 +1 @@ +print("Hello World!")