From 78591a618b4bffcdfb9089ddeca20218b8110f10 Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Fri, 29 Nov 2013 14:12:10 +0000 Subject: [PATCH 01/61] Remove plugins before copying them again. This way plugins can rename/delete files w/o having old files lying around. --- Makefile | 1 + plugins/nginx-vhosts/commands | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100755 plugins/nginx-vhosts/commands diff --git a/Makefile b/Makefile index a30252443..4aac37a20 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ install: dependencies stack copyfiles plugins version copyfiles: cp dokku /usr/local/bin/dokku + rm -Rf /var/lib/dokku/plugins mkdir -p /var/lib/dokku/plugins cp -r plugins/* /var/lib/dokku/plugins diff --git a/plugins/nginx-vhosts/commands b/plugins/nginx-vhosts/commands deleted file mode 100755 index bb5defd1e..000000000 --- a/plugins/nginx-vhosts/commands +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x - -case "$1" in - help) - cat - ;; -esac - From 4da4995a18f9088ab2bbfc34d04e35bcc0afbb0b Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Fri, 29 Nov 2013 20:31:22 +0000 Subject: [PATCH 02/61] Only delete core plugins. --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4aac37a20..70506e6da 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,13 @@ install: dependencies stack copyfiles plugins version copyfiles: cp dokku /usr/local/bin/dokku - rm -Rf /var/lib/dokku/plugins mkdir -p /var/lib/dokku/plugins - cp -r plugins/* /var/lib/dokku/plugins + find /var/lib/dokku/plugins -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf + find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \ + rm -Rf /var/lib/dokku/plugins/$$plugin && \ + cp -R plugins/$$plugin /var/lib/dokku/plugins && \ + touch /var/lib/dokku/plugins/$$plugin/.core; \ + done version: git describe --tags > ${DOKKU_ROOT}/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ${DOKKU_ROOT}/VERSION From fde5054e0f63b568b0927d59dbf62f23d19d4d9b Mon Sep 17 00:00:00 2001 From: joliv Date: Sat, 10 May 2014 16:32:27 -0400 Subject: [PATCH 03/61] Added man page plugin command warning As of now, the man page does not update when plugins are installed. --- dokku.1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dokku.1 b/dokku.1 index e69adc402..0ab42e984 100644 --- a/dokku.1 +++ b/dokku.1 @@ -56,3 +56,9 @@ Show the url for an app. .TP .B version Print dokku's version. +.\" +.SH NOTES +This man page does not include commands added +by non-default plugins. To see the full list +of commands available to your current dokku +installation, run \fBdokku help\fR. From d269782812b9e01d9a3c7c7b7ccfa6bb29189c07 Mon Sep 17 00:00:00 2001 From: joliv Date: Sat, 10 May 2014 16:43:21 -0400 Subject: [PATCH 04/61] Updated man page date I forgot to change it. I even left myself a reminder! --- dokku.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokku.1 b/dokku.1 index 0ab42e984..efce792f2 100644 --- a/dokku.1 +++ b/dokku.1 @@ -1,4 +1,4 @@ -.TH DOKKU 1 2014-03-08 +.TH DOKKU 1 2014-05-10 .\"Make sure to change that date when you commit a change! .\" .SH NAME From 22cdc11d57f2d9fd89f836bf204e54d6ea799404 Mon Sep 17 00:00:00 2001 From: Fabien Bochu Date: Wed, 11 Jun 2014 23:46:50 +0200 Subject: [PATCH 05/61] Use PLUGIN_PATH in dokku default case. --- dokku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokku b/dokku index e0b61ba63..b547d7893 100755 --- a/dokku +++ b/dokku @@ -106,7 +106,7 @@ EOF ;; *) - for script in $(ls -d /var/lib/dokku/plugins/*/commands); do + for script in $(ls -d $PLUGIN_PATH/*/commands); do $script "$@" done ;; From 22beb6c00714cfa1055270acbffcbedc2549b425 Mon Sep 17 00:00:00 2001 From: Alex Ernst Date: Fri, 22 Aug 2014 12:36:20 +0200 Subject: [PATCH 06/61] move post-deploy hook Write $DOKKU_ROOT/$APP/URL before post-deploy hook. --- dokku | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dokku b/dokku index dd445a9ba..d6d23a712 100755 --- a/dokku +++ b/dokku @@ -77,15 +77,16 @@ case "$1" in trap kill_new INT TERM EXIT echo "-----> Running pre-flight checks" pluginhook check-deploy $id $APP $port - echo "-----> Running post-deploy" - pluginhook post-deploy $APP $port - trap - INT TERM EXIT # now using the new container echo $id > "$DOKKU_ROOT/$APP/CONTAINER" echo $port > "$DOKKU_ROOT/$APP/PORT" echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$port" > "$DOKKU_ROOT/$APP/URL" + echo "-----> Running post-deploy" + pluginhook post-deploy $APP $port + trap - INT TERM EXIT + # kill the old container if [[ -n "$oldid" ]]; then docker inspect $oldid &> /dev/null && docker kill $oldid > /dev/null From d9952bcae8466e2c5f262f25482818452b0ba4c3 Mon Sep 17 00:00:00 2001 From: Tom Bell Date: Sun, 28 Sep 2014 01:03:07 +0100 Subject: [PATCH 07/61] Make help output more consistent --- dokku | 6 +++--- plugins/config/commands | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dokku b/dokku index dd445a9ba..16b0dd2fd 100755 --- a/dokku +++ b/dokku @@ -118,9 +118,9 @@ case "$1" in help) cat< display the config vars for an app - config:get KEY display a config value for an app - config:set KEY1=VALUE1 [KEY2=VALUE2 ...] set one or more config vars - config:unset KEY1 [KEY2 ...] unset one or more config vars + config Display the config vars for an app + config:get KEY Display a config value for an app + config:set KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars + config:unset KEY1 [KEY2 ...] Unset one or more config vars EOF ;; From 42c9d7aaa67b8f85dfd868fd0975590356e49dfa Mon Sep 17 00:00:00 2001 From: Tom Bell Date: Tue, 30 Sep 2014 21:08:23 +0100 Subject: [PATCH 08/61] Actually suppress the output from the git commands --- plugins/git/commands | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/git/commands b/plugins/git/commands index 92daf1693..e42246fb4 100755 --- a/plugins/git/commands +++ b/plugins/git/commands @@ -6,11 +6,11 @@ git_archive_all() { TMP_WORK_DIR=$(mktemp -d) chmod 755 $TMP_WORK_DIR unset GIT_DIR GIT_WORK_TREE - git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR > /dev/null + git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null pushd $TMP_WORK_DIR > /dev/null git config advice.detachedHead false - git checkout $REV > /dev/null - git submodule update --init --recursive > /dev/null + git checkout $REV &> /dev/null + git submodule update --init --recursive &> /dev/null find -name .git -prune -exec rm -rf {} \; > /dev/null tar c . popd > /dev/null From 2e5f88b285ee8b73b59c1a74d599bee230b4079e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 4 Oct 2014 07:48:08 -0400 Subject: [PATCH 09/61] Use -qq flag on apt-get to quiet installations of packages --- Makefile | 6 +++--- Vagrantfile | 2 +- bootstrap.sh | 4 ++-- plugins/nginx-vhosts/install | 2 +- tests/ci/receiver | 2 +- tests/ci/setup.sh | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index cfac50ca2..d4e58fea6 100644 --- a/Makefile +++ b/Makefile @@ -47,14 +47,14 @@ docker: aufs 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 diff --git a/Vagrantfile b/Vagrantfile index 005f6c3b5..8f4d8e700 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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 diff --git a/bootstrap.sh b/bootstrap.sh index 0acc430a7..7cf58ceab 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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 diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index bcbc1f063..7a28d958c 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -4,7 +4,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # latest stable NGINX 1.4.x with websocket support 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 diff --git a/tests/ci/receiver b/tests/ci/receiver index 710a01df0..2d3db4aac 100755 --- a/tests/ci/receiver +++ b/tests/ci/receiver @@ -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" diff --git a/tests/ci/setup.sh b/tests/ci/setup.sh index d020280af..d22fafefa 100755 --- a/tests/ci/setup.sh +++ b/tests/ci/setup.sh @@ -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< /etc/rc.local curl https://raw.github.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver chmod +x /tmp/receiver -EOF \ No newline at end of file +EOF From a748e123be67844de732525b806811f60d8606ee Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 4 Oct 2014 07:48:26 -0400 Subject: [PATCH 10/61] Silence curl stderr progress output --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d4e58fea6..1584e63d4 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ pluginhook: docker: aufs 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 @@ -60,7 +60,7 @@ 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: From c5026cafa1e8a71b5a11789b7434e118342d7cfa Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 4 Oct 2014 07:49:32 -0400 Subject: [PATCH 11/61] Ensure curl is installed before using command --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 1584e63d4..8ca2b4bb7 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,7 @@ 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 --silent https://get.docker.io/gpg | apt-key add - From a67c2c927da5c3d5d2a06ab492ba4b2866c77aa3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 4 Oct 2014 07:49:56 -0400 Subject: [PATCH 12/61] Fix issue where certain hosts will not have add-apt-repository installed due to missing packages --- plugins/nginx-vhosts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index 7a28d958c..52d35e1f8 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -2,6 +2,7 @@ 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 -qq -y nginx dnsutils From 14145eebb1a640efab7d77624bd1fe3ae0ed8690 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 4 Oct 2014 18:37:23 -0400 Subject: [PATCH 13/61] Simplify the vagrant workflow - Moved from wget to cloning the repository - Add acl-add command to Make - Modify the docs to use the new methodology --- Makefile | 6 +++++- docs/installation.md | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8ca2b4bb7..869e56f0d 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ 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 +.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count acl-add all: # Type "make install" to install. @@ -71,3 +71,7 @@ count: @find plugins -type f | xargs cat | wc -l @echo "Test lines:" @find tests -type f | xargs cat | wc -l + +acl-add: + vagrant ssh -- sudo sshcommand acl-add dokku $(USER) + diff --git a/docs/installation.md b/docs/installation.md index 62c5f9771..79b6e5815 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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 `, 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 acl-add ``` You are now ready to deploy an app or install plugins. From ab44c915a8c8fb36592ec18855ab289ef0dd28fc Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 4 Oct 2014 18:38:37 -0400 Subject: [PATCH 14/61] Add a passthru make target for running dokku commands within the vagrant vm --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)'" From b9eed22e35d26a79dd2c7b9a9148af5d9659878b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 6 Oct 2014 18:31:17 -0400 Subject: [PATCH 15/61] Change targets to vagrant-* --- Makefile | 12 ++++++------ docs/installation.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b42156fd5..a29f02c2a 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +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 -# If the first argument is "dokku"... -ifeq (dokku,$(firstword $(MAKECMDGOALS))) - # use the rest as arguments for "dokku" +# 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 acl-add dokku +.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count vagrant-acl-add vagrant-dokku all: # Type "make install" to install. @@ -80,8 +80,8 @@ count: @echo "Test lines:" @find tests -type f | xargs cat | wc -l -acl-add: +vagrant-acl-add: vagrant ssh -- sudo sshcommand acl-add dokku $(USER) -dokku: +vagrant-dokku: vagrant ssh -- "sudo -H -u root bash -c 'dokku $(RUN_ARGS)'" diff --git a/docs/installation.md b/docs/installation.md index 79b6e5815..5855e7275 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -118,7 +118,7 @@ sudo BUILD_STACK=true make install - Add SSH key to Dokku using `sshcommand`: ```bash - cat ~/.ssh/id_rsa.pub | make acl-add + cat ~/.ssh/id_rsa.pub | make vagrant-acl-add ``` You are now ready to deploy an app or install plugins. From 59e078440d2856236419bfc6aad96d6aee01bceb Mon Sep 17 00:00:00 2001 From: protomouse Date: Sat, 23 Aug 2014 14:19:46 +0200 Subject: [PATCH 16/61] Explicitly install man-db Dokku requires mandb, but the man-db package is not part of the minimal Ubuntu base - so install it. --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh old mode 100644 new mode 100755 index 7cf58ceab..9b02aaff9 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -10,7 +10,7 @@ then fi apt-get update -apt-get install -qq -y git make curl software-properties-common +apt-get install -qq -y git make curl software-properties-common man-db [[ `lsb_release -sr` == "12.04" ]] && apt-get install -qq -y python-software-properties From 0ec9ecad08a8de66d22cf10f7f685b224e2ea5e1 Mon Sep 17 00:00:00 2001 From: Ludovic Perrine Date: Fri, 6 Jun 2014 14:45:36 +0200 Subject: [PATCH 17/61] Restart app only if config changed --- plugins/config/commands | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/config/commands b/plugins/config/commands index f0c7412ea..492615a0c 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -9,6 +9,7 @@ if [[ $1 == config ]] || [[ $1 == config:* ]]; then else APP="$2" ENV_FILE="$DOKKU_ROOT/$APP/ENV" + ENV_FILE_TEMP="$DOKKU_ROOT/$APP/ENV.tmp" # Check if app exists with the same name if [ ! -d "$DOKKU_ROOT/$APP" ]; then @@ -59,6 +60,16 @@ config_restart_app() { echo "-----> Deploy complete!" } +config_write() { + ENV_TEMP="$1" + echo -e "$ENV_TEMP" | sed '/^$/d' | sort > $ENV_FILE_TEMP + if ! cmp -s $ENV_FILE $ENV_FILE_TEMP; then + cp -f $ENV_FILE_TEMP $ENV_FILE + config_restart_app $APP + fi + rm -f $ENV_FILE_TEMP +} + case "$1" in config) @@ -136,8 +147,7 @@ case "$1" in echo "-----> Setting config vars and restarting $APP" config_styled_hash "$ENV_ADD" - echo -e "$ENV_TEMP" | sed '/^$/d' | sort > $ENV_FILE - config_restart_app $APP + config_write "$ENV_TEMP" fi ;; @@ -156,8 +166,7 @@ case "$1" in echo "-----> Unsetting $var and restarting $APP" ENV_TEMP=$(echo -e "${ENV_TEMP}" | sed "/^export $var=/ d") - echo -e "$ENV_TEMP" | sed '/^$/d' | sort > $ENV_FILE - config_restart_app $APP + config_write "$ENV_TEMP" done ;; From 4cea884f16d3d92ab6e55ec28920cf914e5052ab Mon Sep 17 00:00:00 2001 From: Ludovic Perrine Date: Thu, 24 Jul 2014 17:55:35 +0200 Subject: [PATCH 18/61] Fixed port removal when docker is start with --ip with an IP other than 0.0.0.0 --- dokku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokku b/dokku index d83698e41..d933b112e 100755 --- a/dokku +++ b/dokku @@ -64,7 +64,7 @@ case "$1" in # start the app DOCKER_ARGS=$(: | pluginhook docker-args $APP) id=$(docker run -d -p 5000 -e PORT=5000 $DOCKER_ARGS $IMAGE /bin/bash -c "/start web") - port=$(docker port $id 5000 | sed 's/0.0.0.0://') + port=$(docker port $id 5000 | sed 's/[0-9.]*://') # if we can't post-deploy successfully, kill new container function kill_new { From 44cf7f09f919e826c2aad6f3c224c6a3f0f474e0 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Tue, 12 Aug 2014 05:23:35 +0100 Subject: [PATCH 19/61] Fixed variable name. RESTART_APP was initialized as RESTART. --- plugins/config/commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/config/commands b/plugins/config/commands index 492615a0c..3a3273e41 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -119,7 +119,7 @@ case "$1" in APP="$2"; APP_DIR="$DOKKU_ROOT/$APP" ENV_ADD="" ENV_TEMP=`cat "${ENV_FILE}"` - RESTART=false + RESTART_APP=false VARS="${*:3}" for var in $VARS; do From 2d737dc5546daf774e9247ccb6c690a4274d5770 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 16 Oct 2014 00:45:55 -0400 Subject: [PATCH 20/61] Env vars only set at run time. Closes #555 --- docs/configuration-management.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/configuration-management.md b/docs/configuration-management.md index 119c058d9..242325167 100644 --- a/docs/configuration-management.md +++ b/docs/configuration-management.md @@ -11,3 +11,4 @@ config:set KEY1=VALUE1 [KEY2=VALUE2 ...] - set one or more config vars config:unset KEY1 [KEY2 ...] - unset one or more config vars ``` +The variables are by default available only at run time, i.e. not when the application is being built/compiled. However there are [plugins](http://progrium.viewdocs.io/dokku/plugins) that can change that. From e94b46cb0c15809ce4fa5b75cb8408e302efb717 Mon Sep 17 00:00:00 2001 From: Stafford Brunk Date: Tue, 29 Oct 2013 14:44:48 -0600 Subject: [PATCH 21/61] Add a dependencies hook for plugin dependency management --- Makefile | 5 ++++- dokku | 4 ++++ plugins/nginx-vhosts/dependencies | 7 +++++++ plugins/nginx-vhosts/install | 6 ------ 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100755 plugins/nginx-vhosts/dependencies diff --git a/Makefile b/Makefile index a29f02c2a..add62273e 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ endif all: # Type "make install" to install. -install: dependencies stack copyfiles plugins version +install: dependencies stack copyfiles plugin-dependencies plugins version copyfiles: addman cp dokku /usr/local/bin/dokku @@ -34,6 +34,9 @@ addman: 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 dokku plugins-install diff --git a/dokku b/dokku index d933b112e..c27cf7f34 100755 --- a/dokku +++ b/dokku @@ -108,6 +108,10 @@ case "$1" in pluginhook install ;; + plugins-install-dependencies) + pluginhook dependencies + ;; + # temporary hack for https://github.com/progrium/dokku/issues/82 deploy:all) for app in $(ls -d $DOKKU_ROOT/*/); do diff --git a/plugins/nginx-vhosts/dependencies b/plugins/nginx-vhosts/dependencies new file mode 100755 index 000000000..8166474a1 --- /dev/null +++ b/plugins/nginx-vhosts/dependencies @@ -0,0 +1,7 @@ +#!/bin/bash + +# 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 -qq -y nginx dnsutils diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index 52d35e1f8..ae5fa5079 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -1,12 +1,6 @@ #!/usr/bin/env bash 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 -qq -y nginx dnsutils - if ! grep -q dokku-nginx-reload "/etc/sudoers"; then touch /etc/sudoers.tmp cp /etc/sudoers /tmp/sudoers.new From d8d759aea9d301d6394142445d289d8b1bc5b727 Mon Sep 17 00:00:00 2001 From: kristofsajdak Date: Thu, 16 Oct 2014 09:21:38 +0200 Subject: [PATCH 22/61] Update plugins.md --- docs/plugins.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/plugins.md b/docs/plugins.md index 4938cb478..a39497d3d 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -128,6 +128,7 @@ Note: The following plugins have been supplied by our community and may not have | [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | Compatible with 0.2.0 | | [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)1 | [musicglue][] | Compatible with dokku master branch | | [user-env-compile](https://github.com/motin/dokku-user-env-compile)1 | [motin][] | Compatible with 0.2.1 | +| [registry](https://github.com/agco-adm/dokku-registry)5 | [agco-adm](https://github.com/agco-adm) | | | [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)2 | [cedricziel][] | 2014-01-17: compatible with upstream/master | | [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)3 | [cedricziel][] | 2014-01-17: compatible with upstream/master | | [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | Requires dokku >= [c77cbf1][] | @@ -158,6 +159,8 @@ Note: The following plugins have been supplied by our community and may not have 4 Conflicts with [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) +5 On Heroku similar functionality is offered by the [heroku-labs pipeline feature](https://devcenter.heroku.com/articles/labs-pipelines), which allows you to promote builds across multiple environments (staging -> production) + ### Other Add-ons | Plugin | Author | Compatibility | From 3def960bf04e350da83752ee36c741b96a9f0e32 Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 16 Oct 2014 18:59:32 -0400 Subject: [PATCH 23/61] Update vagrant installation instructions Avoids ``` Permission denied (publickey). fatal: The remote end hung up unexpectedly ``` that can occur on certain Vagrant images. Since we need readonly anyway, might as well use HTTPS instead of SSH. --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 5855e7275..eed7a1fc7 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -88,7 +88,7 @@ sudo BUILD_STACK=true make install - Clone Dokku ``` - git clone git@github.com:progrium/dokku.git + git clone https://github.com/progrium/dokku.git ``` - Setup SSH hosts in your `/etc/hosts` From 65c499e439199bcab77f6e162cfcb06b5ecca7f9 Mon Sep 17 00:00:00 2001 From: Will Boyce Date: Sat, 18 Oct 2014 02:20:14 +0100 Subject: [PATCH 24/61] Fix `plugins-install-dependencies` [fixes #720] --- dokku | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dokku b/dokku index c27cf7f34..509310d50 100755 --- a/dokku +++ b/dokku @@ -7,7 +7,7 @@ export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"} [[ $DOKKU_TRACE ]] && set -x -if [[ $(id -un) != "dokku" && $1 != "plugins-install" ]]; then +if [[ $(id -un) != "dokku" && $1 != plugins-install* ]]; then sudo -u dokku -H $0 "$@" exit fi @@ -95,9 +95,9 @@ case "$1" in cleanup) # delete all non-running container - docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm &> /dev/null & + docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm &> /dev/null & # delete unused images - docker images | grep '' | awk '{print $3}' | xargs docker rmi &> /dev/null & + docker images | grep '' | awk '{print $3}' | xargs docker rmi &> /dev/null & ;; plugins) From 8231926eaa4672574513ba5d6aa12dcb1b082fab Mon Sep 17 00:00:00 2001 From: Jose-Luis Rivas Date: Mon, 20 Oct 2014 01:35:59 -0500 Subject: [PATCH 25/61] Let the user know it's on the `stack` target Since curl is running quietly it may give the impression that the installation hanged with the last message on the terminal being: "sleep 2 # give docker a moment i guess". In my case I thought it gave it a huge moment and not 2 seconds. It wasn't until the third time that I actually checked the processes on the machine and saw there it was curl downloading stuff quietly. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index add62273e..5933ada5c 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,7 @@ 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 From 4eecfcb825c548d040b6f082de2cb2d2f9b8d76d Mon Sep 17 00:00:00 2001 From: Jose-Luis Rivas Date: Mon, 20 Oct 2014 10:34:34 -0500 Subject: [PATCH 26/61] Fixing tabs issue Sorry --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5933ada5c..e29bde09a 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ aufs: lsmod | grep aufs || modprobe aufs || apt-get install -qq -y linux-image-extra-`uname -r` > /dev/null stack: -@echo "Start building buildstep" + @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 From c092dd1719b77843cc1c565688de9482f3046ede Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Tue, 28 Oct 2014 11:25:45 -0500 Subject: [PATCH 27/61] deis sponsorship --- README.md | 6 +++++- SPONSORS | 1 + docs/index.md | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 SPONSORS diff --git a/README.md b/README.md index 480ae1183..24086ab48 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dokku [![Build Status](https://travis-ci.org/progrium/dokku.png?branch=master)](https://travis-ci.org/progrium/dokku) -Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. +Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. Sponsored by our friends at [Deis](http://deis.io/). ## Requirements @@ -20,6 +20,10 @@ Full documentation - including advanced installation docs - are available online You can use [Github Issues](https://github.com/progrium/dokku/issues), check [Troubleshooting](https://github.com/progrium/dokku/wiki/Troubleshooting) on the wiki, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku) +## Sponsors + +Dokku is currented sponsored by the enterprise grade, multi-host PaaS project [Deis](http://deis.io/). + ## License MIT diff --git a/SPONSORS b/SPONSORS new file mode 100644 index 000000000..b910636d2 --- /dev/null +++ b/SPONSORS @@ -0,0 +1 @@ +Deis http://deis.io \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 5479727e4..f3e026625 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,6 +17,10 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. ## Things this project won't do - * **Multi-host.** Not a huge leap, but this isn't the project for it. Have a look at [Flynn](https://flynn.io/). - * **Multitenancy.** It's ready for it, but again, have a look at [Flynn](https://flynn.io/). + * **Multi-host.** Not a huge leap, but this isn't the project for it. Have a look at [Deis](http://deis.io/). + * **Multitenancy.** It's ready for it, but again, have a look at [Deis](http://deis.io/). * **Client app.** Given the constraints, running commands remotely via SSH is fine. + +## Sponsors + +Though we love everybody doing open source, we especially love [Deis](http://deis.io/) for sponsoring Dokku. \ No newline at end of file From 2b21fa3ed98402ec041d30fde171bd57247b813b Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Fri, 31 Oct 2014 17:52:58 -0400 Subject: [PATCH 28/61] Redirect to the app deployment docs on success. --- contrib/dokku-installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/dokku-installer.rb b/contrib/dokku-installer.rb index c8ce50227..ef06f64d5 100755 --- a/contrib/dokku-installer.rb +++ b/contrib/dokku-installer.rb @@ -96,7 +96,7 @@ __END__ $.post('/setup', data) .done(function() { $("#result").html("Success!") - window.location.href = "https://github.com/progrium/dokku#deploy-an-app"; + window.location.href = "http://progrium.viewdocs.io/dokku/application-deployment"; }) .fail(function(data) { $("#result").html("Something went wrong...") From a9d5516e04ca456822c719deabe8760f2a8c8119 Mon Sep 17 00:00:00 2001 From: Rui Carmo Date: Thu, 6 Nov 2014 22:05:35 +0000 Subject: [PATCH 29/61] Update README.md Sorry, that typo was getting to me :) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24086ab48..761753aa6 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ You can use [Github Issues](https://github.com/progrium/dokku/issues), check [Tr ## Sponsors -Dokku is currented sponsored by the enterprise grade, multi-host PaaS project [Deis](http://deis.io/). +Dokku is currently sponsored by the enterprise grade, multi-host PaaS project [Deis](http://deis.io/). ## License From 1cea737891b6d0ffe8be2ae1cc3cb575fce79ff6 Mon Sep 17 00:00:00 2001 From: vincentfretin Date: Tue, 11 Nov 2014 12:24:35 +0100 Subject: [PATCH 30/61] replace gitreceive by sshcommand in example url --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 5855e7275..f08f2eb87 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -55,7 +55,7 @@ environment variables may be set to override the defaults (see the `Makefile` fo apply). Example: ```bash -sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/gitreceive make install +sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/sshcommand make install ``` ### Bootstrap a server from your own repository From 9f52d02c30ae60c6ecbc78a8715acc6da11b34c4 Mon Sep 17 00:00:00 2001 From: vincentfretin Date: Tue, 11 Nov 2014 15:57:06 +0100 Subject: [PATCH 31/61] fix dokku development blog link http://progrium.com/dokku doesn't exist anymore. The blog is really at http://progrium.com/blog, but http://progrium.com is by default on the blog, so let's use this link. --- docs/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins.md b/docs/plugins.md index a39497d3d..8942bce40 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -26,7 +26,7 @@ If you create your own plugin: 1. take a look at the plugins shipped with dokku and hack away! 2. upload your plugin to github with a repository name in form of `dokku-` (e.g. `dokku-mariadb`) 3. edit this page and add a link to it below! -4. subscribe to the [dokku development blog](http://progrium.com/dokku/) to be notified about API changes and releases +4. subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases ## Community plugins From 977d00efb464823ad67b6c2c9a937bb56d0ec1ef Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Tue, 11 Nov 2014 16:13:35 +0100 Subject: [PATCH 32/61] The app certificates directory was renamed to tls in e2135a2c5f599184ce1f40beb21fccb9a0f8b8de --- plugins/nginx-vhosts/backup-export | 2 +- plugins/nginx-vhosts/backup-import | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nginx-vhosts/backup-export b/plugins/nginx-vhosts/backup-export index 465d0d18e..6b3c27930 100755 --- a/plugins/nginx-vhosts/backup-export +++ b/plugins/nginx-vhosts/backup-export @@ -4,4 +4,4 @@ shopt -s nullglob VERSION="$1" BASE_DIR="$2" -cat; for i in $BASE_DIR/*/ssl/server.*; do echo $i; done +cat; for i in $BASE_DIR/*/tls/server.*; do echo $i; done diff --git a/plugins/nginx-vhosts/backup-import b/plugins/nginx-vhosts/backup-import index 6b88fe0b4..0d7219fd1 100755 --- a/plugins/nginx-vhosts/backup-import +++ b/plugins/nginx-vhosts/backup-import @@ -7,7 +7,7 @@ TARGET_DIR="$3" cd $IMPORT_DIR -for file in */ssl/server.*; do +for file in */tls/server.*; do mkdir -p $(dirname $TARGET_DIR$file) cp $file $TARGET_DIR$file done From e771b94b3bf1072469b27c6b433979f0533b6968 Mon Sep 17 00:00:00 2001 From: Vladislav Supalov Date: Wed, 12 Nov 2014 11:00:34 +0100 Subject: [PATCH 33/61] Remove unintended phrase repetition in installation.md. --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 5855e7275..f934b5c5a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -71,7 +71,7 @@ sudo DOKKU_REPO=https://github.com/yourusername/dokku.git ./bootstrap.sh ### Custom buildstep build -Dokku ships with a pre-built version of version of the [buildstep](https://github.com/progrium/buildstep) component by +Dokku ships with a pre-built version of the [buildstep](https://github.com/progrium/buildstep) component by default. If you want to build your own version you can specify that with an env variable. From 179305eea15eecb2b342c32ad468f765c38c4098 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2014 15:36:02 -0500 Subject: [PATCH 34/61] Release 0.3.0 --- README.md | 2 +- docs/installation.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 761753aa6..70e5e4556 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S To install the latest stable version of dokku, you can run the following bootstrapper command: - $ wget -qO- https://raw.github.com/progrium/dokku/v0.2.3/bootstrap.sh | sudo DOKKU_TAG=v0.2.3 bash + $ wget -qO- https://raw.github.com/progrium/dokku/v0.3.0/bootstrap.sh | sudo DOKKU_TAG=v0.3.0 bash ## Documentation diff --git a/docs/installation.md b/docs/installation.md index 2d3cf04d4..36eea7cd2 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -13,7 +13,7 @@ Ubuntu 14.04 x64 or 12.04 x64. Ideally have a domain ready to point to your host To install the latest stable version of dokku, you can run the following bootstrapper command: ```bash -wget -qO- https://raw.github.com/progrium/dokku/v0.2.3/bootstrap.sh | sudo DOKKU_TAG=v0.2.3 bash +wget -qO- https://raw.github.com/progrium/dokku/v0.3.0/bootstrap.sh | sudo DOKKU_TAG=v0.3.0 bash ``` ## Configuring From 592c95eaeb928a6a775858ccc61b2533bc4d829b Mon Sep 17 00:00:00 2001 From: Erik Nomitch Date: Mon, 12 May 2014 13:29:42 -0700 Subject: [PATCH 35/61] Use command instead of which for apt-get existential check in bootstrap.sh --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 9b02aaff9..0f2297729 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -3,7 +3,7 @@ set -eo pipefail export DEBIAN_FRONTEND=noninteractive export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"} -if ! which apt-get &>/dev/null +if ! command -v apt-get &>/dev/null then echo "This installation script requires apt-get. For manual installation instructions, consult https://github.com/progrium/dokku ." exit 1 From ad516d6bf5c2dace08af54143105f746d1251ed3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2014 16:57:59 -0500 Subject: [PATCH 36/61] Remove all references to Ubuntu 12.04. Refs #238 We no longer test against 12.04 VMs --- README.md | 2 +- docs/installation.md | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 70e5e4556..f6b60d867 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S ## Requirements -- A fresh VM running either Ubuntu `14.04 x64` or `12.04 x64` +- A fresh VM running Ubuntu `14.04 x64` ## Installing diff --git a/docs/installation.md b/docs/installation.md index 36eea7cd2..86a08b334 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,11 +2,9 @@ ## Requirements -- A fresh VM running either Ubuntu `14.04 x64` or `12.04 x64` +- A fresh VM running Ubuntu `14.04 x64` -Ubuntu 14.04 x64 or 12.04 x64. Ideally have a domain ready to point to your host. It's designed for and is probably best to use a fresh VM. The bootstrapper will install everything it needs. - -**Note: Support for 12.04 will be sunsetting in the near future after dokku & 14.04 have been more thoroughly tested.** +Ubuntu 14.04 x64 x64. Ideally have a domain ready to point to your host. It's designed for and is probably best to use a fresh VM. The bootstrapper will install everything it needs. ## Installing the latest Stable version From a2d1d8c0653b60d9bbe2cadecb93197b19b3051d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2014 20:09:57 -0500 Subject: [PATCH 37/61] Setup dokku-installer within Vagrant VM on first provision --- Makefile | 12 +++++++++++- Vagrantfile | 1 + docs/installation.md | 6 +----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e29bde09a..1c92e6747 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS))) $(eval $(RUN_ARGS):;@:) endif -.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count vagrant-acl-add vagrant-dokku +.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku all: # Type "make install" to install. @@ -84,6 +84,16 @@ count: @echo "Test lines:" @find tests -type f | xargs cat | wc -l +dokku-installer: + 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 /root/dokku/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 + vagrant-acl-add: vagrant ssh -- sudo sshcommand acl-add dokku $(USER) diff --git a/Vagrantfile b/Vagrantfile index 8f4d8e700..b47fde806 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -30,4 +30,5 @@ Vagrant::configure("2") do |config| end config.vm.provision :shell, :inline => "apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}" + config.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer" end diff --git a/docs/installation.md b/docs/installation.md index 86a08b334..86f2732d4 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -113,11 +113,7 @@ sudo BUILD_STACK=true make install vagrant up ``` -- Add SSH key to Dokku using `sshcommand`: - - ```bash - cat ~/.ssh/id_rsa.pub | make vagrant-acl-add - ``` +- Copy your SSH key via `cat ~/.ssh/id_rsa.pub | pbcopy` and paste it into the dokku-installer at http://dokku.me . Change the `Hostname` field on the Dokku Setup screen to your domain and then check the box that says `Use virtualhost naming`. Then click *Finish Setup* to install your key. You'll be directed to application deployment instructions from here. You are now ready to deploy an app or install plugins. From 5dbc864060e24f5adf47bfd16ef0d337ca633971 Mon Sep 17 00:00:00 2001 From: Ludovic Perrine Date: Thu, 2 Oct 2014 11:37:47 +0200 Subject: [PATCH 38/61] Handle config values with spaces --- plugins/config/commands | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/plugins/config/commands b/plugins/config/commands index 3a3273e41..cc1b948c1 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -25,19 +25,19 @@ if [[ $1 == config ]] || [[ $1 == config:* ]]; then fi config_styled_hash () { - vars=`echo -e "$1"` + vars="$1" longest="" - for word in $vars; do + while read -r word; do KEY=`echo $word | cut -d"=" -f1` if [ ${#KEY} -gt ${#longest} ]; then longest=$KEY fi - done + done <<< "$vars" - for word in $vars; do + while read -r word; do KEY=`echo $word | cut -d"=" -f1` - VALUE=`echo $word | cut -d"=" -f2-` + VALUE=`echo $word | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"` num_zeros=$((${#longest} - ${#KEY})) zeros=" " @@ -46,7 +46,7 @@ config_styled_hash () { num_zeros=$(($num_zeros - 1)) done echo "$KEY:$zeros$VALUE" - done + done <<< "$vars" } config_restart_app() { @@ -80,7 +80,7 @@ case "$1" in exit 1 fi - VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2` + VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2-` for var in "$@"; do if [[ "$var" == "--shell" ]]; then @@ -106,7 +106,7 @@ case "$1" in KEY="$3" - cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2 | grep "^$KEY=" | cut -d"=" -f2- + cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//" ;; config:set) @@ -120,9 +120,9 @@ case "$1" in ENV_ADD="" ENV_TEMP=`cat "${ENV_FILE}"` RESTART_APP=false - VARS="${*:3}" + shift 2 - for var in $VARS; do + for var; do if [[ $var != *"="* ]]; then echo "Usage: dokku config:set APP KEY1=VALUE1 [KEY2=VALUE2 ...]" echo "Must specify KEY and VALUE to set." @@ -130,18 +130,20 @@ case "$1" in fi done - for var in $VARS; do + for var; do KEY=`echo ${var} | cut -d"=" -f1` VALUE=`echo ${var} | cut -d"=" -f2-` if [[ $KEY =~ [a-zA-Z_][a-zA-Z0-9_]* ]]; then RESTART_APP=true ENV_TEMP=$(echo -e "${ENV_TEMP}" | sed "/^export $KEY=/ d") - ENV_TEMP="${ENV_TEMP}\nexport ${var}" + ENV_TEMP="${ENV_TEMP}\nexport $KEY='$VALUE'" ENV_ADD=$(echo -e "${ENV_ADD}" | sed "/^$KEY=/ d") - ENV_ADD="${ENV_ADD}\n${var}" + ENV_ADD="${ENV_ADD}$ +${var}" fi done + ENV_ADD=$(echo "$ENV_ADD" | tail -n +2) #remove first empty line if [ $RESTART_APP ]; then echo "-----> Setting config vars and restarting $APP" From 361011ec69389f686ace70ac55eb2281dffc06b4 Mon Sep 17 00:00:00 2001 From: Ludovic Perrine Date: Thu, 2 Oct 2014 12:27:12 +0200 Subject: [PATCH 39/61] Added test for config with spaces --- tests/apps/config/check_deploy | 14 +++++++++++++- tests/apps/config/post-deploy | 2 +- tests/apps/config/web.js | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/apps/config/check_deploy b/tests/apps/config/check_deploy index 4047ea6b8..57e2a697a 100755 --- a/tests/apps/config/check_deploy +++ b/tests/apps/config/check_deploy @@ -1,3 +1,15 @@ #!/bin/bash -set -e; output="$(curl -s $1)"; echo $output; test "$output" == "config-test" +set -e; +base_url="$1" +test_url / "config-test" +test_url /hello "Hello world" + +test_url () { + path="$1" + expected_output="$2" + url="$base_url$path" + output="$(curl -s $url)" + echo $output + test "$output" == "$expected_output" +} \ No newline at end of file diff --git a/tests/apps/config/post-deploy b/tests/apps/config/post-deploy index d0080c7a9..eed12fabf 100755 --- a/tests/apps/config/post-deploy +++ b/tests/apps/config/post-deploy @@ -4,5 +4,5 @@ set -ex; REMOTE=$1 REPO=$2 -ssh $REMOTE config:set $REPO CONFTEST=config-test +ssh $REMOTE config:set $REPO CONFTEST=config-test HELLO="Hello world" diff --git a/tests/apps/config/web.js b/tests/apps/config/web.js index 3b5050b1f..774ece28b 100644 --- a/tests/apps/config/web.js +++ b/tests/apps/config/web.js @@ -6,6 +6,10 @@ app.get('/', function(request, response) { response.send(process.env.CONFTEST); }); +app.get('/hello', function(request, response) { + response.send(process.env.HELLO); +}); + var port = process.env.PORT || 5000; app.listen(port, function() { console.log("Listening on " + port); From 043a1a01c51f8bd2f1a85f783fab0d19785c09e3 Mon Sep 17 00:00:00 2001 From: Ludovic Perrine Date: Thu, 2 Oct 2014 15:40:21 +0200 Subject: [PATCH 40/61] Fixed setting config values with spaces over SSH --- dokku | 6 ++++++ tests/apps/config/post-deploy | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dokku b/dokku index 46dedd131..43ab697b3 100755 --- a/dokku +++ b/dokku @@ -12,6 +12,12 @@ if [[ $(id -un) != "dokku" && $1 != plugins-install* ]]; then exit fi +if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then + export -n SSH_ORIGINAL_COMMAND + $0 $SSH_ORIGINAL_COMMAND + exit $? +fi + case "$1" in receive) APP="$2"; IMAGE="dokku/$APP" diff --git a/tests/apps/config/post-deploy b/tests/apps/config/post-deploy index eed12fabf..440051a2c 100755 --- a/tests/apps/config/post-deploy +++ b/tests/apps/config/post-deploy @@ -4,5 +4,5 @@ set -ex; REMOTE=$1 REPO=$2 -ssh $REMOTE config:set $REPO CONFTEST=config-test HELLO="Hello world" +ssh $REMOTE config:set $REPO CONFTEST=config-test HELLO=\"Hello world\" From 0f31ff1f249ccf49d5c063997d501115c4c2d41d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2014 22:11:55 -0500 Subject: [PATCH 41/61] Add a set of spaces to prefix config variables when setting them --- plugins/config/commands | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/config/commands b/plugins/config/commands index cc1b948c1..6da21d4a5 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -26,6 +26,7 @@ fi config_styled_hash () { vars="$1" + prefix="$2" longest="" while read -r word; do @@ -45,7 +46,7 @@ config_styled_hash () { zeros="$zeros " num_zeros=$(($num_zeros - 1)) done - echo "$KEY:$zeros$VALUE" + echo "$prefix$KEY:$zeros$VALUE" done <<< "$vars" } @@ -147,7 +148,7 @@ ${var}" if [ $RESTART_APP ]; then echo "-----> Setting config vars and restarting $APP" - config_styled_hash "$ENV_ADD" + config_styled_hash "$ENV_ADD" " " config_write "$ENV_TEMP" fi From af0005196a8c5de5f852c30b5fe64c0333d535ab Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2014 23:32:30 -0500 Subject: [PATCH 42/61] Standardize the way in which we set variables --- plugins/00_dokku-standard/pre-delete | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/00_dokku-standard/pre-delete b/plugins/00_dokku-standard/pre-delete index 5a14726e3..ff0b4c680 100755 --- a/plugins/00_dokku-standard/pre-delete +++ b/plugins/00_dokku-standard/pre-delete @@ -1,9 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -APP="$1" -IMAGE=dokku/"$1" -CACHE_DIR="$DOKKU_ROOT/$APP/cache" +APP="$1"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache" docker run -v $CACHE_DIR:/cache $IMAGE find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; From 96b348e88073c24a79c3c375591a6b6ca1354dd3 Mon Sep 17 00:00:00 2001 From: Mark Stosberg Date: Wed, 25 Jun 2014 18:11:49 -0400 Subject: [PATCH 43/61] Document what bootstrap.sh is doing. --- bootstrap.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 0f2297729..3950ef3fc 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash +# A script to bootstrap dokku. +# It expects to be run on Ubuntu 14.04 via 'sudo' +# It checks out the dokku source code from Github into ~/dokku and then runs 'make install' from dokku source. + set -eo pipefail export DEBIAN_FRONTEND=noninteractive export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"} From 913af9b64143eec0553487f79742bf1fb0b89d56 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 00:26:12 -0500 Subject: [PATCH 44/61] Make ENV file readable only from dokku user. Closes #621 --- plugins/config/commands | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/config/commands b/plugins/config/commands index 6da21d4a5..0524877f5 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -66,6 +66,7 @@ config_write() { echo -e "$ENV_TEMP" | sed '/^$/d' | sort > $ENV_FILE_TEMP if ! cmp -s $ENV_FILE $ENV_FILE_TEMP; then cp -f $ENV_FILE_TEMP $ENV_FILE + chmod 600 $ENV_FILE config_restart_app $APP fi rm -f $ENV_FILE_TEMP From 4b9433052f760c138ca49d7feabdecebe6009d15 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 02:30:39 -0500 Subject: [PATCH 45/61] Create an `apps` core plugin. This creates the following commands: - apps - apps:create - apps:destroy It also: - makes `delete` an alias for `apps:destroy` - adds confirmation to `apps:destroy` - allows a developer to remove apps that have been created via apps:create but have not been deployed Refs #87 Refs #543 Refs #586 Closes #599 Refs #655 Refs #656 Refs #685 Closes #757 --- plugins/00_dokku-standard/commands | 24 +------ plugins/00_dokku-standard/pre-delete | 8 --- plugins/apps/commands | 71 +++++++++++++++++++ .../{00_dokku-standard => apps}/post-delete | 1 + plugins/apps/pre-delete | 7 ++ plugins/config/commands | 14 ++-- 6 files changed, 89 insertions(+), 36 deletions(-) delete mode 100755 plugins/00_dokku-standard/pre-delete create mode 100755 plugins/apps/commands rename plugins/{00_dokku-standard => apps}/post-delete (99%) create mode 100755 plugins/apps/pre-delete diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index 1d981fc2e..325beb1dc 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -1,28 +1,9 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + case "$1" in delete) - if [[ -z $2 ]]; then - echo "Please specify an app to delete" - exit 1 - fi - APP="$2"; IMAGE="dokku/$APP"; - if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then - echo "App does not exist" - exit 1 - fi - - pluginhook pre-delete $APP - if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then - ID=$(< "$DOKKU_ROOT/$APP/CONTAINER") - - docker stop $ID > /dev/null || true - docker rm $ID > /dev/null || true - fi - - docker images | grep $IMAGE | awk '{print $3}' | xargs docker rmi &> /dev/null & - - pluginhook post-delete $APP + dokku apps:destroy $2 ;; logs) @@ -85,7 +66,6 @@ case "$1" in help) cat && cat< Delete an application logs [-t] Show the last logs for an application (-t follows) run Run a command in the environment of an application url Show the URL for an application diff --git a/plugins/00_dokku-standard/pre-delete b/plugins/00_dokku-standard/pre-delete deleted file mode 100755 index ff0b4c680..000000000 --- a/plugins/00_dokku-standard/pre-delete +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x - -APP="$1"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache" - -docker run -v $CACHE_DIR:/cache $IMAGE find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; - - diff --git a/plugins/apps/commands b/plugins/apps/commands new file mode 100755 index 000000000..c98546ab5 --- /dev/null +++ b/plugins/apps/commands @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +case "$1" in + apps) + echo "=== My Apps" + find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 + ;; + + apps:create) + if [[ -z $2 ]]; then + echo "Please specify an app to create" + exit 1 + fi + APP="$2" + if [[ -d "$DOKKU_ROOT/$APP" ]]; then + echo " ! Name is already taken" + exit 1 + fi + + mkdir -p "$DOKKU_ROOT/$APP" + echo "Creating $APP... done" + ;; + + apps:destroy) + if [[ -z $2 ]]; then + echo "Please specify an app to delete" + exit 1 + fi + APP="$2"; IMAGE="dokku/$APP"; + if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then + echo "App $APP does not exist" + exit 1 + fi + + echo " ! WARNING: Potentially Destructive Action" + echo " ! This command will destroy $APP (including all add-ons)." + echo " ! To proceed, type \"$APP\"" + echo "" + + read -p "> " app_name + if [[ "$app_name" != "$APP" ]]; then + echo " ! Confirmation did not match $APP. Aborted." + exit 1 + fi + + echo "Destroying $APP (including all add-ons)" + + pluginhook pre-delete $APP + if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then + ID=$(< "$DOKKU_ROOT/$APP/CONTAINER") + + docker stop $ID > /dev/null || true + docker rm $ID > /dev/null || true + fi + + docker images | grep $IMAGE | awk '{print $3}' | xargs docker rmi &> /dev/null & + + pluginhook post-delete $APP + ;; + + help) + cat && cat< Create a new app + apps:destroy Permanently destroy an app +EOF + ;; + +esac + diff --git a/plugins/00_dokku-standard/post-delete b/plugins/apps/post-delete similarity index 99% rename from plugins/00_dokku-standard/post-delete rename to plugins/apps/post-delete index 6b6829284..b164bb44b 100755 --- a/plugins/00_dokku-standard/post-delete +++ b/plugins/apps/post-delete @@ -1,3 +1,4 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + [[ -n $1 ]] && rm -r "$DOKKU_ROOT/$1" > /dev/null diff --git a/plugins/apps/pre-delete b/plugins/apps/pre-delete new file mode 100755 index 000000000..fa031488d --- /dev/null +++ b/plugins/apps/pre-delete @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +APP="$1"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache" +if [[ -d $CACHE_DIR ]]; then + docker run -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; +fi diff --git a/plugins/config/commands b/plugins/config/commands index 6da21d4a5..376c352ea 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -53,12 +53,14 @@ config_styled_hash () { config_restart_app() { APP="$1"; - echo "-----> Releasing $APP ..." - dokku release $APP - echo "-----> Release complete!" - echo "-----> Deploying $APP ..." - dokku deploy $APP - echo "-----> Deploy complete!" + if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then + echo "-----> Releasing $APP ..." + dokku release $APP + echo "-----> Release complete!" + echo "-----> Deploying $APP ..." + dokku deploy $APP + echo "-----> Deploy complete!" + fi } config_write() { From f13c1031c775f418aed8eba5d38ce4df21e29d62 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 02:54:54 -0500 Subject: [PATCH 46/61] Ensure there is a newline after calling `set -e` --- plugins/00_dokku-standard/backup-check | 1 + plugins/00_dokku-standard/backup-export | 1 + plugins/00_dokku-standard/backup-import | 1 + plugins/backup/commands | 1 + plugins/checks/check-deploy | 1 + plugins/config/backup-export | 1 + plugins/config/backup-import | 1 + plugins/git/backup-import | 2 ++ plugins/git/commands | 1 + plugins/nginx-vhosts/backup-export | 1 + plugins/nginx-vhosts/backup-import | 1 + plugins/nginx-vhosts/post-delete | 1 + plugins/nginx-vhosts/post-deploy | 1 + 13 files changed, 14 insertions(+) diff --git a/plugins/00_dokku-standard/backup-check b/plugins/00_dokku-standard/backup-check index 91e7bfb51..b80e108f1 100755 --- a/plugins/00_dokku-standard/backup-check +++ b/plugins/00_dokku-standard/backup-check @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + VERSION="$1" IMPORT_DIR="$2" TARGET_DIR="$3" diff --git a/plugins/00_dokku-standard/backup-export b/plugins/00_dokku-standard/backup-export index 651d0b3db..8a1fcf24c 100755 --- a/plugins/00_dokku-standard/backup-export +++ b/plugins/00_dokku-standard/backup-export @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + VERSION="$1" BASE_DIR="$2" diff --git a/plugins/00_dokku-standard/backup-import b/plugins/00_dokku-standard/backup-import index 86404a99b..23af3913b 100755 --- a/plugins/00_dokku-standard/backup-import +++ b/plugins/00_dokku-standard/backup-import @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + VERSION="$1" IMPORT_DIR="$2" TARGET_DIR="$3" diff --git a/plugins/backup/commands b/plugins/backup/commands index 9aa6cdc65..0571ed867 100755 --- a/plugins/backup/commands +++ b/plugins/backup/commands @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + CURRENT_BACKUP_VERSION=1 set -e; case "$1" in backup:export) diff --git a/plugins/checks/check-deploy b/plugins/checks/check-deploy index 6db3f6444..e69182990 100755 --- a/plugins/checks/check-deploy +++ b/plugins/checks/check-deploy @@ -14,6 +14,7 @@ # in seconds). set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + CONTAINERID="$1"; APP="$2"; PORT="$3" ; HOSTNAME="${4:-localhost}" # source in app env to get DOKKU_CHECKS_WAIT and any other necessary vars diff --git a/plugins/config/backup-export b/plugins/config/backup-export index 68b5c0393..bc709ce83 100755 --- a/plugins/config/backup-export +++ b/plugins/config/backup-export @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + shopt -s nullglob VERSION="$1" BASE_DIR="$2" diff --git a/plugins/config/backup-import b/plugins/config/backup-import index 9ed3b1eca..22c1d9324 100755 --- a/plugins/config/backup-import +++ b/plugins/config/backup-import @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + shopt -s nullglob VERSION="$1" IMPORT_DIR="$2" diff --git a/plugins/git/backup-import b/plugins/git/backup-import index 6d4a30a10..81c169a9d 100755 --- a/plugins/git/backup-import +++ b/plugins/git/backup-import @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + VERSION="$1" IMPORT_DIR="$2" TARGET_DIR="$3" @@ -12,6 +13,7 @@ while read APP; do cat > $PRERECEIVE_HOOK < $PRERECEIVE_HOOK < /dev/null diff --git a/plugins/nginx-vhosts/post-deploy b/plugins/nginx-vhosts/post-deploy index 1e0b1e7fe..b0d06e8cb 100755 --- a/plugins/nginx-vhosts/post-deploy +++ b/plugins/nginx-vhosts/post-deploy @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + APP="$1"; PORT="$2" WILDCARD_SSL="$DOKKU_ROOT/tls" SSL="$DOKKU_ROOT/$APP/tls" From 7b361e564feea722dc21dcc05ac26bd0a8a97168 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 02:58:52 -0500 Subject: [PATCH 47/61] Use 2 spaces for formatting bash Also remove extra trailing newlines --- plugins/00_dokku-standard/backup-check | 1 - plugins/00_dokku-standard/backup-import | 8 +++--- plugins/00_dokku-standard/commands | 13 ++++----- plugins/00_dokku-standard/install | 2 +- plugins/apps/commands | 1 - plugins/backup/commands | 16 +++++------ plugins/checks/check-deploy | 32 ++++++++++----------- plugins/config/backup-import | 2 +- plugins/config/commands | 2 -- plugins/git/backup-import | 12 ++++---- plugins/git/commands | 37 ++++++++++++------------- plugins/nginx-vhosts/backup-import | 4 +-- 12 files changed, 62 insertions(+), 68 deletions(-) diff --git a/plugins/00_dokku-standard/backup-check b/plugins/00_dokku-standard/backup-check index b80e108f1..aae373832 100755 --- a/plugins/00_dokku-standard/backup-check +++ b/plugins/00_dokku-standard/backup-check @@ -16,4 +16,3 @@ for app in $APPS; do done exit $ret - diff --git a/plugins/00_dokku-standard/backup-import b/plugins/00_dokku-standard/backup-import index 23af3913b..eca5228b3 100755 --- a/plugins/00_dokku-standard/backup-import +++ b/plugins/00_dokku-standard/backup-import @@ -7,10 +7,10 @@ TARGET_DIR="$3" [[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then - mkdir -p $TARGET_DIR/.ssh - cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > $TARGET_DIR/.ssh/authorized_keys - chmod 0700 $TARGET_DIR/.ssh - chmod 0600 $TARGET_DIR/.ssh/* + mkdir -p $TARGET_DIR/.ssh + cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > $TARGET_DIR/.ssh/authorized_keys + chmod 0700 $TARGET_DIR/.ssh + chmod 0600 $TARGET_DIR/.ssh/* fi [[ -f $IMPORT_DIR/HOSTNAME ]] && mv $IMPORT_DIR/HOSTNAME $TARGET_DIR/HOSTNAME [[ -f $IMPORT_DIR/VHOST ]] && mv $IMPORT_DIR/VHOST $TARGET_DIR/VHOST diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index 325beb1dc..8e4c36cb9 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -31,13 +31,13 @@ case "$1" in run) if [[ -z $2 ]]; then - echo "Please specify an app to run the command on" - exit 1 + echo "Please specify an app to run the command on" + exit 1 fi APP="$2"; IMAGE="dokku/$APP" if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then - echo "App $APP does not exist" - exit 1 + echo "App $APP does not exist" + exit 1 fi shift 2 @@ -48,8 +48,8 @@ case "$1" in url) APP="$2"; if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then - echo "App $APP does not exist" - exit 1 + echo "App $APP does not exist" + exit 1 fi if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then @@ -74,4 +74,3 @@ EOF ;; esac - diff --git a/plugins/00_dokku-standard/install b/plugins/00_dokku-standard/install index bc804f546..9625e8fdc 100755 --- a/plugins/00_dokku-standard/install +++ b/plugins/00_dokku-standard/install @@ -2,7 +2,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then - echo $(hostname -f) > $DOKKU_ROOT/HOSTNAME + echo $(hostname -f) > $DOKKU_ROOT/HOSTNAME fi # temporary hack for https://github.com/progrium/dokku/issues/82 diff --git a/plugins/apps/commands b/plugins/apps/commands index c98546ab5..770f772f4 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -68,4 +68,3 @@ EOF ;; esac - diff --git a/plugins/backup/commands b/plugins/backup/commands index 0571ed867..4c41037fc 100755 --- a/plugins/backup/commands +++ b/plugins/backup/commands @@ -2,7 +2,8 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x CURRENT_BACKUP_VERSION=1 -set -e; case "$1" in + +case "$1" in backup:export) OUTPUT_FILE="$2" BACKUP_DIR="$DOKKU_ROOT" @@ -25,9 +26,9 @@ set -e; case "$1" in # if no file specified, output to stdout if [[ -z $OUTPUT_FILE ]]; then - cat $BACKUP_TMP_FILE + cat $BACKUP_TMP_FILE else - mv $BACKUP_TMP_FILE $OUTPUT_FILE + mv $BACKUP_TMP_FILE $OUTPUT_FILE fi rm -rf $BACKUP_TMP_DIR @@ -49,14 +50,14 @@ set -e; case "$1" in tar xf $INPUT_FILE --directory=$BACKUP_TMP_DIR if [[ ! -f $BACKUP_TMP_DIR/.dokku_backup_version ]]; then - echo "Unable to determine backup version" - exit 1 + echo "Unable to determine backup version" + exit 1 fi VERSION=$(< $BACKUP_TMP_DIR/.dokku_backup_version) if [[ $VERSION -ne 1 ]]; then - echo "Unknown format version $VERSION" - exit 1 + echo "Unknown format version $VERSION" + exit 1 fi echo "Importing a version $VERSION backup..." @@ -92,4 +93,3 @@ EOF ;; esac - diff --git a/plugins/checks/check-deploy b/plugins/checks/check-deploy index e69182990..00346af5b 100755 --- a/plugins/checks/check-deploy +++ b/plugins/checks/check-deploy @@ -28,23 +28,23 @@ WAIT="${DOKKU_CHECKS_WAIT:-5}" # after successfully copying the file. Thus, we suppress stderr. # ref: https://github.com/dotcloud/docker/issues/3986 if [[ ! -f "$FILENAME" ]] ; then - echo " check-deploy: $FILENAME not found. attempting to retrieve it from container ..." - TMPDIR=$(mktemp -d /tmp/CHECKS.XXXXX) - docker cp $CONTAINERID:/app/CHECKS $TMPDIR 2> /dev/null || true - if [[ ! -s "${TMPDIR}/CHECKS" ]] ; then - echo " CHECKS file not found in container. skipping checks." - rm -rf $TMPDIR - exit 0 - else - echo " CHECKS file found in container" - FILENAME=${TMPDIR}/CHECKS + echo " check-deploy: $FILENAME not found. attempting to retrieve it from container ..." + TMPDIR=$(mktemp -d /tmp/CHECKS.XXXXX) + docker cp $CONTAINERID:/app/CHECKS $TMPDIR 2> /dev/null || true + if [[ ! -s "${TMPDIR}/CHECKS" ]] ; then + echo " CHECKS file not found in container. skipping checks." + rm -rf $TMPDIR + exit 0 + else + echo " CHECKS file found in container" + FILENAME=${TMPDIR}/CHECKS - function cleanup() { - echo " removing CHECKS file copied from container" - rm -rf $TMPDIR - } - trap cleanup EXIT - fi + function cleanup() { + echo " removing CHECKS file copied from container" + rm -rf $TMPDIR + } + trap cleanup EXIT + fi fi echo "Waiting $WAIT seconds ..." diff --git a/plugins/config/backup-import b/plugins/config/backup-import index 22c1d9324..7652df515 100755 --- a/plugins/config/backup-import +++ b/plugins/config/backup-import @@ -8,5 +8,5 @@ TARGET_DIR="$3" cd $IMPORT_DIR for file in */ENV; do - cp $file "$TARGET_DIR/$file" + cp $file "$TARGET_DIR/$file" done diff --git a/plugins/config/commands b/plugins/config/commands index 441e5fec5..724fb58c9 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -75,7 +75,6 @@ config_write() { } case "$1" in - config) APP="$2" @@ -186,4 +185,3 @@ EOF ;; esac - diff --git a/plugins/git/backup-import b/plugins/git/backup-import index 81c169a9d..8d40fd316 100755 --- a/plugins/git/backup-import +++ b/plugins/git/backup-import @@ -6,15 +6,15 @@ IMPORT_DIR="$2" TARGET_DIR="$3" APPS="$4" -while read APP; do - APP_PATH="$TARGET_DIR/$APP"; - git init --bare $APP_PATH > /dev/null - PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive" - cat > $PRERECEIVE_HOOK < /dev/null + PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive" + cat > $PRERECEIVE_HOOK < /dev/null diff --git a/plugins/git/commands b/plugins/git/commands index 224fcbede..0b90005e5 100755 --- a/plugins/git/commands +++ b/plugins/git/commands @@ -2,19 +2,19 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x git_archive_all() { - APP=$1; REV=$2 - TMP_WORK_DIR=$(mktemp -d) - chmod 755 $TMP_WORK_DIR - unset GIT_DIR GIT_WORK_TREE - git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null - pushd $TMP_WORK_DIR > /dev/null - git config advice.detachedHead false - git checkout $REV &> /dev/null - git submodule update --init --recursive &> /dev/null - find -name .git -prune -exec rm -rf {} \; > /dev/null - tar c . - popd > /dev/null - rm -rf $TMP_WORK_DIR > /dev/null + APP=$1; REV=$2 + TMP_WORK_DIR=$(mktemp -d) + chmod 755 $TMP_WORK_DIR + unset GIT_DIR GIT_WORK_TREE + git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null + pushd $TMP_WORK_DIR > /dev/null + git config advice.detachedHead false + git checkout $REV &> /dev/null + git submodule update --init --recursive &> /dev/null + find -name .git -prune -exec rm -rf {} \; > /dev/null + tar c . + popd > /dev/null + rm -rf $TMP_WORK_DIR > /dev/null } case "$1" in @@ -31,7 +31,6 @@ case "$1" in echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master." echo $'\e[1G\e[K'"-----> for example, try 'git push ${refname/refs\/heads\/}:master'" fi - done ;; @@ -40,15 +39,15 @@ case "$1" in APP_PATH=$DOKKU_ROOT/$APP if [[ $1 == "git-receive-pack" && ! -d "$APP_PATH/refs" ]]; then - git init --bare $APP_PATH > /dev/null - PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive" - cat > $PRERECEIVE_HOOK < /dev/null + PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive" + cat > $PRERECEIVE_HOOK < Date: Sun, 16 Nov 2014 02:59:07 -0500 Subject: [PATCH 48/61] Add `set -eo` statement to nginx-vhosts/dependencies --- plugins/nginx-vhosts/dependencies | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/nginx-vhosts/dependencies b/plugins/nginx-vhosts/dependencies index 8166474a1..04914f084 100755 --- a/plugins/nginx-vhosts/dependencies +++ b/plugins/nginx-vhosts/dependencies @@ -1,4 +1,5 @@ #!/bin/bash +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 From 0f6ca81afdbe04783b169e752bff2a9101a152ae Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 02:59:28 -0500 Subject: [PATCH 49/61] Update dokku-installer version to v0.3.0 --- contrib/dokku-installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/dokku-installer.rb b/contrib/dokku-installer.rb index ef06f64d5..89ffbdc43 100755 --- a/contrib/dokku-installer.rb +++ b/contrib/dokku-installer.rb @@ -21,11 +21,11 @@ if ARGV[0] == "onboot" exit end -version = "v0.2.1" dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku" admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip template = DATA.read +version = "v0.3.0" set :port, 2000 set :environment, :production From 52774536ca50626fe269c3ba02dab3657f97564e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 02:59:42 -0500 Subject: [PATCH 50/61] Standardize installer on 2 spaces --- contrib/dokku-installer.rb | 192 ++++++++++++++++++------------------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/contrib/dokku-installer.rb b/contrib/dokku-installer.rb index 89ffbdc43..938ca8544 100755 --- a/contrib/dokku-installer.rb +++ b/contrib/dokku-installer.rb @@ -3,120 +3,120 @@ require "sinatra" require "open3" if ARGV[0] == "onboot" - File.open("/etc/init/dokku-installer.conf", "w") do |f| - f.puts "start on runlevel [2345]" - f.puts "exec #{File.absolute_path(__FILE__)} selfdestruct" - end - File.open("/etc/nginx/conf.d/dokku-installer.conf", "w") do |f| - f.puts "upstream dokku-installer { server 127.0.0.1:2000; }" - f.puts "server {" - f.puts " listen 80;" - f.puts " location / {" - f.puts " proxy_pass http://dokku-installer;" - f.puts " }" - f.puts "}" - end - `rm /etc/nginx/sites-enabled/*` - puts "Installed Upstart service and default Nginx virtualhost for installer to run on boot." - exit + File.open("/etc/init/dokku-installer.conf", "w") do |f| + f.puts "start on runlevel [2345]" + f.puts "exec #{File.absolute_path(__FILE__)} selfdestruct" + end + File.open("/etc/nginx/conf.d/dokku-installer.conf", "w") do |f| + f.puts "upstream dokku-installer { server 127.0.0.1:2000; }" + f.puts "server {" + f.puts " listen 80;" + f.puts " location / {" + f.puts " proxy_pass http://dokku-installer;" + f.puts " }" + f.puts "}" + end + `rm /etc/nginx/sites-enabled/*` + puts "Installed Upstart service and default Nginx virtualhost for installer to run on boot." + exit end -dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku" -admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first -hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip -template = DATA.read version = "v0.3.0" +dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku" +admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first +hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip +template = DATA.read set :port, 2000 set :environment, :production disable :protection get "/" do - ERB.new(template).result binding + ERB.new(template).result binding end post "/setup" do - if params[:vhost] == "true" - File.open("#{dokku_root}/VHOST", "w") {|f| f.write params[:hostname] } - else - `rm #{dokku_root}/VHOST` - end - File.open("#{dokku_root}/HOSTNAME", "w") {|f| f.write params[:hostname] } - Open3.capture2("sshcommand acl-add dokku admin", :stdin_data => params[:key]) - Thread.new { - `rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start` - `rm /etc/init/dokku-installer.conf && stop dokku-installer` - }.run if ARGV[0] == "selfdestruct" + if params[:vhost] == "true" + File.open("#{dokku_root}/VHOST", "w") {|f| f.write params[:hostname] } + else + `rm #{dokku_root}/VHOST` + end + File.open("#{dokku_root}/HOSTNAME", "w") {|f| f.write params[:hostname] } + Open3.capture2("sshcommand acl-add dokku admin", :stdin_data => params[:key]) + Thread.new { + `rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start` + `rm /etc/init/dokku-installer.conf && stop dokku-installer` + }.run if ARGV[0] == "selfdestruct" end __END__ - Dokku Setup - - + Dokku Setup + + -
-
-

Dokku Setup <%= version %>

-
-

Admin Access

-
- -
-
-

Hostname Configuration

-
- - -
-
- -
-

Your app URLs will look like:

-
http://hostname:port
-
- -
-
-
- +
+
+

Dokku Setup <%= version %>

+
+

Admin Access

+
+ +
+
+

Hostname Configuration

+
+ + +
+
+ +
+

Your app URLs will look like:

+
http://hostname:port
+
+ +
+
+
+ From aefa11db8bddcec65035f2e0cf192251ddc6491a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 03:00:32 -0500 Subject: [PATCH 51/61] Add editorconfig to dokku This should help dokku contributors force proper formatting on their contributions --- .editorconfig | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..c80200c1d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*] +insert_final_newline = true +indent_style = space +indent_size = 2 From 7d9aa7c4928b013d13460ad40e1c36627d290f00 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 03:04:26 -0500 Subject: [PATCH 52/61] Add dokku-registry to list. Closes #716 --- docs/plugins.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/plugins.md b/docs/plugins.md index 8942bce40..40a3dedd7 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -71,6 +71,7 @@ Note: The following plugins have been supplied by our community and may not have [cameron-martin]: https://github.com/cameron-martin [matto1990]: https://github.com/matto1990 [ohardy]: https://github.com/ohardy +[agco-adm]: https://github.com/agco-adm ### Datastores @@ -145,6 +146,7 @@ Note: The following plugins have been supplied by our community and may not have | [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env)| [cameron-martin][] | Works with v0.2.3 | | [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | Works with v0.2.3 | | [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh](https://github.com/mikecsh) | Works with 0.2.0 | +| [dokku-registry](https://github.com/agco-adm/dokku-registry) | [agco-adm][] | | [8fca220]: https://github.com/progrium/dokku/commit/8fca2204edb0017796d6915ca9157c05b1238e28 [217d00a]: https://github.com/progrium/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7 From 99304ac3d9941cd8fd8dee16981d539ee2b1707a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 03:18:08 -0500 Subject: [PATCH 53/61] Update template for dokku docs --- docs/index.md | 2 +- docs/template.html | 98 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 docs/template.html diff --git a/docs/index.md b/docs/index.md index f3e026625..73fe4e06e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,4 +23,4 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. ## Sponsors -Though we love everybody doing open source, we especially love [Deis](http://deis.io/) for sponsoring Dokku. \ No newline at end of file +Though we love everybody doing open source, we especially love [Deis](http://deis.io/) for sponsoring Dokku. diff --git a/docs/template.html b/docs/template.html new file mode 100644 index 000000000..a66d9b40b --- /dev/null +++ b/docs/template.html @@ -0,0 +1,98 @@ + + + + {{NAME}} :: viewdocs.io + + + + + + +
+
+

{{NAME}} :: index

+
+
+ {{CONTENT}} +
+
+ + + + + + From 580f89e63bdde28edb2ffb03af34b69171011dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= Date: Sun, 18 May 2014 19:35:22 +0300 Subject: [PATCH 54/61] Plugin nginx-vhosts includes files in folder nginx.conf.d --- plugins/nginx-vhosts/post-deploy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/nginx-vhosts/post-deploy b/plugins/nginx-vhosts/post-deploy index b0d06e8cb..19d5f04fc 100755 --- a/plugins/nginx-vhosts/post-deploy +++ b/plugins/nginx-vhosts/post-deploy @@ -57,6 +57,7 @@ $SSL_DIRECTIVES proxy_set_header X-Forwarded-Port \$server_port; proxy_set_header X-Request-Start \$msec; } + include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf; } EOF @@ -80,6 +81,7 @@ server { proxy_set_header X-Forwarded-Port \$server_port; proxy_set_header X-Request-Start \$msec; } + include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf; } EOF From 26a9e2fbf23df723e323d05c1f783e93ee0d8f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wollse=CC=81n?= Date: Sun, 16 Nov 2014 13:18:26 +0200 Subject: [PATCH 55/61] Update plugins list - VHOSTS Custom Configuration required core PR was made available in dokku core 0.3.1 --- docs/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins.md b/docs/plugins.md index 40a3dedd7..c9207f96b 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -141,7 +141,7 @@ Note: The following plugins have been supplied by our community and may not have | [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | | | [Pre-Deploy Tasks](https://github.com/michaelshobbs/dokku-app-predeploy-tasks) | [michaelshobbs][] | | | [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | | -| [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) | [motin][] | Requires https://github.com/progrium/dokku/pull/579 | +| [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) | [motin][] | Compatible with 0.3.1+ | | [Multiple domains and per-app custom nginx.conf](https://github.com/mikexstudios/dokku-nginx-alt) | [mikexstudios][] | Works with v0.2.3 | | [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env)| [cameron-martin][] | Works with v0.2.3 | | [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | Works with v0.2.3 | From 647b215738f76a43d37a4321ac40ee8559d7274e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 12:19:29 -0500 Subject: [PATCH 56/61] Update HISTORY.md for 0.3.0 --- HISTORY.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 085f7977f..0812f3333 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,8 +1,40 @@ # History -## 0.3.0 (in progress) +## 0.3.0 + +- Added git submodules support +- 969aed87: @jfrazelle Fix double brackets issue in nginx-vhosts install +- 42fee25f: @rhy-jot Mention 14.04 & 12.10 sunset +- 4f5fc586: @rhy-jot Update cipher list +- #276: @joliv Add dependencies hook - wingrunr21- #476: Added man page entry +- #522: @wingrunr21 Improve SSL support and implement SPDY +- #544: @jfrazelle if dokku.conf has not been created, create it +- #555: @jakubholynet Readme fix, Env vars only set at run time +- #562: @assaf Zero down-time deploy and server checks +- #571: @joliv Added man page plugin command + #601: @jazzzz Restart app only if config changed +- #628: @voronianski Update Vagrant box to trusty because of raring server issues +- #632: @jazzzz Fixed port when docker is start with --ip with an IP other than 0.0.0.0 +- #654: @cameron-martin Fixed variable name for RESTART +- #664: @alexernst Don't overwrite $APP/URL modified by plugins in post-deploy hook +- #665: @protomouse Explicitly install man-db +- #698: @tombell Help output formatting +- #701: @jazzzz Fix issues with single-letter config:set usage +- #703: @jazzzz Display help when invoking dokku with no parameter +- #706: @josegonzalez Consolidate documentation on viewthedocs +- #709: @rinti Grammar and spelling fixes +- #708: @josegonzalez Simplify vagrant workflow +- #717: @kristofsajdak Add dokku-registry to plugin list +- #718: @Coaxial Use https for installation instructions +- #721: @wrboyce Fix issue in plugins-install-dependencies +- #723: @ghostbar Let users know they are starting buildstep during installation +- #735: @andrewsomething Redirect to the app deployment docs on success. +- #745: @rcarmo Typo +- #746: @vincentfretin replace gitreceive by sshcommand in example url +- #748: @vincentfretin Link to proper blog url +- #749: @vincentfretin Fix app certificate directory in backup-import/export +- #750: @th4t Remove unintended phrase repetition in installation.md -* Added git submodules support ## 0.2.0 (2013-11-24) From 00a8370b7d1b368b8f10c85d6da85c2d8c2725f1 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 12:36:31 -0500 Subject: [PATCH 57/61] Release 0.3.1 --- HISTORY.md | 18 ++++++++++++++++++ README.md | 2 +- contrib/dokku-installer.rb | 2 +- docs/installation.md | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 0812f3333..bacb60464 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,23 @@ # History +## 0.3.1 + +- 647b2157: @josegonzalez Update HISTORY.md for 0.3.0 +- #359: @plietar Remove plugins before copying them again +- #573: @eriknomitch Use command instead of which for apt-get existential check in bootstrap.sh +- #579: @motin Plugin nginx-vhosts includes files in folder nginx.conf.d +- #607: @fbochu Use PLUGIN_PATH in dokku default case +- #617: @markstos Document what bootstrap.sh is doing +- #758: @josegonzalez Make ENV file readable only from dokku user. Closes #621 +- #699: @tombell Actually suppress the output from `git_archive_all` +- #702: @jazzzz Allows config:set to set parameters values with spaces +- #754: @josegonzalez Remove all references to Ubuntu 12.04. Refs #238 +- #755: @josegonzalez Setup dokku-installer within Vagrant VM on first provision +- #759: @josegonzalez Create an `apps` core plugin +- #760: @josegonzalez Formatting +- #761: @josegonzalez Add dokku-registry to list. Closes #716 +- #762: @josegonzalez Update template for dokku docs + ## 0.3.0 - Added git submodules support diff --git a/README.md b/README.md index f6b60d867..ce422d53d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S To install the latest stable version of dokku, you can run the following bootstrapper command: - $ wget -qO- https://raw.github.com/progrium/dokku/v0.3.0/bootstrap.sh | sudo DOKKU_TAG=v0.3.0 bash + $ wget -qO- https://raw.github.com/progrium/dokku/v0.3.1/bootstrap.sh | sudo DOKKU_TAG=v0.3.1 bash ## Documentation diff --git a/contrib/dokku-installer.rb b/contrib/dokku-installer.rb index 938ca8544..6506fc176 100755 --- a/contrib/dokku-installer.rb +++ b/contrib/dokku-installer.rb @@ -21,7 +21,7 @@ if ARGV[0] == "onboot" exit end -version = "v0.3.0" +version = "v0.3.1" dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku" admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip diff --git a/docs/installation.md b/docs/installation.md index 86f2732d4..92f20125e 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -11,7 +11,7 @@ Ubuntu 14.04 x64 x64. Ideally have a domain ready to point to your host. It's de To install the latest stable version of dokku, you can run the following bootstrapper command: ```bash -wget -qO- https://raw.github.com/progrium/dokku/v0.3.0/bootstrap.sh | sudo DOKKU_TAG=v0.3.0 bash +wget -qO- https://raw.github.com/progrium/dokku/v0.3.1/bootstrap.sh | sudo DOKKU_TAG=v0.3.1 bash ``` ## Configuring From b68a8da2ce480f57493994148183e0df000e4bc9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 13:00:07 -0500 Subject: [PATCH 58/61] Do not allow users to delete the tls directory --- plugins/apps/commands | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/apps/commands b/plugins/apps/commands index 770f772f4..b1a67d7b5 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -33,6 +33,11 @@ case "$1" in exit 1 fi + if [[ "$APP" == "tls" ]]; then + echo "Unable to destroy tls directory" + exit 1 + fi + echo " ! WARNING: Potentially Destructive Action" echo " ! This command will destroy $APP (including all add-ons)." echo " ! To proceed, type \"$APP\"" From b011e54dca2d9fea32899c7925ccccc465309b27 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 13:00:33 -0500 Subject: [PATCH 59/61] Skip tls directory in deploy:all hack --- dokku | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dokku b/dokku index 0beb34e94..2f0ec3b93 100755 --- a/dokku +++ b/dokku @@ -132,8 +132,8 @@ case "$1" in # temporary hack for https://github.com/progrium/dokku/issues/82 deploy:all) - for app in $(ls -d $DOKKU_ROOT/*/); do - APP=$(basename $app); + for app in $(ls -d $DOKKU_ROOT/*/CONTAINER); do + APP=$(basename $(dirname $app)); dokku deploy $APP done ;; From d36249f51ab96f30296daaf912ba6232f84814ab Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 13:08:00 -0500 Subject: [PATCH 60/61] Ignore tls directory when listing out apps --- plugins/apps/commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apps/commands b/plugins/apps/commands index b1a67d7b5..0f26481d7 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -4,7 +4,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x case "$1" in apps) echo "=== My Apps" - find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 + find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 ;; apps:create) From bf4876107da62794cb4149c92f397e4a1baaea4f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 16 Nov 2014 19:14:51 -0500 Subject: [PATCH 61/61] Sort output of apps command --- plugins/apps/commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apps/commands b/plugins/apps/commands index 0f26481d7..673238045 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -4,7 +4,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x case "$1" in apps) echo "=== My Apps" - find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 + find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort ;; apps:create)