Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
with:
go-version: 1.20.4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
Comment thread
frouioui marked this conversation as resolved.
Outdated

- name: Tune the OS
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ endif
-trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) \
-ldflags "$(shell tools/build_version_flags.sh)" \
-o ${VTROOTBIN} ./go/...
ifndef NOVTADMINBUILD
echo "Building VTAdmin Web, disable VTAdmin build by using 'NOVTADMINBUILD'"
./web/vtadmin/build.sh
endif

# cross-build can be used to cross-compile Vitess client binaries
# Outside of select client binaries (namely vtctlclient & vtexplain), cross-compiled Vitess Binaries are not recommended for production deployments
Expand Down
28 changes: 2 additions & 26 deletions examples/common/scripts/vtadmin-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,8 @@ done
# Check one last time
[[ $(curl -s "http://${hostname}:${vtadmin_api_port}/api/clusters") == "${expected_cluster_result}" ]] || fail "vtadmin failed to discover the running example Vitess cluster."

# Download nvm and node
if [[ -z ${NVM_DIR} ]]; then
export NVM_DIR="$HOME/.nvm"
fi

if [[ -z ${NODE_VERSION} ]]; then
export NODE_VERSION="16"
fi

output "\nInstalling nvm...\n"

if [ -d "$NVM_DIR" ]; then
output "\033[1;32mnvm is already installed!\033[0m"
else
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash && output "\033[1;32mnvm is installed!\033[0m" || fail "\033[1;32mnvm failed to install!\033[0m"
fi

source "$NVM_DIR/nvm.sh"

output "\nConfiguring Node.js $NODE_VERSION\n"
nvm install "$NODE_VERSION" || fail "Could not install and use nvm $NODE_VERSION."

# As a TODO, it'd be nice to make the assumption that vtadmin-web is already
# installed and built (since we assume that `make` has already been run for
# other Vitess components.)
npm --prefix "$web_dir" --silent install
# Download NVM / Node and Re-build vtadmin if necessary
./${web_dir}/build.sh

VITE_VTADMIN_API_ADDRESS="http://${hostname}:${vtadmin_api_port}" \
VITE_ENABLE_EXPERIMENTAL_TABLET_DEBUG_VARS="true" \
Expand Down
33 changes: 33 additions & 0 deletions web/vtadmin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

function output() {
echo -e "$@"
}

script_dir="$(dirname "${BASH_SOURCE[0]:-$0}")"
source "${script_dir}/../../build.env"
web_dir="${script_dir}"

# Download nvm and node
if [[ -z ${NVM_DIR} ]]; then
export NVM_DIR="$HOME/.nvm"
fi

if [[ -z ${NODE_VERSION} ]]; then
export NODE_VERSION="16"
fi

output "\nInstalling nvm...\n"

if [ -d "$NVM_DIR" ]; then
output "\033[1;32mnvm is already installed!\033[0m"
else
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash && output "\033[1;32mnvm is installed!\033[0m" || fail "\033[1;32mnvm failed to install!\033[0m"
fi

source "$NVM_DIR/nvm.sh"

output "\nConfiguring Node.js $NODE_VERSION\n"
nvm install "$NODE_VERSION" || fail "Could not install and use nvm $NODE_VERSION."

npm --prefix "$web_dir" --silent install
1 change: 1 addition & 0 deletions web/vtadmin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"build": "vite build",
"test": "vitest",
"preview": "vite preview",
"package": "pkg vite.config.ts --output myapp",
Comment thread
frouioui marked this conversation as resolved.
Outdated
"lint": "npm run lint:eslint && npm run lint:prettier && npm run lint:stylelint",
"lint:fix": "npm run lint:eslint:fix && npm run lint:prettier:fix && npm run lint:stylelint:fix",
"lint:eslint": "eslint --ext js,ts,tsx src",
Expand Down