Refine CI build (#196)

* Refine CI build

remove vela binary build during e2e-test, instead
use the binary after make build

* update old command `vela system:init`
This commit is contained in:
Zheng Xi Zhou 2020-08-25 16:08:16 +08:00 committed by GitHub
parent 62937e1eb0
commit 8da6e93480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 17 deletions

View File

@ -34,6 +34,9 @@ jobs:
with:
version: "v0.7.0"
- name: Run Make
run: make
- name: Run e2e tests
run: |
make e2e-setup
@ -41,8 +44,5 @@ jobs:
make e2e-api-test
make e2e-cleanup
- name: Run Make
run: make
- name: Run Make test
run: make test

View File

@ -43,7 +43,7 @@ docker-push:
e2e-setup:
ginkgo version
ginkgo -v -r e2e/setup
/tmp/vela dashboard & # Somehow API server service doesn't start during setup in Github environment
bin/vela dashboard &
e2e-test:
# Run e2e test
@ -54,4 +54,4 @@ e2e-api-test:
ginkgo -v -r e2e/apiserver
e2e-cleanup:
# Clean up
# Clean up

View File

@ -7,23 +7,16 @@ import (
"strings"
"time"
"github.com/onsi/gomega"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega/gexec"
)
var (
rudrPath = "/tmp"
)
var rudrPath = GetCliBinary()
//GetCliBinary is to build rudr binary.
func GetCliBinary() (string, error) {
func GetCliBinary() string {
cwd, _ := os.Getwd()
mainPath := path.Join(cwd, "../../cmd/vela/main.go")
cmd := exec.Command("go", "build", "-o", path.Join(rudrPath, "vela"), mainPath)
_, err := cmd.Output()
return rudrPath, err
return path.Join(cwd, "../..", "./bin")
}
func Exec(cli string) (string, error) {
@ -45,8 +38,6 @@ func AsyncExec(cli string) (*gexec.Session, error) {
}
func BeforeSuit() {
_, err := GetCliBinary()
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Exec("vela system init")
//Without this line, will hit issue like `<string>: Error: unknown command "scale" for "vela"`
Exec("vela system update")