Home
Lennart Weller edited this page 2 years ago

Testing & Deployment Build Status

This blog is based on the static site generator hugo and automatically tested with drone.io CI and deployed using rsync+rssh.

Drone.io

The drone.io CI is set up as a container on the host using the gogs instance as auth source as described here.

The drone configuration for the blog is relatively simple:

# .drone.yml
build:
  image: debian:stretch
  commands:
    - apt-get update && apt-get -y install hugo python-pygments
    - hugo
publish:
  rsync:
    host: ring0.de
    user: hugo-deploy
    port: 22
    source: public/
    target: /var/www/blog/
    delete: true
    recursive: true

drone.io internally uses docker containers for basically everything, which means images, plugins and so on are not limited to some predermined ones but can be basically anything. I am using an official drone publisher instance with drone-rsync.

Deployment

As not to allow the deployment user too much access on the system, it is limited by chrooting the upload using rsync with rssh as a shell with this config:

#/etc/rssh.conf
user=hugo-deploy:002:100000:/var/www/blog

Login with the user is only allowed with the private key generated by drone for that specific repository. Which is kind of a cool feature to have.