Files
dokku/Makefile

92 lines
2.9 KiB
Makefile
Raw Normal View History

DOKKU_VERSION = master
SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand
PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
STACK_URL ?= https://github.com/progrium/buildstep.git
2014-03-08 13:25:09 -08:00
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz
DOKKU_ROOT ?= /home/dokku
2014-10-06 18:31:17 -04:00
# If the first argument is "vagrant-dokku"...
ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "vagrant-dokku"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
2014-10-06 18:31:17 -04:00
.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count vagrant-acl-add vagrant-dokku
all:
# Type "make install" to install.
install: dependencies stack copyfiles plugin-dependencies plugins version
copyfiles: addman
2013-06-15 15:02:44 -07:00
cp dokku /usr/local/bin/dokku
2013-06-30 11:02:40 -05:00
mkdir -p /var/lib/dokku/plugins
cp -r plugins/* /var/lib/dokku/plugins
2014-03-08 11:46:46 -05:00
addman:
2014-03-08 11:46:46 -05:00
mkdir -p /usr/local/share/man/man1
cp dokku.1 /usr/local/share/man/man1/dokku.1
mandb
version:
git describe --tags > ${DOKKU_ROOT}/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ${DOKKU_ROOT}/VERSION
plugin-dependencies: pluginhook
dokku plugins-install-dependencies
plugins: pluginhook docker
2013-07-02 23:02:42 +02:00
dokku plugins-install
dependencies: sshcommand pluginhook docker stack
sshcommand:
2013-06-11 20:40:48 -07:00
wget -qO /usr/local/bin/sshcommand ${SSHCOMMAND_URL}
chmod +x /usr/local/bin/sshcommand
sshcommand create dokku /usr/local/bin/dokku
2013-06-30 10:37:32 -05:00
pluginhook:
2013-06-30 10:41:47 -05:00
wget -qO /tmp/pluginhook_0.1.0_amd64.deb ${PLUGINHOOK_URL}
dpkg -i /tmp/pluginhook_0.1.0_amd64.deb
docker: aufs
apt-get install -qq -y curl
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
2014-10-04 07:48:26 -04:00
curl --silent https://get.docker.io/gpg | apt-key add -
2013-10-17 21:30:07 +02:00
echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-get update
ifdef DOCKER_VERSION
apt-get install -qq -y lxc-docker-${DOCKER_VERSION}
else
apt-get install -qq -y lxc-docker
endif
sleep 2 # give docker a moment i guess
aufs:
lsmod | grep aufs || modprobe aufs || apt-get install -qq -y linux-image-extra-`uname -r` > /dev/null
stack:
@echo "Start building buildstep"
ifdef BUILD_STACK
@docker images | grep progrium/buildstep || (git clone ${STACK_URL} /tmp/buildstep && docker build -t progrium/buildstep /tmp/buildstep && rm -rf /tmp/buildstep)
else
2014-10-04 07:48:26 -04:00
@docker images | grep progrium/buildstep || curl --silent -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - progrium/buildstep
endif
2013-06-30 10:37:32 -05:00
2013-06-10 23:37:23 -07:00
count:
2013-06-30 17:56:02 -05:00
@echo "Core lines:"
2013-11-11 11:42:15 -08:00
@cat dokku bootstrap.sh | wc -l
2013-06-30 17:56:02 -05:00
@echo "Plugin lines:"
@find plugins -type f | xargs cat | wc -l
@echo "Test lines:"
2013-07-02 23:02:42 +02:00
@find tests -type f | xargs cat | wc -l
2014-10-06 18:31:17 -04:00
vagrant-acl-add:
vagrant ssh -- sudo sshcommand acl-add dokku $(USER)
2014-10-06 18:31:17 -04:00
vagrant-dokku:
vagrant ssh -- "sudo -H -u root bash -c 'dokku $(RUN_ARGS)'"