forked from tikv/pd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an automated cherry-pick of tikv#7638
close tikv#7637 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
- Loading branch information
1 parent
f36f49b
commit d03eb43
Showing
2 changed files
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This file is updated by running scripts/update-dashboard.sh | ||
# Don't edit it manullay | ||
# the version will become X.Y.Z-<commit-short-hash> format later | ||
2023.12.18.1 |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
BASE_DIR="$(dirname "$CUR_DIR")" | ||
DASHBOARD_VERSION_FILE="$BASE_DIR/scripts/dashboard-version" | ||
# old version | ||
DASHBOARD_VERSION=v$(grep -v '^#' "$DASHBOARD_VERSION_FILE") | ||
|
||
# new version | ||
# Usage: ./scripts/update-dashboard.sh <version> | ||
# Example: ./scripts/update-dashboard.sh v7.6.0-f7bbcdcf | ||
if [ "$#" -ge 1 ]; then | ||
DASHBOARD_VERSION=$1 | ||
|
||
# if DASHBOARD_VERSION not start with `v`, then exit | ||
if [[ ! $DASHBOARD_VERSION =~ ^v[0-9]+\. ]]; then | ||
echo "Invalid dashboard version: $DASHBOARD_VERSION, it should start with \"v\"" | ||
exit 1 | ||
fi | ||
|
||
# when writing to DASHBOARD_VERSION_FILE, remove the leading `v`, | ||
# so that we don't need to modify the embed-dashboard-ui.sh logic | ||
TO_FILE_VERSION=${DASHBOARD_VERSION#v} | ||
|
||
echo "# This file is updated by running scripts/update-dashboard.sh" > $DASHBOARD_VERSION_FILE | ||
echo "# Don't edit it manullay" >> $DASHBOARD_VERSION_FILE | ||
echo $TO_FILE_VERSION >> $DASHBOARD_VERSION_FILE | ||
fi | ||
|
||
echo "+ Update dashboard version to $DASHBOARD_VERSION" | ||
|
||
cd $BASE_DIR | ||
|
||
# if DASHBOARD_VERSION match "vX.Y.Z-<commit-short-hash>" format, | ||
# then extract the commit hash as tidb-dashboard target | ||
if [[ $DASHBOARD_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-[0-9a-f]{7,8} ]]; then | ||
DASHBOARD_VERSION=$(echo $DASHBOARD_VERSION | cut -d'-' -f2) | ||
fi | ||
|
||
go get -d github.com/pingcap/tidb-dashboard@$DASHBOARD_VERSION | ||
go mod tidy | ||
make pd-server | ||
go mod tidy | ||
|
||
cd tests/integrations/client | ||
go mod tidy | ||
cd ../mcs | ||
go mod tidy | ||
cd ../tso | ||
go mod tidy |