0.0
The project is in a healthy, maintained state
Another gem that extends beaker
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0, >= 13.0.6
~> 3.12

Runtime

~> 5.4
~> 1.2
>= 1.0.3, < 2.0.0
~> 1.3
 Project Readme

beaker-hcloud

License Test Release RubyGem Version RubyGem Downloads

A beaker extension for provision Hetzner Cloud instances.

Installation

Include this gem alongside Beaker in your Gemfile or project.gemspec. E.g.

# Gemfile
gem 'beaker', '~> 5.0'
gem 'beaker-hcloud'

# project.gemspec
s.add_runtime_dependency 'beaker', '~> 5.0'
s.add_runtime_dependency 'beaker-hcloud'

Authentication

You need to create an API token using Hetzner's cloud console. Make sure to create the token in the correct project.

beaker-hcloud expects the token to be in the BEAKER_HCLOUD_TOKEN environment variable.

Configuration

Some options can be set to influence how and where server instances are being created:

configuration option required default description
image true The name of one of Hetzner's provided images, e.g. ubuntu-20.04, or a custom one, i.e. a snapshot in your account.
server_type false cx11 Hetzner cloud server type
location false nbg1 One of Hetzner's datacenter locations

Cleanup

Every created cloud instance gets a label delete_vm_after: 1698792887. By default this is the UNIX timestamp during VM creation + an hour.

You can modify the default of an hour by setting the BEAKER_HCLOUD_DELETE_VM_AFTER environment variable to any positive integer. It will be interpreted as seconds.

In cases where the beaker process is killed before finishing, it may leave resources in Hetzner cloud. These will need to be manually deleted. Look for servers in your project named exactly as the ones in your beaker host configuration and SSH keys with names beginning with Beaker-.

You can also periodically scan for VMs where the delete_vm_after points to a past timestamp and delete them.

Contributing

Please refer to voxpupuli/beaker's contributing guide.