gpt4 book ai didi

git - 如何将部署的 git 修订写出到 Capistrano 中的文件

转载 作者:太空狗 更新时间:2023-10-29 14:26:13 24 4
gpt4 key购买 nike

我使用 Capistrano 来部署我的 Rails 应用程序。如何写出部署到 public_html/revision.txt 的 git 修订版?

最佳答案

如果其他人必须这样做:

    namespace :deploy do
# ...

desc "Write the current version to public_html/revision.txt"
task :write_revision, :except => { :no_release => true } do
run "cd #{latest_release}; git rev-parse HEAD > #{latest_release}/public/revision.txt"
end

# ...
end

after "deploy:update_code", "deploy:write_revision"

关于git - 如何将部署的 git 修订写出到 Capistrano 中的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12324594/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com