Skip to content

Commit

Permalink
Clarify variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed May 15, 2018
1 parent 0d0b6a1 commit 195130d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions client/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ func (remote *RemoteVPS) Bootstrap(runner SSHSession, name string, config *Confi

repo, err := common.GetLocalRepo()
origin, err := repo.Remote("origin")
projectName := common.Extract(common.GetSSHRemoteURL(origin.Config().URLs[0]))
repoName := common.Extract(common.GetSSHRemoteURL(origin.Config().URLs[0]))

// Output deploy key to user.
println(">> GitHub Deploy Key (add to https://www.github.com/" + projectName + "/settings/keys/new): ")
println(">> GitHub Deploy Key (add to https://www.github.com/" + repoName + "/settings/keys/new): ")
println(pub.String())

// Output Webhook url to user.
println(">> GitHub WebHook URL (add to https://www.github.com/" + repoName + "/settings/hooks/new): ")
println("WebHook Address: https://" + remote.IP + ":" + remote.Daemon.Port + "/webhook")
println(">> GitHub WebHook URL (add to https://www.github.com/" + projectName + "/settings/hooks/new): ")
println("WebHook Secret: " + remote.Daemon.Secret)
println(`Note that you will have to disable SSH verification in your webhook
settings - Inertia uses self-signed certificates that GitHub won't
Expand Down
6 changes: 3 additions & 3 deletions common/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
)

var urlVariations = []string{
var remoteURLVariations = []string{
"git@github.com:ubclaunchpad/inertia.git",
"https://github.com/ubclaunchpad/inertia.git",
"git://github.com/ubclaunchpad/inertia.git",
Expand All @@ -24,8 +24,8 @@ func TestCheckForGit(t *testing.T) {
}

func TestGetSSHRemoteURL(t *testing.T) {
for _, url := range urlVariations {
assert.Equal(t, urlVariations[0], GetSSHRemoteURL(url))
for _, url := range remoteURLVariations {
assert.Equal(t, remoteURLVariations[0], GetSSHRemoteURL(url))
}
}

Expand Down
6 changes: 4 additions & 2 deletions common/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ const (
// MsgDaemonOK is the OK response upon successfully reaching daemon
MsgDaemonOK = "I'm a little Webhook, short and stout!"

// Constants used in HTTP GET query strings
// Container is a constant used in HTTP GET query strings
Container = "container"
Stream = "stream"

// Stream is a constant used in HTTP GET query strings
Stream = "stream"
)

// DaemonRequest is the configurable body of a request to the daemon.
Expand Down
2 changes: 1 addition & 1 deletion common/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestFlushRoutine(t *testing.T) {
}

func TestExtract(t *testing.T) {
for _, url := range urlVariations {
for _, url := range remoteURLVariations {
assert.Equal(t, "ubclaunchpad/inertia", Extract(url))
}
}

0 comments on commit 195130d

Please sign in to comment.