Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #109 from cotech/revert-103-dev
Browse files Browse the repository at this point in the history
Revert "WordPress update to 4.9.8 and lots of other changes"
  • Loading branch information
chriscroome authored Oct 27, 2018
2 parents f809899 + 32ca8d3 commit 8055be5
Show file tree
Hide file tree
Showing 13 changed files with 3,261 additions and 5,285 deletions.
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

82 changes: 42 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,68 @@
[![Build Status](https://travis-ci.org/cotech/website.svg?branch=dev)](https://travis-ci.org/cotech/website)
# Cooperative Technologists

# Cooperative Technologists Website
## Requirements

https://www.coops.tech/
* PHP >= 5.4
* Node & NPM
* Gulp
* Composer - [Install](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx)
* MySQL

## Editing Content
## Development

For content that cannot be edited on the Wordpress Admin interface, please see:
1. Check out this repository
2. Install the dependencies
3. From the root run
```
composer install
cd ./web/app/themes/coop-tech-oowp-theme
composer update
npm install
gulp
```

> https://github.com/cotech/website/tree/master/web/app/themes/coop-tech-oowp-theme/views
4. Download a copy of the [CoTech database](https://www.coops.tech/wp/wp-admin/tools.php?page=dbs_options) from the CoTech site (you'll need admin permissions)
5. Load the copy of the database into a local database e.g. `mysql -u root cotech_db < cotech_data.sql`
6. Copy `./.env.example` to `./.env`
7. Edit `./.env` and enter the credentials of your database and the path to your local website
8. Visit the path you entered in Step 7 e.g. http://localhost/cotech/web
9. Enjoy playing with your new local copy of the site

For example, [frontPage.php](https://github.com/cotech/website/blob/master/web/app/themes/coop-tech-oowp-theme/views/frontPage.php).

## Wiki Documentation
### Using docker
For an easy to use development environment run we use Docker Compose.

Please see more information on [the wiki](https://wiki.coops.tech/wiki/CoTech_WordPress).
0. Make sure you have [downloaded Docker](https://www.docker.com/community-edition#/download) and have it installed on your machine and running.
1. On your command line of choice kickstart it all with `docker-compose up -d` run from inside this directory. You can follow the logs with `docker-compose logs -f`.
2. It will take some time, especially for the first run.

## Hack On It
Then you can access:

Firstly, install [docker](https://docs.docker.com/install/)
| URL | Description |
| --- | --- |
| [localhost:18080](http://localhost:18080) | WordPress URL (dev:dev) |
| [localhost:18081](http://localhost:18081) | PHPMyAdmin |

Then, get [docker-compose](https://docs.docker.com/compose/install/) installed.
### Images

Finally, run the following magic incantation:
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:

```bash
$ docker-compose up
```

### Get Latest Images

Manually update the latest images with the following magic incantation:

```bash
$ docker-compose exec assets /download-images.sh --force
docker-compose exec assets /download-images.sh --force
```

## How The Deployment Works
## Deployment

Currently the [live](https://www.coops.tech/) and [dev](https://dev.coops.tech/) sites are running on [Werbarchitects shared hosting](https://webarch.net/wp).

Changes to the **dev** branch are automatically applied to the [dev site](https://dev.coops.tech/).

This works via a [crontab](https://git.coop/cotech/ansible/blob/master/roles/live2dev/tasks/main.yml#L29) which runs [a script](https://git.coop/cotech/ansible/blob/master/roles/live2dev/templates/cron.j2) which checks for changes and if there are any then it runs the [update script](https://git.coop/cotech/ansible/blob/master/roles/live2dev/templates/update.j2).
Changes to the **dev** branch are automatically applied to the [dev site](https://dev.coops.tech/). This works via a [crontab](https://git.coop/cotech/ansible/blob/master/roles/live2dev/tasks/main.yml#L29) which runs [a script](https://git.coop/cotech/ansible/blob/master/roles/live2dev/templates/cron.j2) which checks for changes and if there are any then it runs the [update script](https://git.coop/cotech/ansible/blob/master/roles/live2dev/templates/update.j2).

The [live site](https://www.coops.tech/) is set up exactly the same way but tracking the **master** branch.

If the [dev site](https://dev.coops.tech/) images and database needs syncing from the [live site](https://www.coops.tech/) then please contact `[email protected]` and ask him to run the [live2dev Ansible playbook](https://git.coop/cotech/ansible/blob/master/live2dev.yml).

## Getting Deployment Machine Access

Ask `[email protected]` to add your SSH public keys to the server and to email you the MySQL login details.

When you have SSH access, you can then:

```
$ ssh [email protected]
```

The site is in `~/sites/web`, add yourself to `~/.forward` if you wish to get emails.
## Deployment (manual)

If you want to change the crontab, please make changes [over here](https://git.coop/cotech/ansible/blob/master/roles/live2dev/tasks/main.yml#L29).
Currently the [live](https://www.coops.tech/) and [dev](https://dev.coops.tech/) sites are running on [Werbarchitects shared hosting](https://webarch.net/wp) and although SFTP/SSHFS and phpMyAdmin access is to available to any developers who need it (ask `[email protected]` 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](https://wiki.coops.tech/wiki/CoTech_WordPress#Updating_the_code) for the steps to manually update the code.

## Querying the WordPress database directly

Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@
"php": ">=5.4",
"composer/installers": "~1.0.12",
"vlucas/phpdotenv": "^2.0.1",
"johnpbloch/wordpress": "4.9.8",
"johnpbloch/wordpress": "4.9.4",
"oscarotero/env": "^1.0",
"wpackagist-plugin/advanced-custom-fields": "5.7.7",
"wpackagist-plugin/custom-post-type-ui": "1.5.8",
"wpackagist-plugin/advanced-custom-fields": "4.4.12",
"wpackagist-plugin/custom-post-type-ui": "1.5.6",
"wpackagist-plugin/posts-to-posts": "1.6.5",
"wpackagist-plugin/wordpress-importer": "0.6.4",
"wpackagist-plugin/wordpress-importer": "0.6.3",
"wpackagist-plugin/wp-fail2ban": "3.5.3",
"wpackagist-plugin/wp-piwik": "1.0.19",
"wpackagist-plugin/contact-form-7": "5.0.4",
"wpackagist-plugin/contact-form-7": "5.0",
"wpackagist-plugin/database-sync": "^0.5.1",
"wpackagist-plugin/flamingo": "1.9",
"wpackagist-plugin/flamingo": "1.8",
"wpackagist-plugin/contact-form-7-recaptcha": "1.2.0",
"wpackagist-plugin/acf-to-rest-api": "3.1.0",
"wpackagist-plugin/email-subscribers": "3.5.13",
"wpackagist-plugin/email-subscribers": "3.4.8",
"outlandish/oowp": "0.9.1",
"outlandish/routemaster": "dev-wp-json-fix",
"wp-sync-db/wp-sync-db-media-files": "^1.1"
Expand Down
Loading

0 comments on commit 8055be5

Please sign in to comment.