diff --git a/ops/deploy-machine/default.nix b/ops/deploy-machine/default.nix deleted file mode 100644 index 857d721ca..000000000 --- a/ops/deploy-machine/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, ... }: - -pkgs.stdenv.mkDerivation { - name = "deploy-machine"; - - phases = [ "installPhase" "installCheckPhase" ]; - - nativeBuildInputs = with pkgs; [ - makeWrapper - ]; - - installPhase = '' - mkdir -p $out/bin - makeWrapper ${./deploy-machine.sh} $out/bin/deploy-machine.sh \ - --prefix PATH : ${with pkgs; lib.makeBinPath [ - ansi2html - git - jq - nvd - ]} - ''; - - installCheckInputs = with pkgs; [ - shellcheck - ]; - - doInstallCheck = true; - installCheckPhase = '' - shellcheck $out/bin/deploy-machine.sh - ''; -} diff --git a/ops/deploy-machine/deploy-machine.sh b/ops/deploy-machine/deploy-machine.sh deleted file mode 100755 index 88b89ef50..000000000 --- a/ops/deploy-machine/deploy-machine.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -set -Ceuo pipefail - -DOMAIN="snix.dev" -FORGE_URL="cl.snix.dev" -REPO="tvix" -TARGET_SYSTEM="gerrit01" -TARGET_IRC_CHANNEL="#tvix-dev" - -HTML_ROOT="${HTML_ROOT:-/var/html/deploys."$DOMAIN"}" -URL_BASE="${URL_BASE:-https://deploys."$DOMAIN"/diff}" -IRCCAT_PORT="${IRCCAT_PORT:-4722}" - -drv_hash() { - basename "$1" | sed 's/-.*//' -} - -new_rev="$1" - -if [ -z "$new_rev" ]; then - >&2 echo "Usage: $0 " - exit 1 -fi - -if [ -d "/tmp/deploy.worktree" ]; then - >&2 echo "/tmp/deploy.worktree exists - exiting in case another deploy is currently running" - exit 1 -fi - -worktree_dir=/tmp/worktree_dir - -cleanup() { - rm -rf "$worktree_dir" -} -trap cleanup EXIT - -git clone https://"$FORGE_URL"/"$REPO" "$worktree_dir" --reference /"$REPO" -git -C "$worktree_dir" checkout "$new_rev" - -current=$(nix show-derivation /run/current-system | jq -r 'keys | .[0]') -new=$(nix-instantiate -A ops.nixos."$TARGET_SYSTEM" "$worktree_dir") - -diff_filename="$(drv_hash "$current")..$(drv_hash "$new").html" -nvd --color always diff "$current" "$new" \ - | ansi2html \ - >| "$HTML_ROOT/diff/$diff_filename" -chmod a+r "$HTML_ROOT/diff/$diff_filename" - -echo "$TARGET_IRC_CHANNEL $TARGET_SYSTEM is being deployed! system diff: $URL_BASE/$diff_filename" \ - | nc -w 5 -N localhost "$IRCCAT_PORT" - -# TODO(grfn): Actually do the deploy diff --git a/ops/machines/gerrit01/default.nix b/ops/machines/gerrit01/default.nix index e2a0f576f..b40c53d92 100644 --- a/ops/machines/gerrit01/default.nix +++ b/ops/machines/gerrit01/default.nix @@ -80,7 +80,7 @@ in services.fail2ban.enable = true; - environment.systemPackages = (with pkgs; [ + environment.systemPackages = with pkgs; [ bat bb curl @@ -96,9 +96,7 @@ in tree unzip vim - ]) ++ (with depot; [ - ops.deploy-machine - ]); + ]; # Required for prometheus to be able to scrape stats services.nginx.statusPage = true; diff --git a/ops/machines/meta01/default.nix b/ops/machines/meta01/default.nix index 338349d95..b44bd1f51 100644 --- a/ops/machines/meta01/default.nix +++ b/ops/machines/meta01/default.nix @@ -111,7 +111,7 @@ in services.fail2ban.enable = true; - environment.systemPackages = (with pkgs; [ + environment.systemPackages = with pkgs; [ bat bb curl @@ -127,9 +127,7 @@ in tree unzip vim - ]) ++ (with depot; [ - ops.deploy-machine - ]); + ]; # Required for prometheus to be able to scrape stats services.nginx.statusPage = true; diff --git a/ops/machines/public01/default.nix b/ops/machines/public01/default.nix index 43672990e..0ff09c4b9 100644 --- a/ops/machines/public01/default.nix +++ b/ops/machines/public01/default.nix @@ -172,7 +172,7 @@ in services.fail2ban.enable = true; - environment.systemPackages = (with pkgs; [ + environment.systemPackages = with pkgs; [ bat bb curl @@ -188,9 +188,7 @@ in tree unzip vim - ]) ++ (with depot; [ - ops.deploy-machine - ]); + ]; # Required for prometheus to be able to scrape stats services.nginx.statusPage = true;