[dm-companion] Fixes deployment script?
This commit is contained in:
@@ -100,7 +100,7 @@ in
|
||||
"dm-companion-pocketbase"
|
||||
];
|
||||
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"
|
||||
];
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user