Skip to content

Instantly share code, notes, and snippets.

@kamaulynder
Created November 11, 2014 13:17
Show Gist options
  • Save kamaulynder/fb2c464ded7ec7b38ff3 to your computer and use it in GitHub Desktop.
Save kamaulynder/fb2c464ded7ec7b38ff3 to your computer and use it in GitHub Desktop.
set up instructions
Dependencies
Run composer install to get all the php requirements (via composer)
Run npm install to get all the packages necessary for grunt (via npm)
While developing, run grunt in an open terminal window and it will automatically watch for and compile changes to scss and js files (and reload your browser if you have livereload configured). If you need to install grunt, use npm install -g grunt-cli
Run bower install to get all the required frontend components (via bower)
Run grunt compile to compile all the css/js assets
Copy the app/config/ping.php.template to app/config/ping.php
VM
If you'd like to use the included Vagrant vm:
Make sure ansible is set up
Copy the vagrant/Vagrantfile.template to vagrant/Vagrantfile
Make sure you're running Vagrant 1.6, otherwise, you need to comment out the "config.vm.post_up_message" option in your Vagrantfile
Adjust the contents of the Vagrant file to suit your environment
Make sure to:
- select a networking option (forwarded port, private network, or public network) by uncommenting the appropriate line and editing it to suit your host
- change the first argument of config.vm.synced_folder to the absolute path of your ping repository on your host
Copy the vagrant/conf/playbook.yml.template -> vagrant/conf/playbook.yml and optionally adjust any parameters you like.
The VM is setup to serve the site at http://ping.lan but you can change the URL to whatever you like (in playbook.yml). To change the URL, you need to change the site_name var
Run vagrant up from the ping/vagrant directory to create and provision the VM
After its finished booting and provisioning , run vagrant ssh, cd into the VM and access the site folder e.g /var/www/ping.lan
To complete the set up, see the database section below
Make sure to let your /etc/hosts or local dns server know about the IP that your local URL should point to (defined in the Vagrantfile).
If you'd like to use your own VM, make sure that it's got PHP, and a database that you've configured through app/config/database.php.
Database
To set up the database, you can use the included artisan command-line utility from Laravel.
From your project directory, run ./artisan migrate to set up all the tables.
If you're adding new migrations, you can run ./artisan migrate:refresh to tear down the old ones and rerun everything again.
You may need to run composer dump-autoload if you want to refresh after adding new migrations.
After migrating or refreshing a migration, remember to run ./artisan db:seed which will load the minimum amount of data required to run things.
Tests
Ping uses a few different testing suites, and you can run them all through the included runtests script.
From the web directory on your VM, just run bin/runtests. The script will give you a visual indication of test status, and it will also exit with a non-zero code if there are any errors, so it can be easily added to any CI tool you choose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment