Deploying a Hugo site basically involves cloning the codebase, running Hugo to compile static code, then pointing a vhost at it. Tasks in Ægir are the procedures used to accomplish an operation. These procedures are made up of tasks. While you can define the scope of a task however you like, we recommend keeping them as small as is reasonable. This allows for easier re-use. Multiple tasks are combined in a specific order to form an operation.
Let’s start with deploying the codebase, by creating a new “Clone Git repository” task type.
Ægir > Tasks > Task Types
.To clone a Git repo, we’ll need (at a minimum) both the repository URL, and the destination directory. So let’s add fields to record these values. First, the repo URL:
https://gitlab.com/consensus.enterprises/drumkit
). It can be updated or removed later.]Now let’s provide the destination path to which we’ll clone the repo:
/var/aegir/sites/hugo
). It can be updated or removed later.]That should be all that’s needed for this task. Later, we can add options, such as a “Clone recursively” checkbox. For now, we’ll hard-code that in the backend.
Next, let’s add a task to run hugo
:
Ægir > Tasks > Task Types
.Not all tasks need parameters. That’s the case here, for our minimalist example. Later, we can add options, such as allowing Hugo to look in the docs
directory for the site codebase (as opposed to the root of the repo). For now, we’ll hard-code that in the backend too.