From b6e664c140cca0729fe29382e48dc17a6c8df126 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 6 Mar 2024 15:16:32 -0500 Subject: [PATCH] change br/gz timestamps to match source files This was lost as part of preserving existing file timestamps instead of using the timestamps from generated files. --- .gitignore | 1 + deploy-static | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4e74f603..04308f3b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,6 @@ /lock-server /nginx-tmp/ /node_modules/ +/static-deploy/ /static-tmp/ /venv/ diff --git a/deploy-static b/deploy-static index 1f7fc543..bf74e042 100755 --- a/deploy-static +++ b/deploy-static @@ -2,6 +2,8 @@ set -o errexit -o nounset -o pipefail +shopt -s extglob + touch lock exec {fd}< lock if ! flock -n $fd; then @@ -12,6 +14,14 @@ fi ./process-static $fd remote=root@attestation.app + +# use last modified timestamps from attestation.app +rsync -rptcv --chmod=D755,F644 --delete --fsync --preallocate $remote:/srv/attestation.app/ static-deploy +rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate static-tmp/ static-deploy +for f in static-deploy/**.*(br|gz); do + touch -r "${f%.*}" "$f" +done + active=$(ssh $remote readlink /srv/attestation.app) if [[ $active = /srv/attestation.app_a ]]; then @@ -25,7 +35,7 @@ echo target is $target echo ssh $remote "rm -rf $target && cp -a $active $target" -rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate static-tmp/ $remote:$target +rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate static-deploy/ $remote:$target ssh $remote "ln -snf $target /srv/attestation.app && sync /srv/attestation.app" echo "root $target;" > nginx-tmp/root_attestation.app.conf