Skip to content

Commit

Permalink
change br/gz timestamps to match source files
Browse files Browse the repository at this point in the history
This was lost as part of preserving existing file timestamps instead of
using the timestamps from generated files.
  • Loading branch information
thestinger committed Mar 6, 2024
1 parent 0ad0c42 commit b6e664c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
/lock-server
/nginx-tmp/
/node_modules/
/static-deploy/
/static-tmp/
/venv/
12 changes: 11 additions & 1 deletion deploy-static
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -o errexit -o nounset -o pipefail

shopt -s extglob

touch lock
exec {fd}< lock
if ! flock -n $fd; then
Expand All @@ -12,6 +14,14 @@ fi
./process-static $fd

[email protected]

# 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
Expand All @@ -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
Expand Down

0 comments on commit b6e664c

Please sign in to comment.