THESE SCRIPTS WILL ERASE DIRECTORIES AND DROP DATABASES. READ THEM, UNDERSTAND THEM, RUN THEM IN A CONTAINER OR ON A VM NOT ON A MACHINE WITH USEFUL DATA ON.
The cc-global-network plugin sends lots of emails. Be careful to either redirect PHP's emails to a text file or only use email addresses that you control.
Note that some of these emails are sent by WordPress cron jobs.
Test this code and fix any breakages!
GNU/Linux with Apache 2, MySQL and PHP installed.
These instructions assume you will be installing into:
/var/www/commonerstest/
with the WordPress install going in:
/var/www/commonerstest/html/
They also assume that you will be serving your local test site at:
http://commonerstest.localhost/
If any of these assumptions are false, edit the Apache 2 config in this
directory and the config.sh
file in the setup/
directory next to this one
VERY CAREFULLY.
Copy config.sh.template within the setup/
directory next to this one and
set your database, email and GravityForms license key details.
If you will be using your computer's hosts file to resolve the site name,
add the following line to /etc/hosts
:
127.0.0.1 commonerstest.localhost
Copy commonerstest.localhost.conf
into /etc/apache2/sites-available/
then
enable the site
cp commonerstest.localhost.conf /etc/apache2/sites-available/
a2ensite commonerstest.localhost
From within this directory, having carefully configured config.sh
in the
setup/
directory adjacent to it, run:
./delete-and-recreate-test-setup.sh
THIS WILL DELETE THE CONTENTS OF THE WORDPRESS INSTALL DIRECTORY AND DROP THE
WORDPRESS DATABASE SPECIFIED IN setup/config.sh
It will then install the wp
command line tool and use that to install all the
plugins.
While doing that, it will clone the commoners
Git project and link the
plugins and theme from that under wp-config/
.
It will then restore pages, forms and configuration settings from data files in
setup/
.
Finally it will run the test-setup.sh
script in this directory to create
test data - WordPress accounts and Global Network Application GravityForms
entries and WordPress User object metadata in various states.
The setup script does not enable CAS. You will need to enable CAS and update the admin login (WordPress User ID 1) if you wish to test the User-facing UI for the application workflow.
To give the Admin user access to the complete Global Network admin UI (no real user would have this degree of access), enter the WordPress install directory and run:
wp user add-role 1 membership-council-member wp user add-role 1 membership-final-approver wp user add-role 1 membership-cc-legal