From 386c68813a36d118620a43c860876404b77e909d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 25 Aug 2025 18:20:11 +0100 Subject: [PATCH] Move publish script to Nix Signed-off-by: Oliver Davies --- flake-modules/dev-shell.nix | 1 + publish.nix | 14 ++++++++++++++ tools/scripts/publish | 9 --------- 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 publish.nix delete mode 100755 tools/scripts/publish diff --git a/flake-modules/dev-shell.nix b/flake-modules/dev-shell.nix index 4ef789955..68f9ca267 100644 --- a/flake-modules/dev-shell.nix +++ b/flake-modules/dev-shell.nix @@ -20,6 +20,7 @@ (import ../drafts.nix { inherit pkgs; }) (import ../new-draft.nix { inherit pkgs; }) + (import ../publish.nix { inherit pkgs; }) ]; }; } diff --git a/publish.nix b/publish.nix new file mode 100644 index 000000000..a08a07c64 --- /dev/null +++ b/publish.nix @@ -0,0 +1,14 @@ +{ pkgs }: + +pkgs.writeShellApplication { + name = "publish"; + + runtimeInputs = with pkgs; [ rsync php ]; + + text = '' + vendor/bin/sculpin generate --env prod + + rsync -uvrP static/ output_prod "$@" + rsync -uvrP output_prod/ nixedo.oliverdavies.uk:/var/www/vhosts/website-sculpin "$@" + ''; +} diff --git a/tools/scripts/publish b/tools/scripts/publish deleted file mode 100755 index 1f5ab27b3..000000000 --- a/tools/scripts/publish +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -vendor/bin/sculpin generate --env prod -rsync -uvrP static/ output_prod "$@" -rsync -uvrP output_prod/ nixedo.oliverdavies.uk:/var/www/vhosts/website-sculpin "$@"