27
Makefile
27
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
|
||||
# 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 install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count vagrant-acl-add vagrant-dokku
|
||||
|
||||
all:
|
||||
# Type "make install" to install.
|
||||
@@ -41,26 +49,27 @@ pluginhook:
|
||||
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
|
||||
curl https://get.docker.io/gpg | apt-key add -
|
||||
curl --silent https://get.docker.io/gpg | apt-key add -
|
||||
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 -y lxc-docker-${DOCKER_VERSION}
|
||||
apt-get install -qq -y lxc-docker-${DOCKER_VERSION}
|
||||
else
|
||||
apt-get install -y lxc-docker
|
||||
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 -y linux-image-extra-`uname -r`
|
||||
lsmod | grep aufs || modprobe aufs || apt-get install -qq -y linux-image-extra-`uname -r` > /dev/null
|
||||
|
||||
stack:
|
||||
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
|
||||
@docker images | grep progrium/buildstep || curl -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - progrium/buildstep
|
||||
@docker images | grep progrium/buildstep || curl --silent -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - progrium/buildstep
|
||||
endif
|
||||
|
||||
count:
|
||||
@@ -70,3 +79,9 @@ count:
|
||||
@find plugins -type f | xargs cat | wc -l
|
||||
@echo "Test lines:"
|
||||
@find tests -type f | xargs cat | wc -l
|
||||
|
||||
vagrant-acl-add:
|
||||
vagrant ssh -- sudo sshcommand acl-add dokku $(USER)
|
||||
|
||||
vagrant-dokku:
|
||||
vagrant ssh -- "sudo -H -u root bash -c 'dokku $(RUN_ARGS)'"
|
||||
|
||||
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@@ -29,5 +29,5 @@ Vagrant::configure("2") do |config|
|
||||
vb.customize ["modifyvm", :id, "--memory", BOX_MEMORY]
|
||||
end
|
||||
|
||||
config.vm.provision :shell, :inline => "apt-get -y install git && cd /root/dokku && #{make_cmd}"
|
||||
config.vm.provision :shell, :inline => "apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
|
||||
end
|
||||
|
||||
@@ -10,9 +10,9 @@ then
|
||||
fi
|
||||
|
||||
apt-get update
|
||||
apt-get install -y git make curl software-properties-common
|
||||
apt-get install -qq -y git make curl software-properties-common
|
||||
|
||||
[[ `lsb_release -sr` == "12.04" ]] && apt-get install -y python-software-properties
|
||||
[[ `lsb_release -sr` == "12.04" ]] && apt-get install -qq -y python-software-properties
|
||||
|
||||
cd ~ && test -d dokku || git clone $DOKKU_REPO
|
||||
cd dokku
|
||||
|
||||
@@ -85,10 +85,10 @@ sudo BUILD_STACK=true make install
|
||||
|
||||
- Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
|
||||
- Download and install [Vagrant](http://www.vagrantup.com/downloads.html)
|
||||
- Download Dokku (latest stable)
|
||||
- Clone Dokku
|
||||
|
||||
```
|
||||
wget https://github.com/progrium/dokku/archive/master.zip
|
||||
git clone git@github.com:progrium/dokku.git
|
||||
```
|
||||
|
||||
- Setup SSH hosts in your `/etc/hosts`
|
||||
@@ -115,10 +115,10 @@ sudo BUILD_STACK=true make install
|
||||
vagrant up
|
||||
```
|
||||
|
||||
- Add SSH key to Dokku using `sshcommand acl-add <user> <ssh-key-name>`, e.g.:
|
||||
- Add SSH key to Dokku using `sshcommand`:
|
||||
|
||||
```
|
||||
cat ~/.ssh/id_rsa.pub | ssh -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo sshcommand acl-add dokku progrium"
|
||||
```bash
|
||||
cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
|
||||
```
|
||||
|
||||
You are now ready to deploy an app or install plugins.
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# latest stable NGINX 1.4.x with websocket support
|
||||
apt-get install -qq -y software-properties-common python-software-properties
|
||||
add-apt-repository -y ppa:nginx/stable
|
||||
apt-get update
|
||||
apt-get install -y nginx dnsutils
|
||||
apt-get install -qq -y nginx dnsutils
|
||||
|
||||
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
|
||||
touch /etc/sudoers.tmp
|
||||
|
||||
@@ -11,7 +11,7 @@ if [[ $2 == *dokku* ]]; then
|
||||
cd /tmp/build
|
||||
tar -xf -
|
||||
echo "-----> Installing dependencies"
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y git make curl software-properties-common
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -qq -y git make curl software-properties-common
|
||||
echo "-----> Set hostname to dokku.me"
|
||||
hostname dokku.me
|
||||
echo "-----> Enabling tracing"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get install -y git make curl
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get install -qq -y git make curl
|
||||
|
||||
cd /tmp
|
||||
|
||||
@@ -24,4 +24,4 @@ EOF
|
||||
cat<<EOF > /etc/rc.local
|
||||
curl https://raw.github.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver
|
||||
chmod +x /tmp/receiver
|
||||
EOF
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user