This is a nix derivation for deploying a buildbot CI server using nixops. It comes preinstalled with some useful utility commands from git-ci.
First, search this repo for FILLME
and fill in all fields:
$ grep FILLME *
The simplest option is to use the DigitalOcean backend, supplied in do.nix
. For that, you just need to get an auth token and then do:
$ export DIGITAL_OCEAN_AUTH_TOKEN=????
We will instead use a Hetzner dedicated server. For this, you need to set deployment.hetzner.robotUser
in hetzner.nix
and export the username and password for your Hetzner Robot subaccount using:
$ export HETZNER_ROBOT_USER=???
$ export HETZNER_ROBOT_PASS=???
From now on we will use the Hetzner backend with hetzner.nix
, if you are using a different backend, like DigitalOcean, then replace hetzner.nix
with do.nix
in every command.
Then, create a bare-bones deployment and name it ci-server
:
$ nixops create ./hetzner.nix ./ci-server.nix -d ci-server
Now we can deploy it:
$ nixops deploy -d ci-server -I"nixpkgs=https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz"
That's it!
Edit the configuration and then run:
$ nixops deploy -d ci-server -I"nixpkgs=https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz"
If something went wrong with buildbot
, ssh
into root
on the deployed machine, and then try one of the following to tail the logs of the mater or one of the two workers:
$ journalctl -n100 -fu buildbot-master
$ journalctl -M worker-sisyphus -n100 -fu buildbot-worker
$ journalctl -M worker-oedipus -n100 -fu buildbot-worker
To enter a buildbot worker environment, run one of
$ ssh root@buildbot.dapp.ci -t "nixos-container root-login worker-oedipus"
# ./load-klab-env.sh
to enter the environment of the klab
builder, or
$ ssh root@buildbot.dapp.ci -t "nixos-container root-login worker-sisyphus"
# ./load-k-dss-env.sh
-Fix annoying networking (spurious eth2
interface) bug in nixops
Hetzner backend.