mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
@@ -48,18 +48,18 @@ func getVersion() string {
|
||||
if *sha != "" {
|
||||
return *sha
|
||||
}
|
||||
//check teamcity build version
|
||||
// check teamcity build version
|
||||
if v := os.Getenv("BUILD_VCS_NUMBER"); v != "" {
|
||||
return v
|
||||
}
|
||||
//check git
|
||||
// check git
|
||||
cmd := exec.Command("git", "rev-parse", "HEAD")
|
||||
v, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
ver := strings.TrimSpace(string(v))
|
||||
//see if dirty
|
||||
// see if dirty
|
||||
cmd = exec.Command("git", "diff-index", "--quiet", "HEAD", "--")
|
||||
err = cmd.Run()
|
||||
// exit status 1 indicates dirty tree
|
||||
|
||||
@@ -93,11 +93,15 @@ func generateFeatureMatrix() error {
|
||||
return ioutil.WriteFile("docs/_includes/matrix.html", buf.Bytes(), 0644)
|
||||
}
|
||||
|
||||
// FeatureDef describes features.
|
||||
type FeatureDef struct {
|
||||
Name, Desc string
|
||||
}
|
||||
|
||||
// FeatureMap maps provider names to compliance documentation.
|
||||
type FeatureMap map[string]*providers.DocumentationNote
|
||||
|
||||
// SetSimple configures a provider's setting in fm.
|
||||
func (fm FeatureMap) SetSimple(name string, unknownsAllowed bool, f func() bool) {
|
||||
if f() {
|
||||
fm[name] = &providers.DocumentationNote{HasFeature: true}
|
||||
@@ -106,6 +110,7 @@ func (fm FeatureMap) SetSimple(name string, unknownsAllowed bool, f func() bool)
|
||||
}
|
||||
}
|
||||
|
||||
// FeatureMatrix describes features and which providers support it.
|
||||
type FeatureMatrix struct {
|
||||
Features []FeatureDef
|
||||
Providers map[string]FeatureMap
|
||||
|
||||
@@ -124,7 +124,7 @@ func init() {
|
||||
hc := oauth2.NewClient(context.Background(), oauth2.StaticTokenSource(&oauth2.Token{AccessToken: string(t)}))
|
||||
client = github.NewClient(hc)
|
||||
|
||||
//get current version if in travis build
|
||||
// get current version if in travis build
|
||||
if tc := os.Getenv("TRAVIS_COMMIT"); tc != "" {
|
||||
commitish = tc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user