mirror of
https://github.com/GrapheneOS/matrix.grapheneos.org.git
synced 2024-12-24 23:19:36 -05:00
add file locking to deploy/process scripts
This commit is contained in:
parent
316a5c696b
commit
04fa0a2224
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
nginx-tmp
|
nginx-tmp
|
||||||
static-tmp
|
static-tmp
|
||||||
|
lock
|
||||||
|
@ -2,7 +2,14 @@
|
|||||||
|
|
||||||
set -o errexit -o nounset -o pipefail
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
./process-static
|
touch lock
|
||||||
|
exec {fd}< lock
|
||||||
|
if ! flock -n $fd; then
|
||||||
|
echo deploy_static already locked >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
./process-static $fd
|
||||||
|
|
||||||
remote=root@matrix.grapheneos.org
|
remote=root@matrix.grapheneos.org
|
||||||
active=$(ssh $remote readlink /srv/element.grapheneos.org)
|
active=$(ssh $remote readlink /srv/element.grapheneos.org)
|
||||||
|
@ -3,6 +3,18 @@
|
|||||||
set -o errexit -o nounset -o pipefail
|
set -o errexit -o nounset -o pipefail
|
||||||
shopt -s dotglob extglob globstar
|
shopt -s dotglob extglob globstar
|
||||||
|
|
||||||
|
if [[ $# -eq 1 ]]; then
|
||||||
|
fd=$1
|
||||||
|
else
|
||||||
|
touch lock
|
||||||
|
exec {fd}< lock
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! flock -n $fd; then
|
||||||
|
echo deploy_static already locked >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
export PATH="$PWD/node_modules/.bin:$PATH"
|
export PATH="$PWD/node_modules/.bin:$PATH"
|
||||||
|
|
||||||
rm -rf nginx-tmp
|
rm -rf nginx-tmp
|
||||||
|
Loading…
Reference in New Issue
Block a user