[dm-companion] Fixes deployment script?

This commit is contained in:
2025-11-21 12:09:23 -08:00
parent f7af96c497
commit 9818771f7c
2 changed files with 14 additions and 8 deletions

View File

@@ -8,10 +8,11 @@ let
writeShellScript "migrate-pocketbase" ''
set -e
id
pwd
echo "Migrating in $(pwd) as $(id)"
${pkgs.pocketbase}/bin/pocketbase migrate up
echo "Migration complete"
'';
deployNpmApp =
with pkgs;
@@ -26,10 +27,12 @@ let
];
text = ''
set -e
id
pwd
output_dir="./$(date --utc --iso-8601=seconds)"
echo "Deploying in $(pwd) as $(id)"
OUTPUT_DIR="./$(date --utc --iso-8601=seconds)"
echo "Deploying into $OUTPUT_DIR"
export GIT_SSH_COMMAND='ssh -v -o "UserKnownHostsFile ${gitKnownHosts}" -i "${
config.sops.secrets."deploy-key/mcp".path
@@ -46,9 +49,12 @@ let
# Use a local cache with --cache .npm
npm ci --cache .npm
npm run build -- --outDir "$output_dir"
npm run build -- --outDir "$OUTPUT_DIR"
echo "Activating $OUTPUT_DIR"
# Trailing slash on source to only copy contents, not the directory itself
rsync --archive --delete "$output_dir"/ deployed
rsync --archive --delete "$OUTPUT_DIR"/ deployed
echo "Deployment complete"
'';
};
in