Skip to content

Instantly share code, notes, and snippets.

@redsox2002
Last active July 17, 2017 14:10
Show Gist options
  • Save redsox2002/bb2106235e7cc3446276895b08092967 to your computer and use it in GitHub Desktop.
Save redsox2002/bb2106235e7cc3446276895b08092967 to your computer and use it in GitHub Desktop.
Community Platform (Zen) Local Development Setup
  1. Use below Vagrantfile, this will install a Ubuntu 16.04 box and update the server and install git and the build-essential packages.
  Vagrant.configure("2") do |config|
   config.vm.box = "bento/ubuntu-16.04"
   config.vm.network "forwarded_port", guest: 80, host: 10301
   config.vm.network "private_network", ip: "192.168.33.10"
   config.vm.provision "shell", inline: <<-SHELL
     apt-get update
     apt-get install git build-essential 
   SHELL
end
  1. Run vagrant up command to setup box and then vagrant ssh to ssh to the box
  2. Run wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash to get latest version of nvm
  3. Run nvm ls-remote | grep 0.10.* and install the latest version of 0.10.x.
  4. Run nvm use 0.10.x to use the latest version of node
  5. Install Npm by running npm -g install npm@latest-2
  6. Install PostgreSQL 9.4 by following the instructions in the top answer here: https://askubuntu.com/questions/765539/how-to-install-postgresql-9-4-on-ubuntu-16-04
  7. Update password for postgres user by going here: http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html and looking at the "Setting a password for the postgres user" section
  8. While still in the postgres command line, run this command create user platform with superuser password 'QdYx3D5y';
  9. Under the vagrant user, create a folder called Project within the root (mkdir /home/vagrant/Project).
  10. Within the project folder, run git clone https://github.com/CoderDojo/cp-local-development.git && cd cp-local-development
  11. Within the repo, change .nvmrc to use the latest v0.10.x you installed in step 4
  12. Run nvm use and npm install in the repo
  13. If no failures, run ./localdev.js init zen
  14. You will get an error saying "ChromeDriver installation failed [TypeError: Object # has no method 'isAbsolute']", this is fixed by installing Node v5.6 and above
  15. What you have to do now is run nvm ls-remote | grep 5.* and see the latest version of 5.x
  16. Run nvm install 5.x
  17. Run nvm use 5.x
  18. In the .nvmrc file in the cp-local-development repo, update it to use v5.x
  19. Run nvm use within the cp-local-development repo to update to v5.x
  20. Run ./localdev.js init zen again, you should get no errors
  21. Run ./localdev.js run zen, you should get no errors.
  22. Go to http://192.168.33.10:8000 in your browser locally and the page should load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment