Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: improved returns, debugging output #593

Merged
merged 13 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
install:
- go get github.com/golang/dep/cmd/dep
- dep ensure -v # cache vendor
- make daemon # cache daemon image
- make daemon TAG=test # cache daemon image
- make web-deps # cache node_modules

############################
Expand Down
74 changes: 30 additions & 44 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

[[constraint]]
name = "github.com/gorilla/websocket"
version = "1.2.0"
version = "1.4.0"

[[constraint]]
name = "github.com/aws/aws-sdk-go"
Expand Down
5 changes: 3 additions & 2 deletions client/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Use 'inertia %s logs' to check on the daemon's setup progress.

// Output deploy key to user
fmt.Fprintf(out, ">> GitHub Deploy Key (add to https://www.github.com/%s/settings/keys/new):\n", repo)
fmt.Fprint(out, pub.String()+"\n")
fmt.Fprint(out, pub+"\n")

// Output Webhook url to user
var addr, _ = c.Remote.DaemonAddr()
Expand All @@ -69,6 +69,7 @@ verify.`, repo, addr, c.Remote.Daemon.WebHookSecret)
Inertia daemon successfully deployed! Add your webhook url and deploy key to
your repository to enable continuous deployment.

Then run 'inertia %s up' to deploy your application.`, name)
Then run 'inertia %s up' to deploy your application.
`, name)
return nil
}
16 changes: 9 additions & 7 deletions client/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package bootstrap

import (
"net/http"
"context"
"os"
"testing"
"time"
Expand All @@ -17,7 +17,8 @@ import (

func newIntegrationClient() *client.Client {
remote := &cfg.Remote{
IP: "127.0.0.1",
Version: "test",
IP: "127.0.0.1",
SSH: &cfg.SSH{
IdentityFile: "../../test/keys/id_rsa",
User: "root",
Expand All @@ -28,8 +29,9 @@ func newIntegrationClient() *client.Client {
},
}
return client.NewClient(remote, client.Options{
SSH: runner.SSHOptions{},
Out: os.Stdout,
SSH: runner.SSHOptions{},
Out: os.Stdout,
Debug: true,
})
}

Expand All @@ -39,13 +41,13 @@ func TestBootstrap_Integration(t *testing.T) {
}

var c = newIntegrationClient()
assert.NoError(t, SetUpRemote(os.Stdout, "test", "", c))
assert.NoError(t, SetUpRemote(os.Stdout, "test-remote", "", c))

// Daemon setup takes a bit of time - do a crude wait
time.Sleep(3 * time.Second)

// Check if daemon is online following bootstrap
resp, err := c.Status()
status, err := c.Status(context.Background())
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
assert.Equal(t, "test", status.InertiaVersion)
}
Loading