-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
distro: support dynamic config (#1094)
- Loading branch information
Showing
29 changed files
with
306 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script writes distribution strings in json which is required for the frontend. | ||
# This script outputs distribution strings to json which is required for the frontend. | ||
|
||
set -euo pipefail | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
PROJECT_DIR=$(cd "$DIR/../.."; pwd) | ||
BUILD_TAG="" | ||
|
||
if [[ -f "${PROJECT_DIR}/internal/resource/distrores/strings.go" ]]; then | ||
echo "+ Existing distribution resource is detected, using it to write strings" | ||
BUILD_TAG=distro | ||
fi | ||
|
||
echo "+ Write resource strings" | ||
echo "+ Write distro strings" | ||
cd "$PROJECT_DIR" | ||
# FIXME: distro/write_strings needs to access the /internal package, which is not allowed to be invoked in another module | ||
# Currently we workaround this by invoking in the TiDB Dashboard module. | ||
go run -tags="${BUILD_TAG}" scripts/distro/write_strings.go -o="${PROJECT_DIR}/ui/lib/distribution.json" | ||
go run scripts/distro/write_strings.go -o="${PROJECT_DIR}/ui/lib/distro_strings.json" | ||
|
||
echo " - Success! Resource strings:" | ||
cat "${PROJECT_DIR}/ui/lib/distribution.json" | ||
echo " - Success! Distro strings:" | ||
cat "${PROJECT_DIR}/ui/lib/distro_strings.json" | ||
|
||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.