Files
dokku/Makefile

141 lines
4.8 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
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2015-07-14/2015-07-14_1afb78e747.tar.gz
PLUGINS_PATH ?= /var/lib/dokku/plugins
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
.PHONY: all apt-update install copyfiles man-db version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku
2014-12-13 18:56:31 -08:00
include tests.mk
include deb.mk
2014-12-13 18:56:31 -08:00
all:
# Type "make install" to install.
2015-03-27 14:26:21 -07:00
install: dependencies copyfiles plugin-dependencies plugins version
release: deb-all package_cloud packer
package_cloud:
2015-01-16 16:56:16 -05:00
package_cloud push dokku/dokku/ubuntu/trusty buildstep*.deb
package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb
package_cloud push dokku/dokku/ubuntu/trusty pluginhook*.deb
package_cloud push dokku/dokku/ubuntu/trusty rubygem*.deb
package_cloud push dokku/dokku/ubuntu/trusty dokku*.deb
packer:
2015-01-16 16:56:16 -05:00
packer build contrib/packer.json
copyfiles:
2013-06-15 15:02:44 -07:00
cp dokku /usr/local/bin/dokku
mkdir -p ${PLUGINS_PATH}
find ${PLUGINS_PATH} -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf
2013-11-29 20:31:22 +00:00
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \
2014-12-13 18:56:31 -08:00
rm -Rf ${PLUGINS_PATH}/$$plugin && \
cp -R plugins/$$plugin ${PLUGINS_PATH} && \
touch ${PLUGINS_PATH}/$$plugin/.core; \
done
$(MAKE) addman
2014-03-08 11:46:46 -05:00
addman:
2014-03-08 11:46:46 -05:00
mkdir -p /usr/local/share/man/man1
help2man -Nh help -v version -n "configure and get information from your dokku installation" -o /usr/local/share/man/man1/dokku.1 dokku
2014-03-08 11:46:46 -05:00
mandb
version:
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
plugin-dependencies: pluginhook
dokku plugins-install-dependencies
plugins: pluginhook docker
2013-07-02 23:02:42 +02:00
dokku plugins-install
dependencies: apt-update sshcommand pluginhook docker help2man man-db
2015-03-27 14:26:21 -07:00
$(MAKE) -e stack
apt-update:
apt-get update
help2man:
apt-get install -qq -y help2man
man-db:
apt-get install -qq -y man-db
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
2015-05-27 13:19:28 -07:00
ifndef CI
curl -sSL https://get.docker.com/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-1.6.2
endif
sleep 2 # give docker a moment i guess
2015-05-27 13:19:28 -07:00
endif
aufs:
2014-12-13 18:56:31 -08:00
ifndef CI
lsmod | grep aufs || modprobe aufs || apt-get install -qq -y linux-image-extra-`uname -r` > /dev/null
2014-12-13 18:56:31 -08:00
endif
stack:
ifeq ($(shell test -e /var/run/docker.sock && touch -a -c /var/run/docker.sock && echo $$?),0)
2014-10-20 10:34:34 -05:00
@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
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:"
2015-02-06 14:37:52 -08:00
@cat dokku bootstrap.sh | egrep -v "^$$" | wc -l
2013-06-30 17:56:02 -05:00
@echo "Plugin lines:"
2015-02-06 14:37:52 -08:00
@find plugins -type f | xargs cat | egrep -v "^$$" | wc -l
2013-06-30 17:56:02 -05:00
@echo "Test lines:"
2015-02-06 14:37:52 -08:00
@find tests -type f | xargs cat | egrep -v "^$$" |wc -l
dokku-installer:
apt-get install -qq -y ruby
test -f /var/lib/dokku/.dokku-installer-created || gem install rack -v 1.5.2 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install rack-protection -v 1.5.3 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install sinatra -v 1.4.5 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install tilt -v 1.4.1 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || ruby contrib/dokku-installer.rb onboot
test -f /var/lib/dokku/.dokku-installer-created || service dokku-installer start
test -f /var/lib/dokku/.dokku-installer-created || service nginx reload
test -f /var/lib/dokku/.dokku-installer-created || touch /var/lib/dokku/.dokku-installer-created
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)'"
2014-12-13 18:56:31 -08:00