namshi/godo

Name: godo

Owner: Namshi

Description: Remote and local execution level 9000: go and do stuff.

Created: 2015-04-17 10:55:48.0

Updated: 2018-05-02 08:49:44.0

Pushed: 2015-07-09 05:47:46.0

Homepage:

Size: 2586

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

godo

Local and remote execution level 9000: go and do stuff.

example

godo is a very simple yet powerful tool that let's you specify a list of repetitive / useful commands you run on remote hosts or even locally, and run them with ease, without having to remember them or, even worse, login on each server and execute them manually.

Installation

Grab the latest release and simply run the executable:

ojects/namshi/godo (master ?)? ? ./godo
:
odo - Stop SSHing into your server and run the same old commands. Automate. Automate. Automate.

E:
odo [global options] command [command options] [arguments...]

ION:
.Y.Z

OR(S): 

ANDS:
elp, h  Shows a list of commands or help for one command
ptime   Retrieves uptime info for all machines
low-queries mysql-log -n 10
ginx-logs   sudo tail -10f /var/log/nginx/access.log

AL OPTIONS:
-help, -h           show help
-version, -v        print the version

ojects/namshi/godo (master ?)? ? ./godo uptime
uting 'uptime'
and: 'uptime'
uting on servers web, db



Usage

Create a godo.yml file and put it in your home directory:

ers:
b:
address: "xxx.xxx.xx.xxx:22"
user:    "me"
:
address: "xxx.xxx.xx.xxx:22"
tunnel:  "tunnel.yourcompany.com:22"
user:    "me"
ps:
l: [web, db]
ands:
time:
target:       all
exec:         "uptime"  
description:  "Retrieves uptime info for all machines"  
ow-queries:
target: db
exec: "mysql-log -n 10"
inx-logs:
target: web
exec: "sudo tail -10f /var/log/nginx/access.log"
-uptime:
target:       local
exec:         "uptime"  
description:  "Retrieves uptime info for the current machine"  
file: "/home/YOU/.ssh/known_hosts"
out: 2

There are a few sections to keep in mind:

Godo will try to read the godo.yml configuration file from 3 different directories:

but you can also specify the path to a different configuration file with the -c or --config flags:

 -c ./../my-config.yml mysql-log

Sometimes, though, you might want to run a command that you usually execute on some servers on a different server, and you can do it by simply specifying it from the command line:

 uptime @ db



 uptime@db

Godo provides some special groups:

Additional documentation

You can run the docs through godoc -http=:6060 -path=..

Gotchas

Currently all servers need to be in your known_hosts file (ie. you have to have SSHed into them at least once before using them with godo).

Compiling

Alternatively, you can run and compile godo on your own machine with a simple go build -o godo main.go.

At the same time, we provide a simple docker container to run and compile it so that you don't have to go to crazy if you don't have Go running on your system:

clone https://github.com/namshi/godo.git

odo

er-compose run godo gox --output=build/{{.OS}}_{{.Arch}}/{{.Dir}}

do

The above command will compile the godo executables (for various platforms) in the build folder.

We use a simple makefile to create new releases and yoou can probably do the same: just run make in the root of the repo and check the build folder. This requires that docker and docker-compose are installed on your system.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.