Move publish script to Nix
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
b4a233a20f
commit
386c68813a
3 changed files with 15 additions and 9 deletions
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
(import ../drafts.nix { inherit pkgs; })
|
(import ../drafts.nix { inherit pkgs; })
|
||||||
(import ../new-draft.nix { inherit pkgs; })
|
(import ../new-draft.nix { inherit pkgs; })
|
||||||
|
(import ../publish.nix { inherit pkgs; })
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
14
publish.nix
Normal file
14
publish.nix
Normal file
|
@ -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 "$@"
|
||||||
|
'';
|
||||||
|
}
|
|
@ -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 "$@"
|
|
Loading…
Add table
Add a link
Reference in a new issue