This repository has been archived by the owner on Jun 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from cotech/revert-103-dev
Revert "WordPress update to 4.9.8 and lots of other changes"
- Loading branch information
Showing
13 changed files
with
3,261 additions
and
5,285 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.