mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Build local go components as well as a release
This commit is contained in:
parent
e3fc475b07
commit
6befc75da5
15
hack/e2e.go
15
hack/e2e.go
@ -72,7 +72,10 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if *build {
|
if *build {
|
||||||
if !runBash("build", `test-build-release`) {
|
if !run("build-local", "hack/build-go.sh") {
|
||||||
|
log.Fatal("Error building. Aborting.")
|
||||||
|
}
|
||||||
|
if !runBash("build-release", `test-build-release`) {
|
||||||
log.Fatal("Error building. Aborting.")
|
log.Fatal("Error building. Aborting.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,9 +160,17 @@ func Test() (failed, passed []string) {
|
|||||||
// All nonsense below is temporary until we have go versions of these things.
|
// All nonsense below is temporary until we have go versions of these things.
|
||||||
|
|
||||||
func runBash(stepName, bashFragment string) bool {
|
func runBash(stepName, bashFragment string) bool {
|
||||||
log.Printf("Running: %v", stepName)
|
|
||||||
cmd := exec.Command("bash", "-s")
|
cmd := exec.Command("bash", "-s")
|
||||||
cmd.Stdin = strings.NewReader(bashWrap(bashFragment))
|
cmd.Stdin = strings.NewReader(bashWrap(bashFragment))
|
||||||
|
return finishRunning(stepName, cmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func run(stepName, cmdPath string) bool {
|
||||||
|
return finishRunning(stepName, exec.Command(filepath.Join(*root, cmdPath)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func finishRunning(stepName string, cmd *exec.Cmd) bool {
|
||||||
|
log.Printf("Running: %v", stepName)
|
||||||
stdout, stderr := bytes.NewBuffer(nil), bytes.NewBuffer(nil)
|
stdout, stderr := bytes.NewBuffer(nil), bytes.NewBuffer(nil)
|
||||||
if *verbose {
|
if *verbose {
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user