Comments (9)
Yes, I believe this is covered by the hooks
configuration of each repo. You configure the post-receive hook in Github or whatever to hit that web endpoint exposed by git2consul. Then, as soon as a commit is merged into a branch tracked by git2consul, the hook will notify git2consul and the appropriate action will be taken.
If that doesn't cover your use-case, please explain what I'm missing.
from git2consul.
I guess I could just write a simple post-receive hook which uses curl
to hit the git2consul server. But if the repo is local to the server where I want to execute git2consul, it seems like there's no need for a server at all and I should just be able to call some executable to perform the changes. If that's not possible, I suppose it's not a big concern. It would just be nice not to have to deal with an additional server if it's not necessary.
from git2consul.
Ahh, I understand now. Let me give that some thought.
from git2consul.
I could see one or two ways to handle this. One is providing a simple webhook endpoint for git2consul (rather than the Stash / BitBucket / Github ones which expect certain formatting of an input POST). Then you could write a curl
command, but it would be something obvious like curl -XPUT http://localhost/[branch_name]/
with a body like commit_id=abba1234cdecde
. I like HTTP as the default means of sending commands to git2consul, so having curl be the thing your git hook calls feels OK to me.
Another option would be to allow git2consul to be pinged via signal, but there are a few issues with that. One is that a SIGHUP works fine on Unix but will terminate git2consul on Windows. The other is that a signal doesn't tell us which branch to update, so we would need to update all branches for all repos. Not the end of the world by any means, but it does feel like a broad brush.
Thoughts?
from git2consul.
How hard would it be to just not require the daemon to exist at all and have a separate binary which simply performs the updates when it runs?
from git2consul.
Ahh, a -runonce
kind of option. I like that.
from git2consul.
Turns out that this is how git2consul works if you haven't registered any web listeners or polling hooks: it'll terminate as soon as all git -> consul operations are complete. The above patch gives us an option to make that behavior explicit.
from git2consul.
Let me know if this doesn't match your use case.
Thanks!
from git2consul.
I haven't had a chance to test this out, but it seems like it would do exactly what I was going for. Thanks!
from git2consul.
Related Issues (20)
- Git2consul Generates PUT GET every 2 seconds on local agent. Why is that?
- How to configure parameters to use consul with HTTPS? HOT 1
- Problem synchronizing binary files
- git2consul is not converting .json file to KV entry in consul HOT 3
- git2consul problem does not cause Docker container to exit HOT 4
- Project status, new official fork? HOT 6
- Getting [Error: consul: kv.get: connect ECONNREFUSED] HOT 1
- Update of git files trigger unwanted delete of similar key name in consul
- support unix socket?
- files in git not within source_root forcing check_pending to setLastProcessedRef HOT 1
- Files not in source_root are killing my consul API. HOT 1
- support_tags should have option for "true", "false", and "read_once"
- git2consul not importing list in yaml HOT 1
- Git2Consul tool not supported for Google Cloud Run
- Windows - running example sync content of git2consul.json intro Consul KV
- readme - link to gitlab docs is broken
- a key for an annotation with slash in the name
- Is there a way to run git2consul as a CLI tool and not as a service? HOT 2
- panic: runtime error: invalid memory address or nil pointer dereference
- reference not found error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git2consul.