mirror of https://github.com/rancher/dashboard.git
36 lines
799 B
Bash
Executable File
36 lines
799 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
set -x
|
|
|
|
BUILD_DEBUG="${BUILD_DEBUG:-}"
|
|
if [[ -n "${BUILD_DEBUG}" ]]; then
|
|
set -x
|
|
env
|
|
fi
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
echo "Bootstrapping..."
|
|
yarn --pure-lockfile install
|
|
|
|
source scripts/version
|
|
echo "BRANCH: ${COMMIT_BRANCH:-<none>}"
|
|
echo "TAG: ${GIT_TAG:-<none>}"
|
|
DIR=${GIT_TAG:-$COMMIT_BRANCH}
|
|
|
|
echo "Building..."
|
|
NUXT_ENV_commit=${COMMIT} NUXT_ENV_version=${VERSION} OUTPUT_DIR=dist/${DIR}-embedded ROUTER_BASE='/dashboard' yarn run build --spa
|
|
|
|
echo "Destroying..."
|
|
find dist/${DIR}-embedded -name "index.html" -mindepth 2 -exec rm {} \;
|
|
find dist/${DIR}-embedded -type d -empty -depth -exec rmdir {} \;
|
|
|
|
TARBALL=${DIR}.tar.gz
|
|
echo "Compressing to ${TARBALL}..."
|
|
tar -czf dist/${TARBALL} dist/${DIR}-embedded/
|
|
|
|
echo "Cleaning up..."
|
|
rm -r dist/${DIR}-embedded
|
|
|
|
ls -alR dist/
|