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
|
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz
|
||||||
DOKKU_ROOT ?= /home/dokku
|
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:
|
all:
|
||||||
# Type "make install" to install.
|
# Type "make install" to install.
|
||||||
@@ -41,26 +49,27 @@ pluginhook:
|
|||||||
dpkg -i /tmp/pluginhook_0.1.0_amd64.deb
|
dpkg -i /tmp/pluginhook_0.1.0_amd64.deb
|
||||||
|
|
||||||
docker: aufs
|
docker: aufs
|
||||||
|
apt-get install -qq -y curl
|
||||||
egrep -i "^docker" /etc/group || groupadd docker
|
egrep -i "^docker" /etc/group || groupadd docker
|
||||||
usermod -aG docker dokku
|
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
|
echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
|
||||||
apt-get update
|
apt-get update
|
||||||
ifdef DOCKER_VERSION
|
ifdef DOCKER_VERSION
|
||||||
apt-get install -y lxc-docker-${DOCKER_VERSION}
|
apt-get install -qq -y lxc-docker-${DOCKER_VERSION}
|
||||||
else
|
else
|
||||||
apt-get install -y lxc-docker
|
apt-get install -qq -y lxc-docker
|
||||||
endif
|
endif
|
||||||
sleep 2 # give docker a moment i guess
|
sleep 2 # give docker a moment i guess
|
||||||
|
|
||||||
aufs:
|
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:
|
stack:
|
||||||
ifdef BUILD_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)
|
@docker images | grep progrium/buildstep || (git clone ${STACK_URL} /tmp/buildstep && docker build -t progrium/buildstep /tmp/buildstep && rm -rf /tmp/buildstep)
|
||||||
else
|
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
|
endif
|
||||||
|
|
||||||
count:
|
count:
|
||||||
@@ -70,3 +79,9 @@ count:
|
|||||||
@find plugins -type f | xargs cat | wc -l
|
@find plugins -type f | xargs cat | wc -l
|
||||||
@echo "Test lines:"
|
@echo "Test lines:"
|
||||||
@find tests -type f | xargs cat | wc -l
|
@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]
|
vb.customize ["modifyvm", :id, "--memory", BOX_MEMORY]
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
apt-get update
|
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 ~ && test -d dokku || git clone $DOKKU_REPO
|
||||||
cd dokku
|
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 [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
|
||||||
- Download and install [Vagrant](http://www.vagrantup.com/downloads.html)
|
- 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`
|
- Setup SSH hosts in your `/etc/hosts`
|
||||||
@@ -115,10 +115,10 @@ sudo BUILD_STACK=true make install
|
|||||||
vagrant up
|
vagrant up
|
||||||
```
|
```
|
||||||
|
|
||||||
- Add SSH key to Dokku using `sshcommand acl-add <user> <ssh-key-name>`, e.g.:
|
- Add SSH key to Dokku using `sshcommand`:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
cat ~/.ssh/id_rsa.pub | ssh -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo sshcommand acl-add dokku progrium"
|
cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
|
||||||
```
|
```
|
||||||
|
|
||||||
You are now ready to deploy an app or install plugins.
|
You are now ready to deploy an app or install plugins.
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
# latest stable NGINX 1.4.x with websocket support
|
# 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
|
add-apt-repository -y ppa:nginx/stable
|
||||||
apt-get update
|
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
|
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
|
||||||
touch /etc/sudoers.tmp
|
touch /etc/sudoers.tmp
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if [[ $2 == *dokku* ]]; then
|
|||||||
cd /tmp/build
|
cd /tmp/build
|
||||||
tar -xf -
|
tar -xf -
|
||||||
echo "-----> Installing dependencies"
|
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"
|
echo "-----> Set hostname to dokku.me"
|
||||||
hostname dokku.me
|
hostname dokku.me
|
||||||
echo "-----> Enabling tracing"
|
echo "-----> Enabling tracing"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get install -y git make curl
|
apt-get install -qq -y git make curl
|
||||||
|
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
|
||||||
@@ -24,4 +24,4 @@ EOF
|
|||||||
cat<<EOF > /etc/rc.local
|
cat<<EOF > /etc/rc.local
|
||||||
curl https://raw.github.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver
|
curl https://raw.github.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver
|
||||||
chmod +x /tmp/receiver
|
chmod +x /tmp/receiver
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user