Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #10 from pantheon-systems/max-github-versions
Browse files Browse the repository at this point in the history
Max GitHub versions
  • Loading branch information
spheromak authored Jul 22, 2016
2 parents 30ef5bb + 142a02b commit fa9913c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 14 additions & 13 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ import (
"github.com/jessevdk/go-flags"
)

// CLI Options
// Options describes all the cli flags that can be passed
type Options struct {
Port int `short:"p" long:"port" description:"Port to listen on" default:"443" env:"BARYON_PORT"`
Bind string `short:"b" long:"bind" description:"Ip address to bind to" default:"0.0.0.0" env:"BARYON_BIND"`
Secret string `short:"s" long:"secret" description:"The web-hook secret" env:"BARYON_HOOK_SECRET"`
Key string `short:"k" long:"key" description:"Specify a Key file to enable server to start TLS" env:"BARYON_KEY"`
Cert string `short:"c" long:"cert" description:"Cert file for TLS" env:"BARYON_CERT"`
Org string `short:"o" long:"org" description:"Github Org to find cookbooks" env:"BARYON_GITHUB_ORG"`
Token string `short:"t" long:"token" description:"Github API token to use when connecting" env:"BARYON_GITHUB_TOKEN"`
SyncInterval time.Duration `short:"i" long:"interval" description:"Interval to perform full sync against github repos. Supports Golang duration formatting '1h2m'... etc." default:"12h" env:"BARYON_INTERVAL"`
NoSync bool `long:"no-sync" description:"Do NOT perform a github scan/sync when starting. Periodic sync will still fire" env:"BARYON_NOSYNC"`
BerksOnly bool `long:"berks-only" description:"Only use berks compatable version tags in the universe" env:"BARYON_BERKSONLY"`
TLS bool
Port int `short:"p" long:"port" description:"Port to listen on" default:"443" env:"BARYON_PORT"`
Bind string `short:"b" long:"bind" description:"Ip address to bind to" default:"0.0.0.0" env:"BARYON_BIND"`
Secret string `short:"s" long:"secret" description:"The web-hook secret" env:"BARYON_HOOK_SECRET"`
Key string `short:"k" long:"key" description:"Specify a Key file to enable server to start TLS" env:"BARYON_KEY"`
Cert string `short:"c" long:"cert" description:"Cert file for TLS" env:"BARYON_CERT"`
Org string `short:"o" long:"org" description:"Github Org to find cookbooks" env:"BARYON_GITHUB_ORG"`
Token string `short:"t" long:"token" description:"Github API token to use when connecting" env:"BARYON_GITHUB_TOKEN"`
SyncInterval time.Duration `short:"i" long:"interval" description:"Interval to perform full sync against github repos. Supports Golang duration formatting '1h2m'... etc." default:"12h" env:"BARYON_INTERVAL"`
NoSync bool `long:"no-sync" description:"Do NOT perform a github scan/sync when starting. Periodic sync will still fire" env:"BARYON_NOSYNC"`
BerksOnly bool `long:"berks-only" description:"Only use berks compatable version tags in the universe" env:"BARYON_BERKSONLY"`
MaxGithubVersions int `logn:"max-github-versions" description:"Max number of versions to scan when looking at github repos" default:"20" env:"BARYON_MAX_VERSIONS"`
TLS bool
}

// Opts is the application config struct
// Opts is the application config struct that we allow external access too
var Opts Options

func init() {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
Token: config.Opts.Token,
Org: config.Opts.Org,
SyncInterval: config.Opts.SyncInterval,
MaxVersions: 5,
MaxVersions: config.Opts.MaxGithubVersions,
}
ghs := gh.New(ghsConfig, u)
var wg sync.WaitGroup
Expand Down

0 comments on commit fa9913c

Please sign in to comment.