Created
July 18, 2014 01:46
-
-
Save jasonmoo/dff77e65230068ca001f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using goamz grab a region | |
region := ec2.New(aws.Auth{ | |
AccessKey: "XXXXXXX", | |
SecretKey: "XXXXXXX", | |
}, Instance_Region) | |
// get a list of public dns names by the server’s class | |
servers := pd.GetPublicDNS(region, Instance_ClassName) | |
// build a pool of servers and specify the concurrency | |
pool := pd.NewPool(Instance_User, Instance_PubKey, servers, DefaultConcurrency) | |
// build the target binary | |
pd.BuildGoBinary("$GOPATH/src/github.com/prevoty/testapp", "testapp", "linux", "amd64") | |
// ensure all ports are open | |
pool.WaitForPort(22) | |
// push the new binary | |
pd.Must(pool.Rsync("-az", "$GOPATH/src/github.com/prevoty/testapp/testapp", "/var/testapp/testapp")) | |
pd.Must(pool.Sudo("restart testapp") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment