nickbreen / wordpress-sam

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prerequisites

  • make
  • aws sam cli & aws cli
  • docker
  • jq 1.6+ (required for base64 decoding)
  • diffutils
  • dos2unix
  • nodejs 8.10+ & npm

Usage

...Work in Progress

  1. Fork/clone this repository.

  2. WIP Edit src/layer-wp/composer.json to add the required themes, plugins, and any other libraries. Then update composer.lock with make update.

    Or replace it entirely with your own composer project!

  3. WIP Edit wp-config.php to suit.

  4. WIP Edit src/sam.yaml to change environment variables and parameters to suit your deployment. E.g. specify database host/user/pass/name

  5. Test with make test to 'integration' test the function and API with a simple script that echos the request body as the response body.

  6. Test with make int to 'acceptance' test via AP with the same echo script.

  7. Test with make acc to 'acceptance' test via API with WordPress.

  8. Deploy with make deploy and then test with make til to 'test in live' via the real API gateway.

Structure

  • CloudFormation template (src/sam.yaml) with SAM transform
    • lambda function, nodejs 8.10 (src/func-js)

      handles lambda events and hands off to PHP CGI 1.1

    • lambda layer, PHP 7.3.4 runtime CLI & CGI (src/layer-php)

      built based on img2lambda example

    • lambda layer, composer managed WordPress app (src/layer-wp)

      built based on john bloch (what about roots.io?)

References

PHP

SAM

WP

Node + CGI

Packages:

Other

TODO

  • PHPUnit with wp-content/vendor/bin/phpunit

About

License:GNU General Public License v3.0


Languages

Language:JavaScript 58.9%Language:Makefile 17.4%Language:Shell 14.9%Language:PHP 7.1%Language:Dockerfile 1.6%