JENKINS_HOME=${JENKINS_HOME}
REWRITE_COVERAGE_ROOTDIR=${PWD}/src/pybind/mgr/dashboard/frontend
EOF
-# TODO: enable (read-only?) sccache support
-npm_cache_info() {
- echo '===== npm cache info ======='
- du -sh "${NPMCACHE}" || echo "${NPMCACHE} not present"
- echo '============================'
-}
-bwc() {
- # specify timeout in hours for $1
- local timeout=$(($1*60*60))
- shift
- timeout "${timeout}" ./src/script/build-with-container.py \
- -d "${DISTRO_BASE:-jammy}" \
- --env-file="${PWD}/.env" \
- --current-branch="${GIT_BRANCH:-main}" \
- -t+arm64 \
- --npm-cache-path="${NPMCACHE}" \
- "${@}"
-}
-podman login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD} docker.io
-
-npm_cache_info
-bwc 1 -e configure
-# try to pre-load the npm cache so that it doesn't fail
-# during the normal build step
-for i in {0..5}; do
- bwc 1 -e custom -- \
- cmake --build build -t mgr-dashboard-frontend-deps && break
- echo "Warning: Attempt $((i+1)) to cache npm packages failed."
- sleep $((10 + 30 * i))
-done
-npm_cache_info
+bwc_login
+bwc_populate_npm_cache
bwc 4 -e tests
npm_cache_info
sleep 5