[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

@@ -100,7 +100,7 @@ in
"dm-companion-pocketbase" "dm-companion-pocketbase"
]; ];
volumes = [ volumes = [
"/tank/web/dm.terakoda.com/dist:/usr/share/nginx/html:ro" "/tank/web/dm.terakoda.com/deployed:/usr/share/nginx/html:ro"
"${nginxConf}:/etc/nginx/nginx.conf:ro" "${nginxConf}:/etc/nginx/nginx.conf:ro"
]; ];
}; };

View File

@@ -8,10 +8,11 @@ let
writeShellScript "migrate-pocketbase" '' writeShellScript "migrate-pocketbase" ''
set -e set -e
id echo "Migrating in $(pwd) as $(id)"
pwd
${pkgs.pocketbase}/bin/pocketbase migrate up ${pkgs.pocketbase}/bin/pocketbase migrate up
echo "Migration complete"
''; '';
deployNpmApp = deployNpmApp =
with pkgs; with pkgs;
@@ -26,10 +27,12 @@ let
]; ];
text = '' text = ''
set -e 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 "${ export GIT_SSH_COMMAND='ssh -v -o "UserKnownHostsFile ${gitKnownHosts}" -i "${
config.sops.secrets."deploy-key/mcp".path config.sops.secrets."deploy-key/mcp".path
@@ -46,9 +49,12 @@ let
# Use a local cache with --cache .npm # Use a local cache with --cache .npm
npm ci --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 # 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 in