Skip to content

Commit

Permalink
Update remote add prompts and output, update readme for walkthru
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Jan 25, 2018
1 parent 1c8e0ea commit 91c308f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ Inside of a git repository, run the following:
```bash
$> inertia init

$> inertia remote add glcoud 35.227.171.49 -u root -i /path/to/my/.ssh/id_rsa
Remote 'glcoud' added.
$> inertia remote add gcloud
Enter location of PEM file (leave blank to use '/Users/yourspecialname/.ssh/id_rsa'):
/path/to/my/.ssh/id_rsa
Enter IP address of remote:
35.227.171.49
Enter user:
root
Remote 'gcloud' added.
You can now run 'inertia gcloud init' to set this remote
up for continuous deployment.
Enter IP address of remote:
35.227.171.49
Port 8081 will be used as the daemon port.
Run this 'inertia remote add' with the -p flag to set a custom port.

Remote 'gcloud' has been added!
You can now run 'inertia gcloud init' to set this remote up
for continuous deployment.

$> inertia gcloud init
Bootstrapping remote
Expand Down
4 changes: 0 additions & 4 deletions client/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ func AddNewRemote(name, IP, user, pemLoc, port string) error {
return err
}

println("Remote '" + name + "' added.")
println("You can now run 'inertia " + name + " init' to set this remote")
println("up for continuous deployment.")

return nil
}

Expand Down
20 changes: 13 additions & 7 deletions cmd/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,37 @@ file. Specify a VPS name.`,
defaultSSHLoc := filepath.Join(sshDir, "id_rsa")

var response string
fmt.Println("Enter location of PEM file (leave blank to use '" + defaultSSHLoc + "'): ")
fmt.Println("Enter location of PEM file (leave blank to use '" + defaultSSHLoc + "'):")
_, err = fmt.Scanln(&response)
if err != nil {
response = defaultSSHLoc
}
pemLoc := response

fmt.Printf("Enter IP address of remote: \n")
fmt.Println("Enter user:")
_, err = fmt.Scanln(&response)
if err != nil {
log.Fatal("That is not a valid IP address - please try again.")
log.Fatal("That is not a valid user - please try again.")
}
address := response
user := response

fmt.Printf("Enter user: \n")
fmt.Println("Enter IP address of remote:")
_, err = fmt.Scanln(&response)
if err != nil {
log.Fatal("That is not a valid user - please try again.")
log.Fatal("That is not a valid IP address - please try again.")
}
user := response
address := response
fmt.Println("Port " + port + " will be used as the daemon port.")
fmt.Println("Run this 'inertia remote add' with the -p flag to set a custom port.")

err = client.AddNewRemote(args[0], address, user, pemLoc, port)
if err != nil {
log.WithError(err)
}

fmt.Println("\nRemote '" + args[0] + "' has been added!")
fmt.Println("You can now run 'inertia " + args[0] + " init' to set this remote up")
fmt.Println("for continuous deployment.")
},
}

Expand Down

0 comments on commit 91c308f

Please sign in to comment.