mirror of
https://github.com/zhigang1992/graphql-engine.git
synced 2026-05-25 01:12:25 +08:00
This PR builds console static assets into the server docker image at `/srv/console-assets`. When env var `HASURA_GRAPHQL_CONSOLE_ASSETS_DIR=/srv/console-assets` or flag `--console-assets-dir=/srv/console-assets` is set on the server, the files in this directory are served at `/console/assets/*`.
The console html template will have a variable called `cdnAssets: false` when this flag is set and it loads assets from server itself instead of CDN.
The assets are moved to a new bucket with a new naming scheme:
```
graphql-engine-cdn.hasura.io/console/assets/
/common/{}
/versioned/<version/{}
/channel/<channel>/<version>/{}
```
Console served by CLI will still load assets from CDN - will fix that in the next release.
This commit is contained in:
committed by
GitHub
parent
8b21ccbb0b
commit
76ceb707f4
27
scripts/get-console-assets-version.sh
Executable file
27
scripts/get-console-assets-version.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
ROOT="${BASH_SOURCE[0]%/*}"
|
||||
|
||||
SEMVER_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$"
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0)
|
||||
|
||||
VERSION=""
|
||||
channel="stable"
|
||||
|
||||
if [[ "$LATEST_TAG" =~ $SEMVER_REGEX ]]; then
|
||||
major=${BASH_REMATCH[1]}
|
||||
minor=${BASH_REMATCH[2]}
|
||||
release=${BASH_REMATCH[4]}
|
||||
if [[ $release == -alpha* ]]; then channel="alpha"; fi
|
||||
if [[ $release == -beta* ]]; then channel="beta"; fi
|
||||
if [[ $release == -rc* ]]; then channel="rc"; fi
|
||||
|
||||
VERSION="channel/$channel/v$major.$minor"
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ]; then VERSION="versioned/$($ROOT/get-version.sh)"; fi
|
||||
|
||||
echo $VERSION
|
||||
@@ -27,4 +27,4 @@ if [ -z "$VERSION" ]; then VERSION="$($ROOT/get-version.sh)"; fi
|
||||
|
||||
VERSION="$(echo $VERSION | tr -cd '[[:alnum:]]._-')"
|
||||
|
||||
echo $VERSION
|
||||
echo $VERSION
|
||||
|
||||
Reference in New Issue
Block a user