Allow building the supervisor source without optimizations for easier debugging with dindctl

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2017-07-26 15:43:44 -03:00
parent babee8667e
commit f5f8ca6df2
2 changed files with 12 additions and 2 deletions

13
dindctl
View File

@ -46,6 +46,7 @@ SUPERVISOR_EXTRA_MOUNTS=""
DIST_MOUNTED="false"
DIND_IMAGE="resin-supervisor-dind"
PRELOADED_IMAGE=""
OPTIMIZE="true"
function showHelp {
cat $THIS_FILE | awk '{if(/^#/)print;else exit}' | tail -n +2 | sed 's/\#//' | sed 's|dindctl|'$THIS_FILE'|'
@ -80,6 +81,9 @@ function parseOptions {
ARCH="$2"
shift || { echo "--arch provided not specified" && exit 1; }
;;
--no-optimize)
OPTIMIZE="false"
;;
*)
echo "Warning: unknown argument: $arg"
;;
@ -97,8 +101,13 @@ function buildSupervisor {
}
function buildSupervisorSrc {
echo "Rebuilding supervisor source"
( cd "$SUPERVISOR_BASE_DIR" && npm install && npm run build )
if [ "$OPTIMIZE" = "true" ]; then
echo "Rebuilding supervisor source"
( cd "$SUPERVISOR_BASE_DIR" && npm install && npm run build )
else
echo "Rebuilding supervisor source without optimizations"
( cd "$SUPERVISOR_BASE_DIR" && npm install && npm run build-no-optimize )
fi
}
function refreshSupervisorSrc {

View File

@ -10,6 +10,7 @@
"scripts": {
"start": "./entry.sh",
"build": "webpack --optimize-minimize",
"build-no-optimize": "webpack",
"lint": "resin-lint src/",
"versionist": "versionist"
},