Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Deployment

tenaciousRas edited this page Dec 10, 2014 · 10 revisions

The SSD AngularJS website is a static HTML website that uses web services to reach backend data. It also consists of at least 3 PHP scripts to proxy AJAX calls to prevent CORS errors. These PHP scripts do not and should not allow willy-nilly proxy requests in order to prevent malicious usage.

The deployment is manual, with code on Github. These steps only apply to the deployment from 1.x to 2.x, in other words from the WP site to the NG site with WP backend. In 2.x and beyond the deployment should consist of a single "git pull github master" where 'github' is a git repo.

The steps for moving WP from the root to its own folder are at: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

The deployment outline is:

  1. create a sandbox
  2. clone/download the new site from Github into the sandbox
  3. copy the WP site into a subfolder in the sandbox
  4. make changes in the sandbox as required to have the new NG site with a WP subfolder
  5. backup the current boulderhackerspace.com files
  6. do not worry about WP database backup

The deployment steps go like this:

  1. git clone [ssd-w3-ng-code] wwwroot-[todays_date]
  2. cp -R [wwwroot] wwwroot-[todays_date]/wp
  3. cd [wwwroot]-[todays_date]
  4. vi ./wp/.htaccess
  5. RewriteBase = /wp
  6. save, exit
  7. touch .htaccess
  8. vi .htaccess 1.1. RewriteBase = /app
  9. check file permissions and ownership. Probably need to sudo chown the files cloned with Git since shell user != httpd daemon user. Ownership should be the same as wwwroot. Use -R switch. Read/write permissions should just be read. There are 3+ proxy*.php files that probably need execute permission, not sure. Permissions from wwwroot for wordpress should have copied over verbatim.
  10. cp proxy-flickr-template.php proxy-flickr.php
  11. cp proxy-meetup-template.php proxy-meetup.php
  12. edit proxy-flickr.php with your Flickr API key
  13. edit proxy-meetup.php with your Meetup API key
  14. cd ..
  15. mv [wwwroot] wwwroot-v1-BAK
  16. cp -R wwwroot-[todays_date] wwwroot
  17. check site with web browser

WordPress Changes

  • From the admin, two vars should be changed in wp-admin/options-general.php:

Proxies

There are 3 proxy files for:

  • Wordpress API (no API key needed)
  • Meetup API (need API key)
  • Flickr API (need API key)

Meetup and Flickr require API keys. These API keys are not checked into this repository. You must edit these files:

  • proxy-meetup-template.php
  • proxy-flickr-template.php

Rollback

  1. mv wwwroot-v1-BAK [wwwroot]

Troubleshoot

  • Do the proxy scripts have their API keys?
  • If proxy scripts don't work check path and URLs in app/js/services.js.
  • Use developer toolbar to check proxy requests and responses.
  • Wrong settings in RewriteBase will usually throw a 500 or 50x error. Possible corrective action is to add/remove trailing slash, or try commenting it out by adding # as the first character in the line.
Clone this wiki locally