Experimental extension for Jurassic Ninja that adds the ability to add 1 or more WordPress plugins (from private GitHub repositories) to ephemeral sites.
This extension uses the WordPress hooks defined in Jurassic Ninja to add WordPress plugins to a newly created sites. When a new site is created, a query parameter (jn_pr_repos
) can be provided which defindes private repo information for plugins that should be added to the new site.
- Jurassic Ninja master server creates remote site.
- If
jn_pr_repos
parameter is present, this extension will:- Clone repository branch from GitHub servers
- Archive plugin files as a zip file.
- Upload plugin archive to newly created remote site.
- Execute plugin build on remote site.
- Activate plugin on remote site using WP CLI.
- Jurassic Ninja finishes provisioning site and the user can access the newly created ephemeral site.
- Setup Jurassic Ninja on your WordPress site.
- Install
Jurassic Ninja Private Repos
on your WordPress site.- Clone this repo to
plugins
directory - Activate
- Clone this repo to
- Define GitHub username and password for private repo access in
wp_config.php
:
define( 'JN_PR_GH_USERNAME', 'your_name' );
define( 'JN_PR_GH_PASSWORD', 'abc123' );
GitHub username and password can be a standard user, or you can use a Personal Access token: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
yourjurassicsite.ninja/create?jn_pr_repos=<url_encoded_json_data>
Example JSON for jn_pr_repos
:
[
{
"name": "super-secret-repo-name",
"url": "github.com/c-shultz",
"build": true,
"branch": "master"
}
]
The above configuration would add the master branch from the repo at github.com/c-shultz/super-secret-repo-name
, with build
set to true
, it would attempt to build the plugin with Node.js by running npm run build
.
The final url after encoding would be: yourjurassicsite.ninja/create?=%5B%0A%09%7B%0A%09%09%22name%22%3A%20%22super-secret-repo-name%22%2C%0A%09%09%22url%22%3A%20%22github.com%2Fc-shultz%22%2C%0A%09%09%22build%22%3A%20true%2C%0A%09%09%22branch%22%3A%20%22master%22%0A%09%7D%0A%5D
- Directly including JSON data in the URL is not a great interface. This would be a lot better as a form that could be filled out on the Jurassic Ninja site.
- Error handling and debug logging is limited.
- The only
build
option is to usenpm run
build. This will not be useful for some plugins. - More progress reporting would be very useful. Plugin download/build can take quite a bit of time. It's hard to know if Jurassic Ninja has failed or if it's just taking a long time.