Skip to content

Commit

Permalink
Improvements in frontend build.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsomthd committed May 27, 2020
1 parent a411781 commit b61481b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docker/ceph/build-dashboard-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd /ceph/src/pybind/mgr/dashboard/frontend
rm -rf dist

npm cache clean --force
npm install --no-shrinkwrap
npm ci

cd /ceph/build

Expand Down
4 changes: 3 additions & 1 deletion docker/ceph/e2e/e2e-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -eo pipefail

cd /ceph/src/pybind/mgr/dashboard/frontend

npm install --no-shrinkwrap
export NODE_OPTIONS=--max_old_space_size=4096
npm ci

npx webdriver-manager update --versions.chrome=$(google-chrome --version | awk '{ print $3 }')

ARGS="--dev-server-target --webdriverUpdate=false"
Expand Down
1 change: 1 addition & 0 deletions docker/ceph/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ fi
[[ "$CEPH_VERSION" == 'De' ]] && export_var CEPH_VERSION=1000000
[[ -z "$CEPH_PATCH_VERSION" ]] && export_var CEPH_PATCH_VERSION=$("$CEPH_BIN"/ceph -v | sed -r 's/.*\.([0-9]*)\-.*/\1/')
[[ $(rpm -qi ceph-mgr-dashboard | grep 'Red Hat' | wc -l) > 0 ]] && export_var IS_UPSTREAM=0 || export_var IS_UPSTREAM=1
export_var NODE_OPTIONS=--max_old_space_size=4096

exec "$@"
9 changes: 2 additions & 7 deletions docker/ceph/start-ceph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,11 @@ if [[ "$FRONTEND_BUILD_REQUIRED" == 1 ]]; then
npm update @angular/cli
fi

npm_clean_install() {
rm -rf node_modules
npm install --no-shrinkwrap
}

npm install --no-shrinkwrap || npm_clean_install
npm ci

if [[ -z "$REMOTE_DASHBOARD_URL" ]]; then
# Required to run dashboard python module.
npm run build || { npm_clean_install && npm run build ; }
npm run build
fi

# Start dev server
Expand Down

0 comments on commit b61481b

Please sign in to comment.