From f4909257654410c578372b11b074b9b75cebc236 Mon Sep 17 00:00:00 2001 From: Nathaniel Paulus Date: Fri, 1 Jun 2018 16:33:56 -0500 Subject: [PATCH] Make corrections to the Vagrant install method --- README.md | 4 +++- deploy/playbook_xenial_server_vagrant.yml | 2 +- deploy/xenial/Vagrantfile | 14 ++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 214dc53412..b47c624b9d 100644 --- a/README.md +++ b/README.md @@ -136,8 +136,10 @@ After Ubuntu Xenial Bash has finished installing, close the Windows Command Prom ### Vagrant VM Setup ### +If you are on Windows, begin by giving your user account [permission to create symlinks.](https://gist.github.com/Nateowami/504b7d4c63b53f8e6d21822ddc648e14) This is necessary or `npm install` will not run properly. + - Download the file https://github.com/sillsdev/web-languageforge/blob/master/deploy/xenial/Vagrantfile and save it as Vagrantfile. -- Open the command line to the directory where the Vagrantfile is and run `vagrantup --no-provision` (this delays provisioning so the VirtualBox guest additions updates don't interfere with the provisioning process.) +- Open the command line to the directory where the Vagrantfile is and run `vagrant up --no-provision` (this delays provisioning so the VirtualBox guest additions updates don't interfere with the provisioning process.) - Shut down the box with `vagrant halt` - Run `vagrant up --provision` diff --git a/deploy/playbook_xenial_server_vagrant.yml b/deploy/playbook_xenial_server_vagrant.yml index 25d57f731b..6639290357 100644 --- a/deploy/playbook_xenial_server_vagrant.yml +++ b/deploy/playbook_xenial_server_vagrant.yml @@ -2,7 +2,7 @@ - include: dependencies.yml vars: - deploy: lf_only + deploy: palaso - include: code.yml vars: site_src_paths: diff --git a/deploy/xenial/Vagrantfile b/deploy/xenial/Vagrantfile index 55a6a541b8..d885aca7b1 100644 --- a/deploy/xenial/Vagrantfile +++ b/deploy/xenial/Vagrantfile @@ -17,7 +17,7 @@ apt-get -y install git ansible echo Install NodeJS 8.X and latest npm wget -O- https://deb.nodesource.com/setup_8.x | sudo -E bash - -apt-get install -y nodejs || exit +apt-get install -y nodejs # Runs the rest of the script as vagrant sudo -i -u vagrant bash << VAGRANT_USER @@ -26,17 +26,19 @@ set -eux cd ~/src if [ ! -d "web-languageforge" ]; then - git clone --depth 100 --recurse-submodules https://github.com/sillsdev/web-languageforge.git + git clone --depth 1 --recurse-submodules https://github.com/sillsdev/web-languageforge.git else cd web-languageforge - # commented out because it crashes the script if git user.email and user.name are not set, and it is non-critical - # git pull --ff-only --recurse-submodules + git pull --ff-only --recurse-submodules fi +[ -d web-scriptureforge ] || ln -s web-languageforge web-scriptureforge + cd ~/src/web-languageforge/deploy/ git checkout master echo '***You may be asked for a password. The password is vagrant***' + ansible-playbook -i hosts playbook_create_config.yml --limit localhost chown vagrant.vagrant ansible.cfg # TODO: what is this here for? ansible-playbook -i hosts playbook_xenial_server_vagrant.yml --limit localhost @@ -87,6 +89,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vb.customize ["modifyvm", :id, "--memory", "4096"] vb.customize ["modifyvm", :id, "--vram", 64] vb.customize ["modifyvm", :id, "--accelerate3d", "off"] + + # Allows symlinks in the synced folder (disabled by default because of security issues that don't apply to us) + # See https://github.com/hashicorp/vagrant/issues/713 + vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant-root", "1"] end # configure Vagrant's ssh shell to be a non-login one (avoids error "stdin: is not a tty error")