A fleeting plugin for Hetzner Cloud.
This tool was created to leverage GitLab's Next Runner Auto-scaling Architecture with Hetzner Cloud, and take advantage of the new features that comes with it.
- 🚀 See the quick start guide to get you started.
- 📖 See the configuration reference for the available configuration.
For more information, see the documentation.
This project adheres to Semantic Versioning.
Please read the changelog before upgrading.
First and foremost, thank you! We appreciate that you want to contribute to this project.
When submitting your contribution to this project, make sure that:
-
all the
pre-commit
hooks passes:pre-commit run --all
-
all tests passes:
make test
-
any relevant documentation is updated with your changes.
To build the binary, ensure that your go version is up-to-date, and run the following:
$ make build
To run the unit tests, run the following:
$ make test
For the integration tests to run, you need to export a Hetzner Cloud token in the HCLOUD_TOKEN
environment variable before starting the tests.
Sometimes, you want to test the whole plugin as its being executed by GitLab's Fleeting mechanism. Use an approach like this:
-
Build the plugin by running the following:
$ cd cmd/fleeting-plugin-hetzner $ go build
-
Set up the plugin in GitLab Runner's
config.toml
file using the approach described above, but updateplugin = "/path/to/fleeting-plugin-hetzner"
to point to yourcmd/fleeting-plugin-hetzner/fleeting-plugin-hetzner
-
Run
gitlab-runner run
or similar, to run GitLab Runner interactively as a foreground process. -
Make a CI job run using this runner, perhaps using special
tags:
or similar (to avoid breaking things for other CI jobs on the same GitLab installation).
To setup a development environment, make sure you installed the following tools:
- Configure a
HCLOUD_TOKEN
and aRUNNER_TOKEN
in your shell session.
Warning
The development environment creates Hetzner Cloud servers which will induce costs.
- Run the development environment:
make -C dev up
Also run this command to update the development environment with your latest code changes.
- Check that the development environment is healthy:
docker compose logs
make -C dev down
We leverage the releaser-pleaser tool to prepare and cut releases. To cut a new release, you need to merge the Merge Request that was prepared by releaser-pleaser.
The project started out as a fork of the existing gitlab-org/fleeting/plugins/aws plugin, gradually replacing the AWS calls with calls to the Hetzner Cloud API. To all the people involved in this initial work, thanks a lot!