4 ms·
Have an uber-script which allows the various other scripts to register with it and provide the namespace, command, help data, args, etc. Let's say our project
by oh_sigh 8y ago
Have an uber-script which allows the various other scripts to register with it and provide the namespace, command, help data, args, etc.
Let's say our project is called cob, so typing `cob` would print a help screen of all the tools it knows about. typing 'cob db' would show all of the tools in the db namespace. For simplicity there is only one level of namespaces allowed. Anything under that is a command in that namespace - eg 'cob db recompute_index --column=foo' to recompute an index, 'cob deploy show_live_version --prod' to show whats in prod right now, etc.
If you're doing a task and think a tool might be available, searching through a limited set of tools based on the likely namespace and with simple help text makes it easy to find.
- tdumitrescu 8y agoIn Python world, we've had some success using Click (http://click.pocoo.org/ http://click.pocoo.org/) this way, and for SSH-heavy workloads Fabric (http://www.fabfile.org http://www.fabfile.org).
- neduma 8y agoWe ssh-heavy workload, we use ansible. We have jenkins master with dokerized slaves where we throw the scripts in dockerized containers
- candreasen 8y agoThis is the most interesting way of doing it I've seen. How would this be configured/the scripts distributed?
- oh_sigh 8y agoTwo ways I've done in the past: have a resolver in the master script which knows how to crawl your source tree(s) and detect the appropriate tagging in specific programs, or have each program get registered in a config script that the master reads from. I live in a world where we're expected to be synced to head in a monorepo, so distribution is easy for me.