-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manage DNS records #63
Comments
Juan! Great idea. Here's the general overview for how the tugboat internals work. There are 4 main components you need to understand: CLI InterfaceWe use a ruby gem called thor to handle the nitty gritty of the command line interface. This includes options ( Here's an example of a command in the CLI interface: https://github.com/pearkes/tugboat/blob/master/lib/tugboat/cli.rb#L302-L323 Middleware SequencesThe CLI interface calls a middleware sequence, in this case: https://github.com/pearkes/tugboat/blob/master/lib/tugboat/middleware.rb#L220-L228 That file autoloads a bunch of middleware classes...we call those steps in this case. Middleware StepsEach step is pretty simple. You call it like this, and then the actual step looks like so: https://github.com/pearkes/tugboat/blob/master/lib/tugboat/middleware/wait_for_state.rb "Environment"All of this middleware requires something like "shared state". Basically, if I'm going to call the You'll also need to interact with the digital_ocean gem, which is how we talk to the DO API. You can see examples of that in just about every step. Hope that helps! Let me know if things are still unclear. :) |
This is a nice addition. But really painful to deploy some UI as CLI for this. |
@nofxx I would typically prefer to just abuse their API for this – just as we do with the droplets. But, I see the point you have on how complex it would get. Could we do something like:
Which would add an A record? We could start with minimal feature set – i.e just adding/overwriting records for existing domains, the most common use case. |
I'd suggest to use CloudFlafre API for DNS and DDoS/CDN support, not Digital Ocean (BTW they use CloudFlare too) |
It would be nice be able to manage DNS records using tugboat too
I am doing a workaround (sorry not good at ruby) right now using:
tugboat create server.domain.tld -i 303619 -r 2 -k 32527
Wait till server becomes active:
tugboat wait server.domain.tld --state active
Get the IP address from
tugboat info "#{SERVER_TO_DEPLOY}" |grep IP|awk {'print $2'}
And then use a curl script (using digital ocean API) to update DNS records.
I forked the repository to see if I can do it by myself but I don't know where to start.
Any tip or idea?
Thanks for your time
The text was updated successfully, but these errors were encountered: