From 93b9925eeb8cbe1d39c8df38a011bd7f65e39cf1 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 2 May 2023 05:09:36 -0400 Subject: bin/hook/deploy.rb: update to handle stricter git permission handling --- bin/hook/deploy.rb | 9 ++++++--- 1 file 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 -- cgit v1.2.3