Example #1
0
func New(t testing.TB) *tugboat.Tugboat {
	config := tugboat.Config{}
	config.DB = "postgres://localhost/tugboat?sslmode=disable"

	tug, err := tugboat.New(config)
	if err != nil {
		t.Fatal(err)
	}
	tug.Providers = []tugboat.Provider{fake.NewProvider()}

	if err := tug.Reset(); err != nil {
		t.Fatal(err)
	}

	return tug
}
Example #2
0
func newTugboat(c *cli.Context) (*tugboat.Tugboat, error) {
	config := tugboat.Config{}
	config.DB = c.String("db.url")
	config.Pusher.URL = c.String("pusher.url")
	config.GitHub.Token = c.String("github.token")
	config.ProviderSecret = []byte(c.String("provider.secret"))

	tug, err := tugboat.New(config)
	if err != nil {
		return tug, err
	}

	ps, err := newProviders(c)
	if err != nil {
		return tug, err
	}

	tug.Providers = ps
	tug.MatchEnvironment = c.String("environment")

	return tug, nil
}