Develop on staging and push to production

Laddr, like any emergence application, is usually setup as a pair of at least two sites – a staging site and a live site. The staging site extends the model for your site (v2.laddr.us typically for Laddr) while the live site extends the staging site.

The staging site is where you’ll want to do work customizing the templates, stylesheets, javascript, and backend code for your site. After completing all the changes you want and testing them from your staging site, you run the pull tool from the live site to update the running instance without any interruption to your users.

Generally you do not want to make any changes directly on your live site, as any files you save on the live site will override its counterpart from the staging site and no longer be updated by the pull tool. The common exception to this is some files under the php-config which you might want to override to vary config options or API keys between staging and production.

Making changes on staging

Visit /develop from your web browser on your staging domain to access emergence’s in-browser IDE, or use a native IDE or network filesystem mount supporting the WebDAV protocol (ensure /develop is configured as the “initial” or “working” path when connecting via WebDAV.)

All changes you make will be reflected immediately on the staging site with two exceptions:

  • Changes made to model fields will need to be manually applied to any existing database tables or applied automatically via a migration script added to the php-migrations tree.
  • Changes made to templates in the html-templates/subtemplates tree will not be reflected until the second time the page using them is reloaded after the change due to the nature of how subtemplates are implemented as PHP functions internally

Pulling changes live

Visit /site-admin/tasks/filesystem/update from your web browser on your live domain. The tool will load an overview of the changes to be pulled and you can review them or select a subset of them before actually pulling the changes to your live site. Generally, having tested the changes already on your staging site, you just want to click the “Select all updates” button and then the “Pull remote versions” button.