diff --git a/config/deploy.rb b/config/deploy.rb index fd3fef9..89a9d46 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"