ElkArte Community

Extending Elk => Addons => Topic started by: Ant59 on September 01, 2015, 07:39:00 am

Title: [TOOL] Instant Addon Development Environment
Post by: Ant59 on September 01, 2015, 07:39:00 am
I've created a Vagrant environment for developing Elkarte addons for 1.1+.

The environment creates a virtual machine using Vagrant, then syncs your addon development folder so that you can simply refresh the page to see your changes. This is part of 3 such environments I'm creating: one for addons, one for themes and one for Elk itself. I will probably turn this into a CLI tool at some point for creating addons/themes with a single command.

The environment contains Nginx, PHP5, PHPUnit for testing, Xdebug and webgrind for profiling (just go to /webgrind to view), and MySQL, which is auto-populated with an empty Elk 1.1 database.

Simply download this repo, create a directory inside for your addon (same level as the provision directory), and then edit the Vagrantfile to sync your folder (change "./pages/" and "/var/www/addons/pages" to "./<your addon name>/" and "/var/www/addons/<your addon name>" respectively).

https://github.com/Ant59/elkarte-vagrant-addon

Admin username and password for Elk are "admin" and "1234", and for MySQL "root" and "1234".

Your addon will appear in the Core Features page.

(https://i.imgur.com/mKmQHnO.png)

Webgrind will display the output of Xdebug when requested. You can trigger Xdebug by adding XDEBUG_PROFILE as a GET/POST parameter, or a cookie set to 1. There are addons for every browser to do this easily.

(https://i.imgur.com/gxLflzn.png)

(Sidenote, should we have a wiki to add stuff like this to?)
Title: Re: [TOOL] Instant Addon Development Environment
Post by: Spuds on September 01, 2015, 08:22:03 am
This is extremely COOL !  I'm really going to have to update my environment, feeling like a dinosaur now :P

Quote(Sidenote, should we have a wiki to add stuff like this to?)
There is one on GitHub, but there are limitations, and GitHub does not seem approachable to most doc writers either.  Perhaps docuwiki, @emanuele said there may be an ElkArte bridge to that which would be nice.
Title: Re: [TOOL] Instant Addon Development Environment
Post by: emanuele on September 01, 2015, 02:48:27 pm
This is terribly cool and wonderful! :D
Title: Re: [TOOL] Instant Addon Development Environment
Post by: Eliana Tamerin on September 11, 2015, 07:56:58 pm
Any possibility to set this up for VirtualBox as well?
Title: Re: [TOOL] Instant Addon Development Environment
Post by: Antechinus on September 11, 2015, 08:12:15 pm
Very nifty.

Question: why can't it just run on an existing local host?
Title: Re: [TOOL] Instant Addon Development Environment
Post by: Ant59 on September 14, 2015, 06:52:20 am
Quote from: Eliana Tamerin – Any possibility to set this up for VirtualBox as well?

This already uses VirtualBox as a backend :)

Quote from: Antechinus – Very nifty.

Question: why can't it just run on an existing local host?

This way guarantees the clean state of the environment and is reproducible on any machine. You can run the provisioning script locally if you like, but I wouldn't recommend it. Using Vagrant means everyone is on the same page when developing.