Skip to content

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

chore: build and push release-ci/dev-ci image (#1398)

qsliu7d410365b5cb
diff --git a/.github/workflows/push-dockerhub.yml b/.github/workflows/push-dockerhub.yml
index 7d10a7cb04..d27c9047e9 100644
--- a/.github/workflows/push-dockerhub.yml
+++ b/.github/workflows/push-dockerhub.yml
@@ -12,6 +12,13 @@ on:
jobs:
docker:
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ include:
+ - docker-image-tag: "dev-ci"
+ docker-build-args: "RELEASE="
+ - docker-image-tag: "release-ci"
+ docker-build-args: "RELEASE=release"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
@@ -25,6 +32,7 @@ jobs:
with:
file: Dockerfile
push: true
- tags: bytebase/bytebase:dev-ci
+ tags: bytebase/bytebase:${{ matrix.docker-image-tag }}
+ build-args: ${{ matrix.docker-build-args }}
- name: Image digest
- run: echo "Successfully pushed bytebase/bytebase:dev-ci " ${{ steps.docker_build.outputs.digest }}
+ run: echo "Successfully pushed bytebase/bytebase:${{ matrix.docker-image-tag }} " ${{ steps.docker_build.outputs.digest }}
diff --git a/Dockerfile b/Dockerfile
index 9ff0d4d14a..a30680aebd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,6 +28,8 @@ ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
+ARG RELEASE="release"
+
# Need gcc musl-dev for CGO_ENABLED=1
RUN apk --no-cache add gcc musl-dev
@@ -41,7 +43,7 @@ COPY --from=frontend /frontend-build/dist ./server/dist
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
# go-sqlite3 requires CGO_ENABLED
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
- --tags "release alpine" \
+ --tags "${RELEASE} alpine" \
-ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=${BUILD_USER}'" \
-o bytebase \
./bin/server/main.go