diff options
-rwxr-xr-x | bin/hook/deploy.rb | 9 |
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 |