문제

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top