From 9c038cbff09b600d6b3be32c6c9b1a4cd6779ec2 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 23 May 2021 18:34:41 +0200 Subject: feat(ops/deploy-whitby): Add the start of a script to deploy whitby Add the beginnings of an auto-deploy script for whitby, intended to be (eventually) suitable for running automatically in a systemd timer. The current iteration of the script doesn't actually do any deploying, but instead takes as an argument a revision, creates a new git worktree in /tmp with that revision checked out, runs a nix-diff of whitby's system derivation in the running system and at that closure, puts an html-rendered version of that diff in the public directory used by deploy.tvl.fyi, and finally sends a message to IRC via irccat with a link to that HTML page. Refs: b/110 Change-Id: Id40525567f8845590c909568befd8d00c07a481c Reviewed-on: https://cl.tvl.fyi/c/depot/+/3145 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: kn --- ops/deploy-whitby/default.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ops/deploy-whitby/default.nix (limited to 'ops/deploy-whitby/default.nix') diff --git a/ops/deploy-whitby/default.nix b/ops/deploy-whitby/default.nix new file mode 100644 index 0000000000..640f8ecfd2 --- /dev/null +++ b/ops/deploy-whitby/default.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: + +pkgs.stdenv.mkDerivation { + name = "deploy-whitby"; + + phases = [ "installPhase" "installCheckPhase" ]; + + nativeBuildInputs = with pkgs; [ + makeWrapper + ]; + + installPhase = '' + mkdir -p $out/bin + makeWrapper ${./deploy-whitby.sh} $out/bin/deploy-whitby.sh \ + --prefix PATH : ${with pkgs; lib.makeBinPath [ + nix-diff + ansi2html + git + ]} + ''; + + installCheckInputs = with pkgs; [ + shellcheck + ]; + + doInstallCheck = true; + installCheckPhase = '' + shellcheck $out/bin/deploy-whitby.sh + ''; +} -- cgit 1.4.1