Skip to content

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

chore: update render config (#1555)

tianzhou120708f4bd53
diff --git a/Dockerfile b/Dockerfile
index a30680aebd..0ac9f1b33c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,6 +28,7 @@ ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
+# Build in release mode so we will embed the frontend
ARG RELEASE="release"
# Need gcc musl-dev for CGO_ENABLED=1
diff --git a/Dockerfile.render-demo b/Dockerfile.render
similarity index 76%
rename from Dockerfile.render-demo
rename to Dockerfile.render
index e6f16f56ca..545e0a6cc5 100644
--- a/Dockerfile.render-demo
+++ b/Dockerfile.render
@@ -1,6 +1,4 @@
-# *******************************************************
-# * This script is for demo.bytebase.com on Render ONLY *
-# *******************************************************
+# This script is for demo.bytebase.com and staging.bytebase.com on Render ONLY
FROM node:14 as frontend
@@ -25,6 +23,9 @@ ARG RENDER_GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
+# Build in release mode so we will embed the frontend
+ARG RELEASE="release"
+
# Need gcc musl-dev for CGO_ENABLED=1
RUN apk --no-cache add gcc musl-dev
@@ -40,9 +41,9 @@ COPY ./scripts .
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
# go-sqlite3 requires CGO_ENABLED
-RUN STAGING_VERSION=`cat ./VERSION`-${RENDER_GIT_COMMIT:0:5} && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
- --tags "alpine" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${STAGING_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${RENDER_GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=${BUILD_USER}'" \
+RUN CMD_VERSION=`cat ./VERSION`-${RENDER_GIT_COMMIT:0:5} && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
+ --tags "${RELEASE} alpine" \
+ -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${CMD_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${RENDER_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;
diff --git a/Dockerfile.render-preview b/Dockerfile.render-preview
index 45f50fca3c..c1d232604d 100644
--- a/Dockerfile.render-preview
+++ b/Dockerfile.render-preview
@@ -1,5 +1,5 @@
# *****************************************************
-# * This script is for preview purpose on Render ONLY *
+# * This script is for PR preview purpose on Render ONLY *
# *****************************************************
FROM node:14 as frontend
@@ -25,6 +25,9 @@ ARG RENDER_GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
+# Build in release mode so we will embed the frontend
+ARG RELEASE="release"
+
# Need gcc musl-dev for CGO_ENABLED=1
RUN apk --no-cache add gcc musl-dev
@@ -40,9 +43,9 @@ COPY ./scripts .
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
# go-sqlite3 requires CGO_ENABLED
-RUN STAGING_VERSION=`cat ./VERSION`-${RENDER_GIT_COMMIT:0:5} && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
- --tags "alpine" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${STAGING_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${RENDER_GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=${BUILD_USER}'" \
+RUN CMD_VERSION=`cat ./VERSION`-${RENDER_GIT_COMMIT:0:5} && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
+ --tags "${RELEASE} alpine" \
+ -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${CMD_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${RENDER_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;