-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
22 lines (18 loc) · 990 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package scalingo_deployer
import "strings"
type Config struct {
GithubOwnerRepo string `split_words:"true" required:"true" desc:"github repo in owner/repo format"`
GithubAPIToken string `split_words:"true" required:"true" desc:"github API token with read access to github repo content"`
GitRef string `split_words:"true" required:"true" desc:"the git reference to deploy"`
ScalingoAPIEndpoint string `split_words:"true" required:"true" default:"https://api.osc-fr1.scalingo.com" desc:"the scalingo API endpoint to use"`
ScalingoApp string `split_words:"true" required:"true" desc:"the name of the scalingo app to deploy"`
ScalingoAPIToken string `split_words:"true" required:"true" desc:"the scalingo API token to use"`
}
func (config *Config) GithubOwner() string {
s := strings.SplitN(config.GithubOwnerRepo, "/", 2)
return s[0]
}
func (config *Config) GithubRepo() string {
s := strings.SplitN(config.GithubOwnerRepo, "/", 2)
return s[1]
}