Jekyll build server written in go. Uses a POST http request to trigger builds, making it useful for webhooks. A simple Dockerfile has been provided with all necessary dependencies to run jekyll build.
# Compile jekyll-build and build a docker image
$ make
# Run a container on port 8080
$ docker run --rm -p 8080:80 jekyll-buildJekyll build is on Docker's public registry! docker pull ripeworks/jekyll-build:latest
Using a DEPLOY file you can specify how you would like jekyll-build to publish your site. By default it will attempt to use Amazon S3.
- Amazon S3
- surge.sh
Send a POST request to /build to get started. See below for the format to map a request to a repository url.
POST /build/:host/:user/:repo
- host - Host where repository is located. (i.e. github.com)
- user - User/Organization that owns repository.
- repo - Name of repository
POST /build/github.com/tamagokun/tamagokun.github.com
# Maps to
[email protected]:tamagokun/tamagokun.github.amrom.workers.dev.git
By default successfully built sites will be synced to an Amazon S3 Bucket. Specify the bucket location by creating a BUCKET file at the root of your project.
The user running jekyll-build must have proper permissions to access the repository specified, as well as a configured s3cmd client.
If you plan to automate builds using private repositories, there are a few ways to handle authentication.
Perhaps the easiest way is to provide a private key to the docker container that has read access to the git repository.
Example:
$ docker run --rm -p 8080:80 -v ~/.ssh/id_rsa:/root/.ssh/id_rsa jekyll-buildIf the git repository supports cloning over https (github, gitlab, bitbucket), you could alternatively provide authentication using .netrc. It does require storing credentials/tokens in plaintext so take caution.
Example:
machine github.com
login TOKEN
password
$ docker run --rm -p 8080:80 -v ~/.netrc:/root/.netrc jekyll-build