Skip to content

Instantly share code, notes, and snippets.

@mRoca
Last active December 11, 2015 16:23
Show Gist options
  • Save mRoca/47b29abb14ab3ee31b13 to your computer and use it in GitHub Desktop.
Save mRoca/47b29abb14ab3ee31b13 to your computer and use it in GitHub Desktop.
ng-admin sources
WWW_IP := $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' $(shell docker-compose ps -q www))
EXEC_WWW=docker exec -ti $(shell docker-compose ps -q www)
NGADMIN_SERVER_URL?=$(WWW_IP)
serve-ngadmin:
if [ ! -d .tmpsrc/ng-admin ]; then git clone git@github.com:marmelab/ng-admin.git .tmpsrc/ng-admin; fi
$(EXEC_WWW) bash -c "cd .tmpsrc/ng-admin && make install"
$(EXEC_WWW) bash -c "sed -i 's/..\/bower_components\/ng-admin\//http:\/\/$(NGADMIN_SERVER_URL):8000\//g' .tmp/serve/index.html"
$(EXEC_WWW) bash -c "sed -i 's/http:\/\/localhost/http:\/\/$(NGADMIN_SERVER_URL)/g' .tmpsrc/ng-admin/examples/blog/index.html"
$(EXEC_WWW) bash -c "cd .tmpsrc/ng-admin && ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --colors --devtool cheap-module-inline-source-map --content-base examples/blog --port 8000 --host=$(WWW_IP)"

Use ng-admin sources

In order to debug ng-admin, we need sources. The make serve-ngadmin command will download them, and run a webpack server on the port 8000 of the docker www container. The compiled ng-admin script is available on http://host:8000/build/ng-admin.min.js

make NGADMIN_SERVER_URL=host serve-ngadmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment