jekyll-build-server

command module
v0.0.0-...-956aaad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2019 License: GPL-2.0 Imports: 21 Imported by: 0

README

jekyll build server

Taking a webhook approach to building sites in Jekyll. Kind of like jekyll-hook and others, but with a single binary because Go is nice.

Build Status

Installation & Usage

$ go get byparker.com/go/jekyll-build-server
$ $GOPATH/bin/jekyll-build-server -owner="your-username-or-org"

Daemonize it or put it in a screen session if you want.

Add a webhook to this server's POST /_github endpoint. Each request will be checked and only build if on the master branch and if the repo has the proper owner. It will clone the repo into ${src}/${repo_nwo} and build it into ${dest}/${repo_nwo}

Dependencies

You'll need:

  • Go
  • Ruby
  • Bundler
  • Git
  • A public-facing IP or domain name

Configuration

All the configuration happens in flags:

  • -owner="your-username-or-org" – the string your repos' full names (e.g. "parkr" in "parkr/jekyll-build-server") must start with in order to be authorized to be built
  • -bind=":9090" – the port/host to bind the server to
  • -src="/tmp" – the directory to clone the sources into
  • -dest="/var/www" – the base directory to put built sites into
  • -db="localhost@/builds" – the connection string where your builds are stored. optional

Run jekyll-build-server -h to learn more at any time.

Server Configuration

I serve my static files with nginx. A very simple HTTP server might look like this:

server {
  listen 80;
  server_name example.com;
  root /var/www/parkr/example.com;
  error_page 404 = /404.html;

  location / {
    try_files $uri $uri.html $uri/index.html index.html;
  }
}

This would serve the static files built for the parkr/example.com repo at example.com:80.

... that's really it!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL