mirror of
https://github.com/strongdm/comply
synced 2024-11-05 07:25:26 +00:00
fmt
This commit is contained in:
parent
2e9f6cf270
commit
3711e0054d
@ -22,8 +22,8 @@ import (
|
|||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/strongdm/comply/internal/config"
|
"github.com/strongdm/comply/internal/config"
|
||||||
"github.com/strongdm/comply/internal/jira"
|
|
||||||
"github.com/strongdm/comply/internal/gitlab"
|
"github.com/strongdm/comply/internal/gitlab"
|
||||||
|
"github.com/strongdm/comply/internal/jira"
|
||||||
"github.com/strongdm/comply/internal/plugin/github"
|
"github.com/strongdm/comply/internal/plugin/github"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
@ -33,11 +33,11 @@ func SetProjectRoot(dir string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Project struct {
|
type Project struct {
|
||||||
Name string `yaml:"name"`
|
Name string `yaml:"name"`
|
||||||
Pandoc string `yaml:"pandoc,omitempty"`
|
Pandoc string `yaml:"pandoc,omitempty"`
|
||||||
FilePrefix string `yaml:"filePrefix"`
|
FilePrefix string `yaml:"filePrefix"`
|
||||||
Tickets map[string]interface{} `yaml:"tickets"`
|
Tickets map[string]interface{} `yaml:"tickets"`
|
||||||
ApprovedBranch string `yaml:"approvedBranch"`
|
ApprovedBranch string `yaml:"approvedBranch"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetPandoc records pandoc availability during initialization
|
// SetPandoc records pandoc availability during initialization
|
||||||
|
@ -5,21 +5,21 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/xanzy/go-gitlab"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/strongdm/comply/internal/model"
|
"github.com/strongdm/comply/internal/model"
|
||||||
|
"github.com/xanzy/go-gitlab"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
cfgDomain = "domain"
|
cfgDomain = "domain"
|
||||||
cfgToken = "token"
|
cfgToken = "token"
|
||||||
cfgRepo = "repo"
|
cfgRepo = "repo"
|
||||||
)
|
)
|
||||||
|
|
||||||
var prompts = map[string]string{
|
var prompts = map[string]string{
|
||||||
cfgDomain: "Fully Qualified GitLab Domain",
|
cfgDomain: "Fully Qualified GitLab Domain",
|
||||||
cfgToken: "GitLab Token",
|
cfgToken: "GitLab Token",
|
||||||
cfgRepo: "GitLab Repository",
|
cfgRepo: "GitLab Repository",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prompts are human-readable configuration element names
|
// Prompts are human-readable configuration element names
|
||||||
@ -137,10 +137,10 @@ func (g *gitlabPlugin) LinkFor(t *model.Ticket) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *gitlabPlugin) Create(ticket *model.Ticket, labels []string) error {
|
func (g *gitlabPlugin) Create(ticket *model.Ticket, labels []string) error {
|
||||||
options := &gitlab.CreateIssueOptions{
|
options := &gitlab.CreateIssueOptions{
|
||||||
Title: gitlab.String(ticket.Name),
|
Title: gitlab.String(ticket.Name),
|
||||||
Description: gitlab.String(ticket.Body),
|
Description: gitlab.String(ticket.Body),
|
||||||
Labels: labels,
|
Labels: labels,
|
||||||
}
|
}
|
||||||
_, _, err := g.api().Issues.CreateIssue(g.reponame, options)
|
_, _, err := g.api().Issues.CreateIssue(g.reponame, options)
|
||||||
return err
|
return err
|
||||||
|
@ -88,7 +88,7 @@ func GetPlugin(ts TicketSystem) TicketPlugin {
|
|||||||
cfgStringed[kS] = v
|
cfgStringed[kS] = v
|
||||||
}
|
}
|
||||||
err := tp.Configure(cfgStringed)
|
err := tp.Configure(cfgStringed)
|
||||||
if( err != nil) {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("Configuration error `%s` in project YAML", err))
|
panic(fmt.Sprintf("Configuration error `%s` in project YAML", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user