diff --git a/Makefile b/Makefile index 869e56f0d..b42156fd5 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,15 @@ STACK_URL ?= https://github.com/progrium/buildstep.git PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz DOKKU_ROOT ?= /home/dokku -.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count acl-add +# If the first argument is "dokku"... +ifeq (dokku,$(firstword $(MAKECMDGOALS))) + # use the rest as arguments for "dokku" + RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) + # ...and turn them into do-nothing targets + $(eval $(RUN_ARGS):;@:) +endif + +.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count acl-add dokku all: # Type "make install" to install. @@ -75,3 +83,5 @@ count: acl-add: vagrant ssh -- sudo sshcommand acl-add dokku $(USER) +dokku: + vagrant ssh -- "sudo -H -u root bash -c 'dokku $(RUN_ARGS)'"