Is there a way how to fetch a git revision variable from Capistrano 3?
I can't figure out how to access capistrano variables:
namespace :deploy do
after :finished, :set_current_version do
on roles(:app) do
# dump current git version
within release_path do
execute :echo, "#{fetch(:revision_log_message)} >> public/version"
end
end
end
end
This one works
after :finished, :set_current_version do
on roles(:app) do
# dump current git version
within release_path do
execute :echo, "#{capture("cd #{repo_path} && git rev-parse --short HEAD")} >> public/version"
end
end
end
This feature is added in 3.0.1, see their changelog!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With