2021-09-10 14:27:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright 2021 The Prometheus Authors
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
set -e
|
2022-06-13 08:53:46 +00:00
|
|
|
|
2022-06-09 13:11:46 +00:00
|
|
|
if ! [[ -w $HOME ]]
|
|
|
|
then
|
|
|
|
export npm_config_cache=$(mktemp -d)
|
|
|
|
fi
|
2021-09-10 14:27:23 +00:00
|
|
|
|
2022-06-13 08:53:46 +00:00
|
|
|
buildOrder=(lezer-promql codemirror-promql)
|
2021-09-10 14:27:23 +00:00
|
|
|
|
|
|
|
function buildModule() {
|
|
|
|
for module in "${buildOrder[@]}"; do
|
|
|
|
echo "build ${module}"
|
2022-06-13 14:40:08 +00:00
|
|
|
npm run build -w "@prometheus-io/${module}"
|
2021-09-10 14:27:23 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
function buildReactApp() {
|
2024-02-21 10:14:35 +00:00
|
|
|
echo "build mantine-ui"
|
|
|
|
npm run build -w @prometheus-io/mantine-ui
|
2021-09-10 14:27:23 +00:00
|
|
|
rm -rf ./static/react
|
2024-02-21 10:14:35 +00:00
|
|
|
mv ./mantine-ui/dist ./static/react
|
2021-09-10 14:27:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for i in "$@"; do
|
|
|
|
case ${i} in
|
|
|
|
--all)
|
|
|
|
buildModule
|
|
|
|
buildReactApp
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--build-module)
|
|
|
|
buildModule
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|