예제 #1
0
func AutoUpdateApply(ctx *cli.Context) {
	auth.AttemptLogin(ctx)
	project, err := models.GetProject(ctx.String("project"))
	utils.ExitIfErr(err)
	err = auApplyFunc(project.Slug, ctx.Args())
	utils.ExitIfErr(err)
}
예제 #2
0
func Configure(ctx *cli.Context) {
	slug := ctx.Args().First()
	project, err := models.GetProject(slug)
	utils.ExitIfErr(err)

	err = confFunc(project)
	utils.ExitIfErr(err)
}
예제 #3
0
func DependenciesPush(ctx *cli.Context) {
	project, err := models.GetProject()
	utils.ExitIfErr(err)
	var files []string
	if ctx.IsSet("files") {
		// Only call strings.Split on non-empty strings, otherwise len(strings) will be 1 instead of 0.
		files = strings.Split(ctx.String("files"), ",")
	}
	err = models.PushDependencyFiles(project.Slug, files)
	utils.ExitIfErr(err)
}
예제 #4
0
func ProjectsUpdate(ctx *cli.Context) {
	project, err := models.GetProject(ctx.Args().First())
	utils.ExitIfErr(err)
	var name, desc *string
	var monitored *bool
	if ctx.IsSet("name") {
		nameString := ctx.String("name")
		name = &nameString
	}
	if ctx.IsSet("desc") {
		descString := ctx.String("desc")
		desc = &descString
	}
	if ctx.IsSet("monitored") {
		mon := ctx.Bool("monitored")
		monitored = &mon
	}
	err = project.Update(name, desc, monitored)
	utils.ExitIfErr(err)
}
예제 #5
0
func DependencyAlertsList(ctx *cli.Context) {
	project, err := models.GetProject(ctx.Args().First())
	utils.ExitIfErr(err)
	err = models.ListDependencyAlerts(project)
	utils.ExitIfErr(err)
}
예제 #6
0
func DependencyFilesList(ctx *cli.Context) {
	project, err := models.GetProject()
	utils.ExitIfErr(err)
	err = models.ListDependencyFiles(project)
	utils.ExitIfErr(err)
}
예제 #7
0
func ProjectsSync(ctx *cli.Context) {
	project, err := models.GetProject(ctx.Args().First())
	utils.ExitIfErr(err)
	err = project.Sync()
	utils.ExitIfErr(err)
}