Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker containerization for jekyll tasks #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/make

SHELL := /bin/sh

JEKYLL_VERSION := 3.8

UID := $(shell id -u)
GID := $(shell id -g)

DOCKER_RUN := docker run --rm
DOCKER_VOLUMES := --volume="${PWD}:/srv/jekyll" --volume="${PWD}/vendor/bundle:/usr/local/bundle"
DOCKER_ENV := --env JEKYLL_UID=${UID} --env JEKYLL_GID=${GID}
DOCKER_PORT := -p 4000:4000
DOCKER_IT := -it jekyll/jekyll:${JEKYLL_VERSION}

build:
$(DOCKER_RUN) $(DOCKER_VOLUMES) $(DOCKER_ENV) $(DOCKER_IT) jekyll build

update:
$(DOCKER_RUN) $(DOCKER_VOLUMES) $(DOCKER_ENV) $(DOCKER_IT) jekyll update

serve:
$(DOCKER_RUN) $(DOCKER_VOLUMES) $(DOCKER_ENV) $(DOCKER_PORT) $(DOCKER_IT) jekyll serve
46 changes: 40 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
This site is built using Jekyll and hosted on GitHub Pages.
# CoopCycle Docs Repo

To install:
This site is built using [Jekyll](https://jekyllrb.com/) and hosted on [GitHub Pages](https://pages.github.com/).

## Environment

### Local

Install Jekyll and project dependencies:
```
gem install bundler jekyll
bundle install
```

To run it locally:
Serve it locally:
```
bundle install
bundle exec jekyll serve --safe
```

### Documentation
Build Static Site:
```
bundle exec jekyll build
```

The URLs will map the folder tree (they are not configured with a `.yml` file).
Update dependencies:
> Note: it modifies Gemfile.lock
```
bundle exec jekyll update
```

### Docker

Serve it and browse to it: [Open](http://localhost:4000)
```shell
make serve
```

Build Static site:
```
make update
```

Update dependencies:
> Note: it modifies Gemfile.lock
```
make update
```

## Documentation

The URLs will map the folder tree (they are not configured with a `.yml` file).