From 0e751ce92790789b6a3e89effa88f04a905be257 Mon Sep 17 00:00:00 2001 From: leefaisonr Date: Wed, 22 Mar 2023 14:17:38 -0400 Subject: [PATCH] Include version-number in imagecat Co-authored-by: Bess Sadler --- config/deploy.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/deploy.rb b/config/deploy.rb index fd3fef90..89a9d46f 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -12,3 +12,13 @@ set :deploy_to, '/opt/imagecat-rails' # set :ssh_options, {verify_host_key: :never} + +desc "Write the current version to public/version.txt" +task :write_version do + on roles(:app), in: :sequence do + within repo_path do + execute :tail, "-n1 ../revisions.log > #{release_path}/public/version.txt" + end + end +end +after "deploy:log_revision", "write_version"