-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
4,693 additions
and
98 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM scratch | ||
MAINTAINER Gemnasium "[email protected]" | ||
ADD ca-certificates.crt /etc/ssl/certs/ | ||
ADD toolbelt /toolbelt | ||
ENTRYPOINT ["/toolbelt"] |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/codegangsta/cli" | ||
"github.com/gemnasium/toolbelt/auth" | ||
"github.com/gemnasium/toolbelt/utils" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
var login = func() error { | ||
return auth.Login() | ||
} | ||
|
||
// auth.Login wrapper with a cli.Content | ||
func Login(ctx *cli.Context) { | ||
func Login(ctx *cli.Context) error { | ||
err := login() | ||
utils.ExitIfErr(err) | ||
if err != nil { | ||
return cli.NewExitError(err.Error(), 1) | ||
} | ||
return nil | ||
} | ||
|
||
var logout = func() error { | ||
return auth.Logout() | ||
} | ||
|
||
// auth.Logout wrapper with a cli.Content | ||
func Logout(ctx *cli.Context) { | ||
func Logout(ctx *cli.Context) error { | ||
err := logout() | ||
utils.ExitIfErr(err) | ||
if err != nil { | ||
return cli.NewExitError(err.Error(), 1) | ||
} | ||
return nil | ||
} |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/codegangsta/cli" | ||
"github.com/gemnasium/toolbelt/models" | ||
"github.com/gemnasium/toolbelt/utils" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
func DependenciesList(ctx *cli.Context) { | ||
func DependenciesList(ctx *cli.Context) error { | ||
project, err := models.GetProject(ctx.Args().First()) | ||
utils.ExitIfErr(err) | ||
if err != nil { | ||
return cli.NewExitError(err.Error(), 1) | ||
} | ||
err = models.ListDependencies(project) | ||
utils.ExitIfErr(err) | ||
if err != nil { | ||
return cli.NewExitError(err.Error(), 1) | ||
} | ||
return nil | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/codegangsta/cli" | ||
"github.com/gemnasium/toolbelt/models" | ||
"github.com/gemnasium/toolbelt/utils" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
func DependencyAlertsList(ctx *cli.Context) { | ||
func DependencyAlertsList(ctx *cli.Context) error { | ||
project, err := models.GetProject(ctx.Args().First()) | ||
utils.ExitIfErr(err) | ||
if err != nil { | ||
return cli.NewExitError(err.Error(), 1) | ||
} | ||
|
||
err = models.ListDependencyAlerts(project) | ||
utils.ExitIfErr(err) | ||
if err != nil { | ||
return cli.NewExitError(err.Error(), 1) | ||
} | ||
return nil | ||
} |
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
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
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
Oops, something went wrong.