zola/README.md

48 lines
2.5 KiB
Markdown
Raw Permalink Normal View History

2019-07-24 12:32:17 +00:00
# Zola
[![Build Status](https://cloud.drone.io/api/badges/JJTC-Docker/zola/status.svg)](https://cloud.drone.io/JJTC-Docker/zola)
[![Docker Pulls](https://img.shields.io/docker/pulls/jjtc/zola.svg?style=flat)](https://hub.docker.com/r/jjtc/zola/)
[![Github Stars](https://img.shields.io/github/stars/jjtc-docker/zola.svg?style=flat)](https://github.com/jjtc-docker/zola)
[![Github Forks](https://img.shields.io/github/forks/jjtc-docker/zola.svg?style=flat?label=github%20forks)](https://github.com/jjtc-docker/zola)
## Intro
Zola setup based on Alpine, Nginx & Drone CI for use with Træfik
This design has two distinct parts.
The first part is the `jjtc/zola image` (main purpose of this repo) which is used for generating the static site (`zola build`).
The second part (see the `site-example` folder) is the files used to maintain/generate your site.
## Setup
### Requirements
- zola installed locally for first time setup
- Git repo
- Drone CI (Cloud with GH or git + own instance)
- Docker image repo
### Description
The Zola files, your content, Drone CI and Nginx files will live in a git repo dedicated to a specific site (e.g. testsite_com).
Drone CI will use the zola image (jjtc/zola:latest) to generate the static output and then build a new "website" image based on Nginx, static output and the Nginx config files (found in `site-example`).
### Steps
#### Init
To get started, do the following: run `zola init`, copy all of the files from `site-example` into the newly created site project folder, `cd` to the folder and init a new repo (`git init`).
Update .drone.yml to match your Docker Hub repo. Update Drone CI with the `docker_username` and `docker_password` info and lastly modify the Nginx files to fit your needs.
Remember to add, commit and push.
#### Update content
Push all of the content changes you desire, when the "website" image should be updated push a git tag and Drone CI will take care of the rest. I recommend using the current date for the tag.
#### Update production
Either configure the CD part of .drone.yml to make Drone CI handle the rollout of the new Docker image or access your production box (ssh...) and run
```
docker-compose pull && docker-compose up -d
```
See docker-compose.yml found in `site-example`.
## Note
Currently you have to manually init the site locally with `zola init` and go through the interactive setup process. Atm it is not worth the effort to automate the process, that might change in the future in which case the setup instructions above will be updated.