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

WordPress update to 4.9.8 and lots of other changes #103

Merged
merged 19 commits into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

sudo: false

language: generic

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

## Requirements
# Cooperative Technologists Website

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

## Development
## Editing Content

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
```
For content that cannot be edited on the Wordpress Admin interface, please see:

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
> https://github.com/cotech/website/tree/master/web/app/themes/coop-tech-oowp-theme/views

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

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

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.
Please see more information on [the wiki](https://wiki.coops.tech/wiki/CoTech_WordPress).

Then you can access:
## Hack On It

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

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

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

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

### Get Latest Images

Manually update the latest images with the following magic incantation:

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

## Deployment
## How The Deployment Works

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).
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).

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).

## Deployment (manual)
## 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.

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.
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).

## 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.4",
"johnpbloch/wordpress": "4.9.8",
"oscarotero/env": "^1.0",
"wpackagist-plugin/advanced-custom-fields": "4.4.12",
"wpackagist-plugin/custom-post-type-ui": "1.5.6",
"wpackagist-plugin/advanced-custom-fields": "5.7.7",
"wpackagist-plugin/custom-post-type-ui": "1.5.8",
"wpackagist-plugin/posts-to-posts": "1.6.5",
"wpackagist-plugin/wordpress-importer": "0.6.3",
"wpackagist-plugin/wordpress-importer": "0.6.4",
"wpackagist-plugin/wp-fail2ban": "3.5.3",
"wpackagist-plugin/wp-piwik": "1.0.19",
"wpackagist-plugin/contact-form-7": "5.0",
"wpackagist-plugin/contact-form-7": "5.0.4",
"wpackagist-plugin/database-sync": "^0.5.1",
"wpackagist-plugin/flamingo": "1.8",
"wpackagist-plugin/flamingo": "1.9",
"wpackagist-plugin/contact-form-7-recaptcha": "1.2.0",
"wpackagist-plugin/acf-to-rest-api": "3.1.0",
"wpackagist-plugin/email-subscribers": "3.4.8",
"wpackagist-plugin/email-subscribers": "3.5.13",
"outlandish/oowp": "0.9.1",
"outlandish/routemaster": "dev-wp-json-fix",
"wp-sync-db/wp-sync-db-media-files": "^1.1"
Expand Down
Loading