Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: remove bb and sql service CLI (#11680)

Tianzhou (天舟)390ea4c49858
diff --git a/backend/bin/bb/README.md b/backend/bin/bb/README.md
deleted file mode 100644
index f9add012af..0000000000
--- a/backend/bin/bb/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# bb
-
-The CLI interacting with https://api.bytebase.com
-
-## Usage
-
-```shell
-bb version
-```
-
-```shell
-# List all projects
-bb projects list --url=https://bytebase.example.com --token=xxxx
-```
diff --git a/backend/bin/bb/cmd/projects/list.go b/backend/bin/bb/cmd/projects/list.go
deleted file mode 100644
index 5948afbb59..0000000000
--- a/backend/bin/bb/cmd/projects/list.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package projects
-
-import (
- "fmt"
-
- "github.com/spf13/cobra"
-
- "github.com/bytebase/bytebase/backend/bin/bb/util"
-)
-
-// ListCmd encapsulates the command for listing backups for a branch.
-func listCmd(s *util.Setting) *cobra.Command {
- cmd := &cobra.Command{
- Use: "list",
- Short: "List all projects",
- Aliases: []string{"ls"},
- RunE: func(_ *cobra.Command, _ []string) error {
- fmt.Printf("All projects: token: %s url: %s\n", s.Config.Token, s.Config.URL)
- return nil
- },
- }
-
- return cmd
-}
diff --git a/backend/bin/bb/cmd/projects/projects.go b/backend/bin/bb/cmd/projects/projects.go
deleted file mode 100644
index 8d1f2f901a..0000000000
--- a/backend/bin/bb/cmd/projects/projects.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package projects
-
-import (
- "github.com/spf13/cobra"
-
- "github.com/bytebase/bytebase/backend/bin/bb/util"
-)
-
-func Cmd(s *util.Setting) *cobra.Command {
- cmd := &cobra.Command{
- Use: "projects <command>",
- Short: "List projects",
- }
-
- cmd.AddCommand(listCmd(s))
- return cmd
-}
diff --git a/backend/bin/bb/cmd/root.go b/backend/bin/bb/cmd/root.go
deleted file mode 100644
index 7f83adcadc..0000000000
--- a/backend/bin/bb/cmd/root.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Package cmd is the command surface of Bytebase bb tool provided by bytebase.com.
-package cmd
-
-import (
- "context"
-
- "github.com/spf13/cobra"
-
- "github.com/bytebase/bytebase/backend/bin/bb/config"
-
- "github.com/bytebase/bytebase/backend/bin/bb/cmd/projects"
- "github.com/bytebase/bytebase/backend/bin/bb/cmd/version"
- "github.com/bytebase/bytebase/backend/bin/bb/util"
-)
-
-func runCmd(ctx context.Context) error {
- rootCmd := &cobra.Command{
- Use: "bb",
- Short: "CLI for Bytebase",
- Long: "bb is the CLI interacting with https://api.bytebase.com.",
- RunE: func(cmd *cobra.Command, _ []string) error {
- return cmd.Usage()
- },
- }
-
- cfg, err := config.New()
- if err != nil {
- return err
- }
-
- rootCmd.PersistentFlags().StringVar(&cfg.URL,
- "url", "", "The URL for the Bytebase instance.")
- rootCmd.PersistentFlags().StringVar(&cfg.Token,
- "token", "", "The API token to interact with the Bytebase API.")
-
- s := &util.Setting{
- Config: cfg,
- }
-
- rootCmd.AddCommand(version.Cmd(), projects.Cmd(s))
-
- return rootCmd.ExecuteContext(ctx)
-}
-
-// Execute is the execute command for root command.
-func Execute(ctx context.Context) int {
- err := runCmd(ctx)
- if err == nil {
- return 0
- }
- return 1
-}
diff --git a/backend/bin/bb/cmd/version/version.go b/backend/bin/bb/cmd/version/version.go
deleted file mode 100644
index 58aaad6a31..0000000000
--- a/backend/bin/bb/cmd/version/version.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package version
-
-import (
- "fmt"
-
- "github.com/spf13/cobra"
-)
-
-// These should be set via go build -ldflags -X 'xxxx'.
-var version = "development"
-var goversion = "unknown"
-var gitcommit = "unknown"
-var buildtime = "unknown"
-var builduser = "unknown"
-
-func Cmd() *cobra.Command {
- versionCmd := &cobra.Command{
- Use: "version",
- Short: "Show bb version",
- Run: func(_ *cobra.Command, _ []string) {
- fmt.Printf("bb version %s (Golang version: %s build on: %s by: %s commit: %s)\n", version, goversion, buildtime, builduser, gitcommit)
- },
- }
- return versionCmd
-}
diff --git a/backend/bin/bb/config/config.go b/backend/bin/bb/config/config.go
deleted file mode 100644
index dc3252dcf4..0000000000
--- a/backend/bin/bb/config/config.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package config
-
-type Config struct {
- URL string
- Token string
-}
-
-func New() (*Config, error) {
- return &Config{
- URL: "",
- Token: "",
- }, nil
-}
diff --git a/backend/bin/bb/main.go b/backend/bin/bb/main.go
deleted file mode 100644
index 3fa77445e4..0000000000
--- a/backend/bin/bb/main.go
+++ /dev/null
@@ -1,21 +0,0 @@
-// Package main is the main package for bb CLI.
-package main
-
-import (
- "context"
- "os"
- "os/signal"
-
- "github.com/bytebase/bytebase/backend/bin/bb/cmd"
-)
-
-func main() {
- os.Exit(realMain())
-}
-
-func realMain() int {
- ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
- defer cancel()
-
- return cmd.Execute(ctx)
-}
diff --git a/backend/bin/bb/util/setting.go b/backend/bin/bb/util/setting.go
deleted file mode 100644
index 070f372636..0000000000
--- a/backend/bin/bb/util/setting.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package util
-
-import (
- "github.com/bytebase/bytebase/backend/bin/bb/config"
-)
-
-// Setting is passed to each command. This eases swapping implementation.
-type Setting struct {
- Config *config.Config
-}
diff --git a/backend/bin/sql-service/README.md b/backend/bin/sql-service/README.md
deleted file mode 100644
index 32a3d5428f..0000000000
--- a/backend/bin/sql-service/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Bytebase SQL Service
-
-The API service for Bytebase SQL Review
diff --git a/backend/bin/sql-service/cmd/profile_dev.go b/backend/bin/sql-service/cmd/profile_dev.go
deleted file mode 100644
index cd45dc4a1e..0000000000
--- a/backend/bin/sql-service/cmd/profile_dev.go
+++ /dev/null
@@ -1,20 +0,0 @@
-//go:build !release
-
-package cmd
-
-import (
- "github.com/bytebase/bytebase/backend/common"
- server "github.com/bytebase/bytebase/backend/sql-server"
-)
-
-func activeProfile() server.Profile {
- return server.Profile{
- Mode: common.ReleaseModeDev,
- BackendHost: flags.host,
- BackendPort: flags.port,
- Version: version,
- GitCommit: gitcommit,
- MetricConnectionKey: "",
- WorkspaceID: flags.workspaceID,
- }
-}
diff --git a/backend/bin/sql-service/cmd/profile_release.go b/backend/bin/sql-service/cmd/profile_release.go
deleted file mode 100644
index 88aa808147..0000000000
--- a/backend/bin/sql-service/cmd/profile_release.go
+++ /dev/null
@@ -1,20 +0,0 @@
-//go:build release
-
-package cmd
-
-import (
- "github.com/bytebase/bytebase/backend/common"
- server "github.com/bytebase/bytebase/backend/sql-server"
-)
-
-func activeProfile() server.Profile {
- return server.Profile{
- Mode: common.ReleaseModeProd,
- BackendHost: flags.host,
- BackendPort: flags.port,
- Version: version,
- GitCommit: gitcommit,
- MetricConnectionKey: "46nEgegY1APWBz4NcQp0rCRJomDnLJyE",
- WorkspaceID: flags.workspaceID,
- }
-}
diff --git a/backend/bin/sql-service/cmd/root.go b/backend/bin/sql-service/cmd/root.go
deleted file mode 100644
index 44bc570e8e..0000000000
--- a/backend/bin/sql-service/cmd/root.go
+++ /dev/null
@@ -1,153 +0,0 @@
-// Package cmd provides the cobra CLI implementation for SQL review service.
-package cmd
-
-import (
- "context"
- "fmt"
- "log/slog"
- "net/http"
- "os"
- "os/signal"
- "syscall"
-
- "github.com/spf13/cobra"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- server "github.com/bytebase/bytebase/backend/sql-server"
-
- // Register pingcap parser driver.
- _ "github.com/pingcap/tidb/pkg/types/parser_driver"
- // Register tidb advisor.
- _ "github.com/bytebase/bytebase/backend/plugin/advisor/tidb"
- // Register mysql advisor.
- _ "github.com/bytebase/bytebase/backend/plugin/advisor/mysql"
-
- // Register postgresql advisor.
- _ "github.com/bytebase/bytebase/backend/plugin/advisor/pg"
- // Register oracle advisor.
- _ "github.com/bytebase/bytebase/backend/plugin/advisor/oracle"
- // Register snowflake advisor.
- _ "github.com/bytebase/bytebase/backend/plugin/advisor/snowflake"
- // Register mssql advisor.
- _ "github.com/bytebase/bytebase/backend/plugin/advisor/mssql"
-
- // Register postgres parser driver.
- _ "github.com/bytebase/bytebase/backend/plugin/parser/sql/engine/pg"
-)
-
-// -----------------------------------Global constant BEGIN----------------------------------------.
-const (
-
- // greetingBanner is the greeting banner.
- // http://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=BB%20SQL%20Service
- greetingBanner = `
-██████╗ ██████╗ ███████╗ ██████╗ ██╗ ███████╗███████╗██████╗ ██╗ ██╗██╗ ██████╗███████╗
-██╔══██╗██╔══██╗ ██╔════╝██╔═══██╗██║ ██╔════╝██╔════╝██╔══██╗██║ ██║██║██╔════╝██╔════╝
-██████╔╝██████╔╝ ███████╗██║ ██║██║ ███████╗█████╗ ██████╔╝██║ ██║██║██║ █████╗
-██╔══██╗██╔══██╗ ╚════██║██║▄▄ ██║██║ ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║██║ ██╔══╝
-██████╔╝██████╔╝ ███████║╚██████╔╝███████╗ ███████║███████╗██║ ██║ ╚████╔╝ ██║╚██████╗███████╗
-╚═════╝ ╚═════╝ ╚══════╝ ╚══▀▀═╝ ╚══════╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═════╝╚══════╝
-
-%s
-___________________________________________________________________________________________
-
-`
- // byeBanner is the bye banner.
- // http://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=BYE
- byeBanner = `
-██████╗ ██╗ ██╗███████╗
-██╔══██╗╚██╗ ██╔╝██╔════╝
-██████╔╝ ╚████╔╝ █████╗
-██╔══██╗ ╚██╔╝ ██╔══╝
-██████╔╝ ██║ ███████╗
-╚═════╝ ╚═╝ ╚══════╝
-
-`
-)
-
-// -----------------------------------Command Line Config BEGIN------------------------------------.
-var (
- flags struct {
- // Used for Bytebase command line config
- host string
- port int
- debug bool
- workspaceID string
- }
- rootCmd = &cobra.Command{
- Use: "sql",
- Short: "Bytebase SQL Service is the API service for Bytebase SQL Review",
- Run: func(_ *cobra.Command, _ []string) {
- start()
-
- fmt.Printf("%s", byeBanner)
- },
- }
-)
-
-// Execute executes the root command.
-func Execute() error {
- return rootCmd.Execute()
-}
-
-func init() {
- rootCmd.PersistentFlags().StringVar(&flags.host, "host", "http://localhost", "host where Bytebase SQL service backend is accessed from, must start with http:// or https://.")
- rootCmd.PersistentFlags().IntVar(&flags.port, "port", 8080, "port where Bytebase SQL service backend is accessed from.")
- rootCmd.PersistentFlags().BoolVar(&flags.debug, "debug", false, "whether to enable debug level logging")
- rootCmd.PersistentFlags().StringVar(&flags.workspaceID, "workspace-id", "", "the identifier for SQL service")
-}
-
-// -----------------------------------Command Line Config END--------------------------------------
-
-// -----------------------------------Main Entry Point---------------------------------------------
-
-func start() {
- if flags.debug {
- log.LogLevel.Set(slog.LevelDebug)
- }
- slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{AddSource: true, Level: log.LogLevel, ReplaceAttr: log.Replace})))
-
- // check flags
- if !common.HasPrefixes(flags.host, "http://", "https://") {
- slog.Error(fmt.Sprintf("--host %s must start with http:// or https://", flags.host))
- return
- }
-
- activeProfile := activeProfile()
-
- var s *server.Server
- // Setup signal handlers.
- ctx, cancel := context.WithCancel(context.Background())
- c := make(chan os.Signal, 1)
- // Trigger graceful shutdown on SIGINT or SIGTERM.
- // The default signal sent by the `kill` command is SIGTERM,
- // which is taken as the graceful shutdown signal for many systems, eg., Kubernetes, Gunicorn.
- signal.Notify(c, os.Interrupt, syscall.SIGTERM)
- go func() {
- sig := <-c
- slog.Info(fmt.Sprintf("%s received.", sig.String()))
- if s != nil {
- _ = s.Shutdown(ctx)
- }
- cancel()
- }()
-
- s, err := server.NewServer(ctx, activeProfile)
- if err != nil {
- slog.Error("Cannot new server", log.BBError(err))
- return
- }
- fmt.Printf(greetingBanner, fmt.Sprintf("Version %s has started at %s:%d", activeProfile.Version, activeProfile.BackendHost, activeProfile.BackendPort))
- // Execute program.
- if err := s.Run(); err != nil {
- if err != http.ErrServerClosed {
- slog.Error(err.Error())
- _ = s.Shutdown(ctx)
- cancel()
- }
- }
-
- // Wait for CTRL-C.
- <-ctx.Done()
-}
diff --git a/backend/bin/sql-service/cmd/version.go b/backend/bin/sql-service/cmd/version.go
deleted file mode 100644
index 21cdbe765b..0000000000
--- a/backend/bin/sql-service/cmd/version.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package cmd
-
-import (
- "fmt"
-
- "github.com/spf13/cobra"
-)
-
-// These should be set via go build -ldflags -X 'xxxx'.
-var version = "development"
-var goversion = "unknown"
-var gitcommit = "unknown"
-var buildtime = "unknown"
-var builduser = "unknown"
-
-func init() {
- rootCmd.AddCommand(versionCmd)
-}
-
-var versionCmd = &cobra.Command{
- Use: "version",
- Short: "Print the version of Bytebase SQL service",
- Run: func(_ *cobra.Command, _ []string) {
- fmt.Printf("Bytebase SQL service version: %s\n", version)
- fmt.Printf("Golang version: %s\n", goversion)
- fmt.Printf("Git commit hash: %s\n", gitcommit)
- fmt.Printf("Built on: %s\n", buildtime)
- fmt.Printf("Built by: %s\n", builduser)
- },
-}
diff --git a/backend/bin/sql-service/main.go b/backend/bin/sql-service/main.go
deleted file mode 100644
index 16e8488838..0000000000
--- a/backend/bin/sql-service/main.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Package main is the main binary for SQL review service.
-package main
-
-import (
- "os"
-
- "github.com/bytebase/bytebase/backend/bin/sql-service/cmd"
-)
-
-func main() {
- if err := cmd.Execute(); err != nil {
- os.Exit(1)
- }
-}
diff --git a/scripts/.air_bb.toml b/scripts/.air_bb.toml
deleted file mode 100644
index 7af1a9d66d..0000000000
--- a/scripts/.air_bb.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-root = "."
-tmp_dir = ".air"
-
-[build]
- bin = "./.air/bb version"
- cmd = """
- go build \
- -o ./.air/bb ./backend/bin/bb/main.go"""
- delay = 1000
- exclude_dir = [".air", "vendor", "frontend", "docs"]
- exclude_file = []
- exclude_regex = []
- exclude_unchanged = false
- follow_symlink = false
- full_bin = ""
diff --git a/scripts/.air_sql_service.toml b/scripts/.air_sql_service.toml
deleted file mode 100644
index 800ed7e18e..0000000000
--- a/scripts/.air_sql_service.toml
+++ /dev/null
@@ -1,17 +0,0 @@
-root = "."
-tmp_dir = ".air"
-
-[build]
- bin = "./.air/sql-service --port 8081"
- cmd = """
- go build \
- -o ./.air/sql-service ./backend/bin/sql-service/main.go"""
- delay = 1000
- exclude_dir = [".air", "vendor", "frontend", "docs"]
- exclude_file = []
- exclude_regex = []
- exclude_unchanged = false
- follow_symlink = false
- send_interrupt = true
- kill_delay = 1000
- full_bin = ""
diff --git a/scripts/Dockerfile.bb b/scripts/Dockerfile.bb
deleted file mode 100644
index 8f2e2ed609..0000000000
--- a/scripts/Dockerfile.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-# DO NOT run docker build against this file directly. Instead using ./build_bb_docker.sh as that
-# one sets the various ARG used in the Dockerfile
-
-# After build
-
-# $ docker run --init --rm --name bb bytebase/bb
-
-FROM golang:1.21.6 as bb
-ADD go.mod go.sum /
-RUN go mod download
-
-ARG VERSION="development"
-ARG GO_VERSION="1.21.6"
-ARG GIT_COMMIT="unknown"
-ARG BUILD_TIME="unknown"
-ARG BUILD_USER="unknown"
-
-WORKDIR /bb-build
-
-COPY . .
-
-# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
-RUN GOOS=linux GOARCH=amd64 go build \
- --tags "release" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.builduser=${BUILD_USER}'" \
- -o bb \
- ./backend/bin/bb/main.go
-
-# Use debian because mysql requires glibc.
-FROM debian:bookworm-slim as monolithic
-
-ARG VERSION="development"
-ARG GIT_COMMIT="unknown"
-ARG BUILD_TIME="unknown"
-ARG BUILD_USER="unknown"
-
-# See https://github.com/opencontainers/image-spec/blob/master/annotations.md
-LABEL org.opencontainers.image.version=${VERSION}
-LABEL org.opencontainers.image.revision=${GIT_COMMIT}
-LABEL org.opencontainers.image.created=${BUILD_TIME}
-LABEL org.opencontainers.image.authors=${BUILD_USER}
-
-COPY --from=bb /bb-build/bb /usr/local/bin/
-
-ENV OPENSSL_CONF /etc/ssl/
-
-CMD ["version"]
-
-ENTRYPOINT ["bb"]
diff --git a/scripts/Dockerfile.sql-service b/scripts/Dockerfile.sql-service
deleted file mode 100644
index 47712bc0d4..0000000000
--- a/scripts/Dockerfile.sql-service
+++ /dev/null
@@ -1,64 +0,0 @@
-# DO NOT run docker build against this file directly. Instead using ./build_bytebase_docker.sh as that
-# one sets the various ARG used in the Dockerfile
-
-# After build
-
-# $ docker run --init --rm --name sql-service --publish 8081:8081 bytebase/sql
-
-FROM golang:1.21.6 as sql
-ADD go.mod go.sum /
-RUN go mod download
-
-ARG VERSION="development"
-ARG GO_VERSION="1.21.6"
-ARG GIT_COMMIT="unknown"
-ARG BUILD_TIME="unknown"
-ARG BUILD_USER="unknown"
-
-ARG RELEASE="release"
-
-# Need gcc for CGO_ENABLED=1
-RUN apt-get install -y gcc
-
-WORKDIR /sql-service-build
-
-COPY . .
-
-COPY ./scripts/VERSION .
-
-# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
-# go-sqlite3 requires CGO_ENABLED
-RUN VERSION=`cat ./VERSION` && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
- --tags "${RELEASE}" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.builduser=${BUILD_USER}'" \
- -o sql-service \
- ./backend/bin/sql-service/main.go
-
-# Use debian because mysql requires glibc.
-FROM debian:bookworm-slim as monolithic
-
-ARG VERSION="development"
-ARG GIT_COMMIT="unknown"
-ARG BUILD_TIME="unknown"
-ARG BUILD_USER="unknown"
-
-# See https://github.com/opencontainers/image-spec/blob/master/annotations.md
-LABEL org.opencontainers.image.version=${VERSION}
-LABEL org.opencontainers.image.revision=${GIT_COMMIT}
-LABEL org.opencontainers.image.created=${BUILD_TIME}
-LABEL org.opencontainers.image.authors=${BUILD_USER}
-
-# Our HEALTHCHECK instruction in dockerfile needs curl.
-RUN apt-get update && apt-get install -y curl libncurses5
-
-COPY --from=sql /sql-service-build/sql-service /usr/local/bin/
-COPY --from=sql /etc/ssl/certs /etc/ssl/certs
-
-# Copy utility scripts
-COPY ./scripts /usr/local/bin/
-
-CMD ["--host", "http://localhost", "--port", "8080"]
-
-HEALTHCHECK --interval=5m --timeout=60s CMD curl -f http://localhost:8080/healthz || exit 1
-
-ENTRYPOINT ["sql-service"]
diff --git a/scripts/build_bb.sh b/scripts/build_bb.sh
deleted file mode 100755
index f96614dabb..0000000000
--- a/scripts/build_bb.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# ===========================================================================
-# File: build_bb.sh
-# Description: usage: ./build_bb.sh [outdir]
-# ===========================================================================
-
-# exit when any command fails
-set -e
-
-cd "$(dirname "$0")/../"
-. ./scripts/build_init.sh
-
-OUTPUT_DIR=$(mkdir_output "$1")
-OUTPUT_BINARY=$OUTPUT_DIR/bb
-
-echo "Start building bb ${VERSION}..."
-
-flags="-X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.version=${VERSION}'
--X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.goversion=$(go version)'
--X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.gitcommit=$(git rev-parse HEAD)'
--X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
--X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.builduser=$(id -u -n)'"
-
-# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
-go build --tags "release" -ldflags "-w -s $flags" -o ${OUTPUT_BINARY} ./backend/bin/bb/main.go
-
-echo "Completed building bb."
-
-echo ""
-echo "Printing version..."
-
-${OUTPUT_BINARY} version
diff --git a/scripts/build_bb_docker.sh b/scripts/build_bb_docker.sh
deleted file mode 100755
index 3d36d89f3e..0000000000
--- a/scripts/build_bb_docker.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# ===========================================================================
-# File: build_bb_docker.sh
-# Description: usage: ./build_bb_docker.sh
-# ===========================================================================
-
-# exit when any command fails
-set -e
-
-cd "$(dirname "$0")/../"
-. ./scripts/build_init.sh
-
-echo "Start building bb docker image ${VERSION}..."
-
-docker build -f ./scripts/Dockerfile.bb \
- --build-arg VERSION=${VERSION} \
- --build-arg GO_VERSION="$(go version)" \
- --build-arg GIT_COMMIT="$(git rev-parse HEAD)"\
- --build-arg BUILD_TIME="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
- --build-arg BUILD_USER="$(id -u -n)" \
- -t bytebase/bb .
-
-echo "${GREEN}Completed building bb docker image ${VERSION}.${NC}"
-echo ""
-echo "Command to tag and push the image"
-echo ""
-echo "$ docker tag bytebase/bb bytebase/bb:${VERSION}; docker push bytebase/bb:${VERSION}"
-echo ""
-echo "Command to run bb"
-echo ""
-echo "$ docker run --rm --name bb bytebase/bb"
-echo ""
diff --git a/scripts/build_sql_service_docker.sh b/scripts/build_sql_service_docker.sh
deleted file mode 100755
index a95f7474e1..0000000000
--- a/scripts/build_sql_service_docker.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# ===========================================================================
-# File: build_sql_service_docker.sh
-# Description: usage: ./build_sql_service_docker.sh
-# ===========================================================================
-
-# exit when any command fails
-set -e
-
-cd "$(dirname "$0")/../"
-. ./scripts/build_init.sh
-
-echo "Start building SQL Service docker image ${VERSION}..."
-
-docker build -f ./scripts/Dockerfile.sql-service\
- --build-arg VERSION=${VERSION} \
- --build-arg GO_VERSION="$(go version)" \
- --build-arg GIT_COMMIT="$(git rev-parse HEAD)"\
- --build-arg BUILD_TIME="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
- --build-arg BUILD_USER="$(id -u -n)" \
- -t bytebase/sql .
-
-echo "${GREEN}Completed building Bytebase SQL Service docker image ${VERSION}.${NC}"
-echo ""
-echo "Command to tag and push the image"
-echo ""
-echo "$ docker tag bytebase/sql bytebase/sql:${VERSION}; docker push bytebase/sql:${VERSION}"
-echo ""
-echo "Command to start Bytebase SQL Service on http://localhost:8081"
-echo ""
-echo "$ docker run --init --name sql-service --restart always --publish 8081:8081 --volume ~/.sql-service/data:/var/opt/sql-service bytebase/sql:${VERSION} --host http://localhost --port 8081"
-echo ""
diff --git a/scripts/sql_service.sh b/scripts/sql_service.sh
deleted file mode 100755
index 71b24bf884..0000000000
--- a/scripts/sql_service.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-# For now, we use this script to start our SQL service on render
-# by changing the ENTRYPOINT and CMD at the dockerfile to this.
-
-# example usages:
-# ./sql_service.sh
-# ./sql_service.sh --host https://example.com
-# ./sql_service.sh --host https://example.com --port 8080 --workspace-id bytebase-sql-service
-
-ONLINE_HOST='http://localhost'
-ONLINE_PORT='80'
-WORKSPACE_ID=''
-
-# Get parameters
-for i in "$@"
-do
-case $i in
- --host)
- ONLINE_HOST="$2"
- shift
- ;;
- --port)
- ONLINE_PORT="$2"
- shift
- ;;
- --workspace-id)
- WORKSPACE_ID="$2"
- shift # past argument
- ;;
- *) # unknown option
- ;;
-esac
-done
-
-echo "Starting Bytebase SQL Service at ${ONLINE_HOST}:${ONLINE_PORT} with workspace ${WORKSPACE_ID}..."
-
-# Start the SQL service with workspace id
-sql-service --host ${ONLINE_HOST} --port ${ONLINE_PORT} --workspace-id ${WORKSPACE_ID}