Check out this repository
Install the dependencies
From the root run
composer install
cd ./web/app/themes/coop-tech-oowp-theme
composer update
npm install
gulp
Download a copy of the CoTech database from the CoTech site (you'll need admin permissions)
Load the copy of the database into a local database e.g. mysql -u root cotech_db < cotech_data.sql
Copy ./.env.example
to ./.env
Edit ./.env
and enter the credentials of your database and the path to your local website
Visit the path you entered in Step 7 e.g. http://localhost/cotech/web
Enjoy playing with your new local copy of the site
For an easy to use development environment run we use Docker Compose.
docker-compose up -d
run from inside this directory. You can follow the logs with docker-compose logs -f
.Then you can access:
URL | Description |
---|---|
localhost:18080 | WordPress URL (dev:dev) |
localhost:18081 | PHPMyAdmin |
Images used on the cotech website (go in web/app/uploads
) will be downloaded when you
first setup your environment. If you want to update them again, you can run:
docker-compose exec assets /download-images.sh --force
Changes to the dev branch are automatically applied to the dev site. This works via a crontab which runs a script which checks for changes and if there are any then it runs the update script.
The live site is set up exactly the same way but tracking the master branch.
If the dev site images and database needs syncing from the live site then please contact chris@webarchitects.coop
and ask him to run the live2dev Ansible playbook.
Currently the live and dev sites are running on Werbarchitects shared hosting and although SFTP/SSHFS and phpMyAdmin access is to available to any developers who need it (ask chris@webarchitects.coop
to add your SSH public keys to the server and to email you the MySQL login details), ssh
access is only availabe to Webarchitects sysadmins, see the wiki for the steps to manually update the code.
Even though the format of the WordPress database is pretty horrible you can perform analytics queries on a local copy of the database which can be downloaded from the admin section of the site if you have Admin permissions.
e.g. to get the names and email addresses of co-ops that have not entered a turnover so you can nag them:
SELECT * FROM (
SELECT post_id, post_title, meta_value as turnover
FROM `wp_postmeta` LEFT JOIN wp_posts on post_id = ID
where meta_key = 'turnover'
and post_status = 'publish'
and meta_value = "") as noturnover
LEFT JOIN wp_postmeta on noturnover.post_id = wp_postmeta.post_id
where meta_value REGEXP '^[^@]+@[^@]+\.[^@]{2,}$'