This is a huge commit, it does following things: (#1942)
1. Remove ks-iam standalone binary, move it to ks-apiserver 2. Generate all devops apis inside kubesphere repository, no need to import s2ioperator. 3. Reorganize ldap code, make it more flexible to use.
This commit is contained in:
74
vendor/openpitrix.io/openpitrix/pkg/version/gen_helper.go
generated
vendored
74
vendor/openpitrix.io/openpitrix/pkg/version/gen_helper.go
generated
vendored
@@ -1,74 +0,0 @@
|
||||
// Copyright 2018 The OpenPitrix Authors. All rights reserved.
|
||||
// Use of this source code is governed by a Apache license
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
version, gitSha1Version := getAppVersion()
|
||||
buildTime := time.Now().Format("2006-01-02 15:04:05")
|
||||
|
||||
data := make_update_version_go_file(version, gitSha1Version, buildTime)
|
||||
|
||||
err := ioutil.WriteFile("./z_update_version.go", []byte(data), 0666)
|
||||
if err != nil {
|
||||
log.Fatalf("ioutil.WriteFile: err = %v", err)
|
||||
}
|
||||
|
||||
fmt.Printf("%s (%s)\n", version, gitSha1Version)
|
||||
fmt.Println(buildTime)
|
||||
}
|
||||
|
||||
func make_update_version_go_file(version, gitSha1Version, buildTime string) string {
|
||||
return fmt.Sprintf(`// Copyright 2018 The OpenPitrix Authors. All rights reserved.
|
||||
// Use of this source code is governed by a Apache license
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// Auto generated by 'go run gen_helper.go', DO NOT EDIT.
|
||||
|
||||
package version
|
||||
|
||||
func init() {
|
||||
ShortVersion = "%s"
|
||||
GitSha1Version = "%s"
|
||||
BuildDate = "%s"
|
||||
}
|
||||
`,
|
||||
version,
|
||||
gitSha1Version,
|
||||
buildTime,
|
||||
)
|
||||
}
|
||||
|
||||
func getAppVersion() (version, gitSha1Version string) {
|
||||
// VERSION=`git describe --tags --always --dirty="-dev"`
|
||||
versionData, err := exec.Command(
|
||||
`git`, `describe`, `--tags`, `--always`, `--dirty=-dev`,
|
||||
).CombinedOutput()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// GIT_SHA1=`git show --quiet --pretty=format:%H`
|
||||
gitSha1VersionData, err := exec.Command(
|
||||
`git`, `show`, `--quiet`, `--pretty=format:%H`,
|
||||
).CombinedOutput()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
version = strings.TrimSpace(string(versionData))
|
||||
gitSha1Version = strings.TrimSpace(string(gitSha1VersionData))
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user