-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.go
More file actions
30 lines (26 loc) · 920 Bytes
/
config.go
File metadata and controls
30 lines (26 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package gitreceive
import (
"strings"
)
type Config struct {
// k8s service discovery env vars
WorkflowHost string `envconfig:"deis_workflow_service_host"`
WorkflowPort string `envconfig:"deis_workflow_service_port"`
RegistryHost string `envconfig:"deis_registry_service_host"`
RegistryPort string `envconfig:"deis_registry_service_port"`
GitHome string `envconfig:"git_home"`
SSHConnection string `envconfig:"ssh_connection"`
SSHOriginalCommand string `envconfig:"ssh_original_command"`
Repository string `envconfig:"repository"`
SHA string `envconfing:"sha"`
Username string `envconfig:"username"`
Fingerprint string `envconfing:"fingerprint"`
PodNamespace string `envconfig:"pod_namespace"`
}
func (c Config) App() string {
li := strings.LastIndex(c.Repository, ".")
if li == -1 {
return c.Repository
}
return c.Repository[0:li]
}