aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2023-05-02 05:09:36 -0400
committerPaul Duncan <pabs@pablotron.org>2023-05-02 05:09:36 -0400
commit93b9925eeb8cbe1d39c8df38a011bd7f65e39cf1 (patch)
treec6274964a349de0a2000fbcc8c56d728f6119a06
parent0d17e5fd3ddfc538756786bec7481f58608567b9 (diff)
downloadpablotron.org-93b9925eeb8cbe1d39c8df38a011bd7f65e39cf1.tar.bz2
pablotron.org-93b9925eeb8cbe1d39c8df38a011bd7f65e39cf1.zip
bin/hook/deploy.rb: update to handle stricter git permission handling
-rwxr-xr-xbin/hook/deploy.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/hook/deploy.rb b/bin/hook/deploy.rb
index 20b3523..0755326 100755
--- a/bin/hook/deploy.rb
+++ b/bin/hook/deploy.rb
@@ -18,10 +18,11 @@
# Configuration is handled with the following environment variables:
#
# * `DEPLOY_HTDOCS_PATH`: Required. Absolute path to `htdocs` symlink.
+# Must be in the `builds` directory to handle `webhook` permissions.
# * `DEPLOY_REPO_DIR`: Required. Absolute path to clone of upstream Git
# repository
# * `DEPLOY_BUILDS_DIR`: Required. Absolute path to directory for site
-# builds.
+# builds and the `current` symlink
# * `DEPLOY_SKEW_THRESHOLD`: Optional, defaults to 300 (5 minutes) if
# unspecified. Amount of clock skew to allow when verifying payload
# timestamp.
@@ -123,8 +124,10 @@ link_time = timed do
end
rm_time = timed do
- # get sorted list of builds
- builds = Dir.entries(BUILDS_DIR).select { |name| name !~ /\A\./ }.sort
+ # get sorted list of builds, excluding the "current" symlink
+ builds = Dir.entries(BUILDS_DIR).select do |name|
+ name !~ /\A\./ && name != 'current'
+ end.sort
# have we exceeded the cache size threshold?
if builds.size > BUILD_CACHE_SIZE