Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: promote the demo next3 to next (#9140)
Tianzhou (天舟)bd9abdbd7e5a
diff --git a/backend/demo/data/next/README.md b/backend/demo/data/next/README.mdindex 2924b9c4d7..f9c131a9ae 100644--- a/backend/demo/data/next/README.md+++ b/backend/demo/data/next/README.md@@ -2,46 +2,55 @@*Work In Progress*-This is the next version of demo data.+This is the next version of demo data for https://demo.bytebase.com.-`demo.sql` holds the data for demo.+`dump.sql` itself is dumped from the meta database and holds schema and data for the demo.-`demo.sql` itself is dumped from the meta database.+# Dependencies++1. Sample test and prod PG instances running on port `8083` and `8084`.+1. [GitHub hr-sample](https://github.com/s-bytebase/hr-sample) to demonstrate GitOps Workflow.+1. Enterprise license. https://demo.bytebase.com runs in dev mode, thus it bundles a dev license. If+you want to run the demo in release mode. You need to supply your own release license.# How to useAppend `--demo next` to the start command.-Beware that this will overwrite your data, so it's recommended to use a fresh database.+Demo only works when using embedded PostgreSQL (without supplying [--pg](https://www.bytebase.com/docs/reference/command-line/#pg-string)). This is to prevent accidentally deleting the existing data.-## Example+Demo requires the sample test and prod instances run on port `8083` and `8084` respectively. So we need to+supply the --port with `8080` to make sample instances run on those 2 desired ports.```bashdocker run --init \--name bytebase \--restart always \- --publish 9015:9015 \+ --publish 8080:8080 \--health-cmd "curl --fail http://localhost:9015/healthz || exit 1" \--health-interval 5m \--health-timeout 60s \--volume ~/.bytebase/data:/var/opt/bytebase \bytebase/bytebase:2.8.0 \--data /var/opt/bytebase \- --port 9015 \- --demo next \- --pg postgresql://user:secret@host:port/dbname+ --port 8080 \+ --demo next```+## Run on render+1. Set the [PORT env](https://render.com/docs/environment-variables#all-services-1) to 8080.+1. Use [/scripts/Dockerfile.render-demo](https://github.com/bytebase/bytebase/blob/main/scripts/Dockerfile.render-demo) as the Dockerfile.+1. Supply `bytebase --port 8080 --data /var/opt/bytebase --demo next` to the Docker Command.# How to update demo data1. Start Bytebase with `--demo next`, and do whatever you want.-2. Dump with the following command.+1. Dump with the following command.```bash-pg_dump --username ${user} --host ${host} --port ${port} --password ${secret} --data-only --disable-triggers --column-inserts --on-conflict-do-nothing ${dbname} > /tmp/demo.sql+pg_dump --username ${user} --host ${host} --port ${port} --password ${secret} --disable-triggers --column-inserts --on-conflict-do-nothing ${dbname} > /tmp/dump.sql```-3. Copy and replace `demo.sql`.+3. Copy and replace `dump.sql`.diff --git a/backend/demo/data/next/demo.sql.REMOVED.git-id b/backend/demo/data/next/demo.sql.REMOVED.git-iddeleted file mode 100644index d64a76cdea..0000000000--- a/backend/demo/data/next/demo.sql.REMOVED.git-id+++ /dev/null@@ -1 +0,0 @@-70aed786a30f4b3fcd296893e4e89fa8f402beb6\ No newline at end of filediff --git a/scripts/demo.sh b/scripts/demo.shdeleted file mode 100755index ccef16a36f..0000000000--- a/scripts/demo.sh+++ /dev/null@@ -1,39 +0,0 @@-#!/bin/bash--# For now, we use this script to start our demo on render-# by changing the ENTRYPOINT and CMD at the dockerfile to this.--# example usages:-# ./demo.sh-# ./demo.sh https://example.com-# ./demo.sh https://example.com:8080-# ./demo.sh https://example.com:8080 schema-migration-# ./demo.sh https://schema-migration.demo.bytebase.com schema-migration--# If no parameter is passed, use https://demo.bytebase.com as host and 443 as port by default-ONLINE_DEMO_EXTERNAL_URL='https://demo.bytebase.com'-ONLINE_DEMO_PORT='443'-if [ $1 ]; then- PROTOCAL=$(echo $1 | awk -F ':' '{ print $1 }')- URI=$(echo $1 | awk -F '[/:]' '{ print $4; }')- PORT=$(echo $1 | awk -F '[/:]' '{ print $5; }')-- ONLINE_DEMO_EXTERNAL_URL=$PROTOCAL://$URI-- if [ $PORT ]; then- ONLINE_DEMO_PORT=$PORT- fi-fi--DEMO_NAME='default'-if [ $2 ]; then- DEMO_NAME=$2-fi--startDemo() {- echo "Starting Bytebase in demo mode with ${DEMO_NAME} demo on port ${ONLINE_DEMO_PORT}, visiting from ${ONLINE_DEMO_EXTERNAL_URL}..."-- bytebase --port ${ONLINE_DEMO_PORT} --external-url ${ONLINE_DEMO_EXTERNAL_URL} --demo ${DEMO_NAME} --data /var/opt/bytebase-}--startDemo