From d4705380a8adac419fc70ca3624da5489ccccfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=85=83?= Date: Sat, 20 Mar 2021 18:36:51 +0800 Subject: [PATCH] remove dashboard related code --- .github/workflows/dashboard.yml | 26 -------------------------- .github/workflows/go.yml | 15 +++++++++++++++ .github/workflows/release.yml | 8 -------- references/cli/dashboard.go | 30 ++++++------------------------ references/cli/show.go | 19 +++++++++++++++++++ 5 files changed, 40 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/dashboard.yml diff --git a/.github/workflows/dashboard.yml b/.github/workflows/dashboard.yml deleted file mode 100644 index d1e2329f0..000000000 --- a/.github/workflows/dashboard.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Dashboard - -on: - push: - branches: [ master ] - pull_request: - branches: [master] - workflow_dispatch: {} - -defaults: - run: - working-directory: ./references/dashboard -jobs: - build: - runs-on: ubuntu-20.04 - strategy: - matrix: - node-version: [12.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8088851cd..d94739b9e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -312,3 +312,18 @@ jobs: - name: Check Diff run: make check-diff + + build-cli: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.14 + uses: actions/setup-go@v1 + with: + go-version: 1.14 + id: go + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Run cross-build + run: make cross-build + - name: Run compress binary + run: make compress \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad1b961ab..3783e1a79 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,18 +23,10 @@ jobs: - name: Get the version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} - - name: Use Node.js 10.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Run dashboard build - run: make dashboard-build - name: Tag helm chart image run: | sed -i 's/latest/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/values.yaml sed -i 's/0.1.0/${{ steps.get_version.outputs.VERSION }}/g' charts/vela-core/Chart.yaml - - name: Run generate-source - run: make generate-source - name: Run cross-build run: make cross-build - name: Run compress binary diff --git a/references/cli/dashboard.go b/references/cli/dashboard.go index 87845b35a..08bde05f3 100644 --- a/references/cli/dashboard.go +++ b/references/cli/dashboard.go @@ -7,10 +7,8 @@ import ( "io" "io/ioutil" "os" - "os/exec" "os/signal" "path/filepath" - "runtime" "strings" "syscall" "time" @@ -36,11 +34,12 @@ func NewDashboardCommand(c types.Args, ioStreams cmdutil.IOStreams, frontendSour var o Options o.frontendSource = frontendSource cmd := &cobra.Command{ - Hidden: true, - Use: "dashboard", - Short: "Setup API Server and launch Dashboard", - Long: "Setup API Server and launch Dashboard", - Example: `dashboard`, + Hidden: true, + Use: "dashboard", + Short: "Setup API Server and launch Dashboard", + Long: "Setup API Server and launch Dashboard", + Example: `dashboard`, + Deprecated: "vela dashboard is deprecated, it will only launch APIServer without dashboard", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { return c.SetConfig() }, @@ -200,23 +199,6 @@ func SetupAPIServer(c types.Args, cmd *cobra.Command, o Options) error { return server.Shutdown(ctx) } -// OpenBrowser will open browser by url in different OS system -// nolint:gosec -func OpenBrowser(url string) error { - var err error - switch runtime.GOOS { - case "linux": - err = exec.Command("xdg-open", url).Start() - case "windows": - err = exec.Command("cmd", "/C", "start", url).Run() - case "darwin": - err = exec.Command("open", url).Start() - default: - err = fmt.Errorf("unsupported platform") - } - return err -} - // CheckVelaRuntimeInstalledAndReady checks whether vela-core runtime is installed and ready func CheckVelaRuntimeInstalledAndReady(ioStreams cmdutil.IOStreams, c client.Client) (bool, error) { if !helm.IsHelmReleaseRunning(types.DefaultKubeVelaReleaseName, types.DefaultKubeVelaChartName, types.DefaultKubeVelaNS, ioStreams) { diff --git a/references/cli/show.go b/references/cli/show.go index 7a339a911..7637a2c14 100644 --- a/references/cli/show.go +++ b/references/cli/show.go @@ -7,8 +7,10 @@ import ( "io/ioutil" "net/http" "os" + "os/exec" "os/signal" "path/filepath" + "runtime" "syscall" "time" @@ -346,3 +348,20 @@ func showReferenceConsole(ctx context.Context, c types.Args, ioStreams cmdutil.I } return nil } + +// OpenBrowser will open browser by url in different OS system +// nolint:gosec +func OpenBrowser(url string) error { + var err error + switch runtime.GOOS { + case "linux": + err = exec.Command("xdg-open", url).Start() + case "windows": + err = exec.Command("cmd", "/C", "start", url).Run() + case "darwin": + err = exec.Command("open", url).Start() + default: + err = fmt.Errorf("unsupported platform") + } + return err +}