本文介绍了是否有替代“推”钩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Bitbucket,Github和其他服务往往有一个推挂钩,所以当你将代码推送到存储库时,该服务可以打到一个URL(可能在生产服务器上),告诉它提取最新的代码。



问题是,如果我在云端有多个服务器(根据加载进入和退出),我没有办法知道多少服务器在任何给定的时间都在云中,所以我无法配置哪个URL推到。有没有一种替代方法?



有没有办法让所有的生产服务器在github,bitbucket等上打到一个url,并检查他们是否需要更新?这不是特定于任何一个服务,因为我想象如果任何一个服务都有它所有的一切。我只是不知道这个功能将被调用。

解决方案

其实,一个Git repo托管服务器将有另一个选项与Git 2.10(Q3 2016):推选项



请参阅,,,(2016年7月14日)由。



该功能是在中提出的:



  git push origin HEAD:refs / for / master%draft% topic=example%cc=jon.doe@xxxxxxxxxxx 





  git push origin HEAD:refs / for / master \ 
--push-option draft \
--push-option topic = example \
- -push-option cc=jon.doe@xxxxxxxxxxx




Bitbucket, Github and other services tend to have a "push" hook, so that when you push code to the repository, the service can hit a url (possible on a production server), telling it to pull the latest code.

The problem is, if I have a number of servers in the cloud (which come in and out based on load), I do not have a way of knowing how many servers are in the cloud at any given time, so I cannot configure which urls to "push" to. Is there an alternative way?

Is there a way to instead have all the production servers hit a url on github, bitbucket etc, and check if they need to update ? This is not specific to any one service, because I imagine if any one service has it all of them will. I just don't know what the "feature" would be called.

解决方案

Actually, a Git repo hosting server will have another option with Git 2.10 (Q3 2016): push options.

See commit 3ac8703, commit f6a4e61, commit c714e45, commit 77a9745 (14 Jul 2016) by Stefan Beller (stefanbeller).

That feature was proposed in this thread:

git push origin HEAD:refs/for/master%draft%topic=example%cc=jon.doe@xxxxxxxxxxx
git push origin HEAD:refs/for/master \
  --push-option draft \
  --push-option topic=example \
  --push-option cc=jon.doe@xxxxxxxxxxx

这篇关于是否有替代“推”钩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 04:35