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-commithooks 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 buildTo run the unit tests, run the following:
$ make testFor 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.tomlfile 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 runor 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_TOKENand aRUNNER_TOKENin your shell session.
Warning
The development environment creates Hetzner Cloud servers which will induce costs.
- Run the development environment:
make -C dev upAlso run this command to update the development environment with your latest code changes.
- Check that the development environment is healthy:
docker compose logsmake -C dev downWe 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!