我最近用一个类似heroku的git部署工作流配置了一个ec2实例,但是我似乎不明白heroku是如何阻止git post receive hook在每一行输出“remote:”。
考虑以下两个例子(一个来自我的ec2项目,另一个来自heroku项目):
我的EC2项目:

git push prod master
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 456 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)
remote:
remote: Receiving push
remote: Deploying updated files (by resetting HEAD)
remote: HEAD is now at bf17da8 test commit
remote: Running bundler to install gem dependencies
remote: Fetching source index for http://rubygems.org/
remote: Installing rake (0.8.7)
remote: Installing abstract (1.0.0)
...
remote: Installing railties (3.0.0)
remote: Installing rails (3.0.0)
remote: Your bundle is complete! It was installed into ./.bundle/gems
remote: Launching (by restarting Passenger)... done
remote:
To ssh://[email protected]/~/apps/app_name
   e8bd06f..bf17da8  master -> master

英雄:
$> git push heroku master
Counting objects: 179, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (89/89), done.
Writing objects: 100% (105/105), 42.70 KiB, done.
Total 105 (delta 53), reused 0 (delta 0)

-----> Heroku receiving push
-----> Rails app detected
-----> Gemfile detected, running Bundler version 1.0.3
       Unresolved dependencies detected; Installing...
       Using --without development:test
       Fetching source index for http://rubygems.org/
       Installing rake (0.8.7)
       Installing abstract (1.0.0)
       ...
       Installing railties (3.0.0)
       Installing rails (3.0.0)
       Your bundle is complete! It was installed into ./.bundle/gems
       Compiled slug size is 4.8MB
-----> Launching... done
       http://your_app_name.heroku.com deployed to Heroku

To [email protected]:your_app_name.git
   3bf6e8d..642f01a  master -> master

最佳答案

Heroku是否有可能在每一行发送覆盖“remote:”前缀的终端控制代码?类似于"\e[1G-----> line"

关于ruby-on-rails - 如何防止Git在接收后钩子(Hook)的输出的每一行上打印'remote:'?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4610353/

10-09 07:14