5
0
mirror of https://git.coop/cotech/website.git synced 2024-11-05 07:58:43 +00:00
cotech-website/README.md

90 lines
3.1 KiB
Markdown
Raw Normal View History

2017-07-03 10:28:43 +00:00
# CoTech Website
## Introduction
This is a port of the current Wordpress version of the [CoTech Website][] to a statically-generated site using [Jekyll][].
2017-07-03 10:28:43 +00:00
## Run the site locally
2017-07-03 10:28:43 +00:00
You can run the site on your computer as if it were live online using Jekyll. You will need `git` and `ruby` installed on your machine to do this. Then clone the repository
2018-12-03 14:49:02 +00:00
2018-11-30 11:45:48 +00:00
### ... using docker
2018-12-15 13:09:40 +00:00
Make sure you have [docker](https://docs.docker.com/install/) (CE is fine) installed and running,
and [docker-compose](https://docs.docker.com/compose/install/) installed,
then:
2018-11-30 11:45:48 +00:00
2018-11-30 11:50:07 +00:00
git clone git@git.coop:cotech/website.git
2018-11-30 11:45:48 +00:00
cd website
2018-12-15 13:09:40 +00:00
docker-compose up -d
2018-12-03 14:49:02 +00:00
2018-11-30 11:45:48 +00:00
And visit [localhost:4000](http://localhost:4000) to view the site.
2018-12-15 13:25:26 +00:00
There are two docker volumes used here:
* `vendor` - caches the ruby gems even if you recreate the containers
* `site` - holds the built site files to share them with httpd (and not clutter your local filesystem)
A few useful things you might want to do:
# check the status of the containers
docker-compose ps
# stop all the containers (but don't remove them)
docker-compose stop
# stop and remove the containers (but leave the volumes)
docker-compose down
# remove everything
docker-compose down -v
# bring it back to life from any state you happen to be in
docker-compose up -d
2018-12-16 10:21:27 +00:00
# run some ruby/bundler commands
docker-compose run jekyll bundle --version
docker-compose run jekyll bundle update
docker-compose run jekyll bundle exec jekyll --help
2018-11-30 11:45:48 +00:00
### ... directly on your machine
2017-07-03 10:28:43 +00:00
Install the dependencies for the project
2017-07-03 10:28:43 +00:00
2018-11-30 11:50:07 +00:00
git clone git@git.coop:cotech/website.git
cd website
gem install bundler
bundle install
2017-07-03 10:28:43 +00:00
Run a local web server so that you can view the site
2017-07-03 10:28:43 +00:00
bundle exec jekyll server
2017-07-03 10:28:43 +00:00
And visit [localhost:4000](http://localhost:4000) to view the site.
2018-12-15 13:09:40 +00:00
**Note: not all the images will load as there is no `.htaccess` support locally**
2018-11-18 15:25:52 +00:00
2018-12-15 13:09:40 +00:00
## Deployment
### Dev/Staging
2018-12-15 13:09:40 +00:00
When changes are committed to the `master` branch the `.gitlab-ci.yml` file triggers the building of the site and then the copying of the results to [dev.coops.tech](https://dev.coops.tech).
### Production
You need to manually deploy the changes from dev to production.
1. View the changes on [dev.coops.tech](https://dev.coops.tech) and ensure you're happy for them to be pushed to production.
2. Visit [GitLab environments](https://git.coop/cotech/website/environments). __NOTE.__ If you don't have access to the environments page then post a message in the [Website category of the CoTech forum](https://community.coops.tech/c/cotech/website) to ask someone to do it for you.
3. Click the "Play" icon on the right of the screen in the row for the "dev" environment and choose "deploy:production".
4. Your changes will be visible in production when the commit listed in the "production" environment row matches the commit listed in the "dev" environment row.
2018-11-18 15:25:52 +00:00
## Contributing
There's a [list of bugs and improvements](https://git.coop/cotech/website/issues) in the repository. Feel free to add more, discuss or claim any of these issues to work on.
2017-07-03 10:28:43 +00:00
[CoTech Website]: https://www.coops.tech/
[Jekyll]: https://jekyllrb.com/