Skip to content

Commit

Permalink
update build to run as current user
Browse files Browse the repository at this point in the history
pass user and group id in docker run command to run it as current user

Signed-off-by: Shovan Maity <[email protected]>
  • Loading branch information
shovanmaity committed Oct 14, 2019
1 parent 86d83c6 commit 95b2317
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ $(SCOPE_UI_TOOLCHAIN_UPTODATE): client/yarn.lock $(SCOPE_UI_BUILD_UPTODATE)
-v $(shell pwd)/client:/home/weave/scope/client \
-v $(shell pwd)/$(SCOPE_UI_TOOLCHAIN):/home/weave/scope/client/node_modules \
-w /home/weave/scope/client \
-u $(shell id -u ${USER}):$(shell id -g ${USER}) \
$(SCOPE_UI_BUILD_IMAGE) yarn install; \
fi
touch $(SCOPE_UI_TOOLCHAIN_UPTODATE)
Expand All @@ -165,6 +166,7 @@ client/build/index.html: $(shell find client/app -type f) $(SCOPE_UI_TOOLCHAIN_U
-v $(shell pwd)/client:/home/weave/scope/client \
-v $(shell pwd)/$(SCOPE_UI_TOOLCHAIN):/home/weave/scope/client/node_modules \
-w /home/weave/scope/client \
-u $(shell id -u ${USER}):$(shell id -g ${USER}) \
$(SCOPE_UI_BUILD_IMAGE) yarn run build; \
fi

Expand All @@ -176,6 +178,7 @@ client/build-external/index.html: $(shell find client/app -type f) $(SCOPE_UI_TO
-v $(shell pwd)/client:/home/weave/scope/client \
-v $(shell pwd)/$(SCOPE_UI_TOOLCHAIN):/home/weave/scope/client/node_modules \
-w /home/weave/scope/client \
-u $(shell id -u ${USER}):$(shell id -g ${USER}) \
$(SCOPE_UI_BUILD_IMAGE) yarn run build-external; \
fi

Expand All @@ -185,6 +188,7 @@ client-test: $(shell find client/app/scripts -type f) $(SCOPE_UI_TOOLCHAIN_UPTOD
-v $(shell pwd)/client:/home/weave/scope/client \
-v $(shell pwd)/$(SCOPE_UI_TOOLCHAIN):/home/weave/scope/client/node_modules \
-w /home/weave/scope/client \
-u $(id -u ${USER}):$(id -g ${USER}) \
$(SCOPE_UI_BUILD_IMAGE) yarn test

client-lint: $(SCOPE_UI_TOOLCHAIN_UPTODATE)
Expand All @@ -193,6 +197,7 @@ client-lint: $(SCOPE_UI_TOOLCHAIN_UPTODATE)
-v $(shell pwd)/client:/home/weave/scope/client \
-v $(shell pwd)/$(SCOPE_UI_TOOLCHAIN):/home/weave/scope/client/node_modules \
-w /home/weave/scope/client \
-u $(shell id -u ${USER}):$(shell id -g ${USER}) \
$(SCOPE_UI_BUILD_IMAGE) yarn run lint

client-start: $(SCOPE_UI_TOOLCHAIN_UPTODATE)
Expand All @@ -202,6 +207,7 @@ client-start: $(SCOPE_UI_TOOLCHAIN_UPTODATE)
-v $(shell pwd)/$(SCOPE_UI_TOOLCHAIN):/home/weave/scope/client/node_modules \
-e WEBPACK_SERVER_HOST \
-w /home/weave/scope/client \
-u $(shell id -u ${USER}):$(shell id -g ${USER}) \
$(SCOPE_UI_BUILD_IMAGE) yarn start

client/bundle/weave-scope.tgz: $(shell find client/app -type f) $(SCOPE_UI_TOOLCHAIN_UPTODATE)
Expand All @@ -211,6 +217,7 @@ client/bundle/weave-scope.tgz: $(shell find client/app -type f) $(SCOPE_UI_TOOLC
-v $(shell pwd)/$(SCOPE_UI_TOOLCHAIN):/home/weave/scope/client/node_modules \
-v $(shell pwd)/tmp:/home/weave/tmp \
-w /home/weave/scope/client \
-u $(shell id -u ${USER}):$(shell id -g ${USER}) \
$(SCOPE_UI_BUILD_IMAGE) yarn run bundle

else
Expand Down

0 comments on commit 95b2317

Please sign in to comment.