From d8f69746bb6ec65bcd3918d155384500cfa2ef9f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Mar 2015 02:48:17 -0400 Subject: [PATCH 01/12] [ci skip] Ensure man-db is installed as a dependency --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 74d2748cd..57953d897 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 dokku-installer vagrant-acl-add vagrant-dokku +.PHONY: all install copyfiles man-db version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku include tests.mk include deb.mk @@ -61,12 +61,15 @@ plugin-dependencies: pluginhook plugins: pluginhook docker dokku plugins-install -dependencies: sshcommand pluginhook docker help2man +dependencies: sshcommand pluginhook docker help2man man-db $(MAKE) -e stack help2man: apt-get install -qq -y help2man +man-db: + apt-get install -qq -y man-db + sshcommand: wget -qO /usr/local/bin/sshcommand ${SSHCOMMAND_URL} chmod +x /usr/local/bin/sshcommand From 9312a99664b0e5acbc84ec186661732738c7032a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Mar 2015 02:48:46 -0400 Subject: [PATCH 02/12] [ci skip] Install gcc when running `make deb-setup` --- deb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb.mk b/deb.mk index c10fdb89f..a2e4460c7 100644 --- a/deb.mk +++ b/deb.mk @@ -61,7 +61,7 @@ deb-all: deb-buildstep deb-dokku deb-gems deb-pluginhook deb-sshcommand deb-setup: echo "-> Updating deb repository and installing build requirements" sudo apt-get update > /dev/null - sudo apt-get install -qq -y git ruby1.9.1-dev 2>&1 > /dev/null + sudo apt-get install -qq -y gcc git ruby1.9.1-dev 2>&1 > /dev/null command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc ssh -o StrictHostKeyChecking=no git@github.com || true From 50fe9e39addc7a3ce2a549660062fc7fe752e572 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Mar 2015 02:50:27 -0400 Subject: [PATCH 03/12] [ci skip] Ensure we run apt-get update when installing docker On certain operating systems, this may not be called if invoking `make install` directly --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 57953d897..c05456e65 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS))) $(eval $(RUN_ARGS):;@:) endif -.PHONY: all install copyfiles man-db version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku +.PHONY: all apt-update install copyfiles man-db version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku include tests.mk include deb.mk @@ -61,9 +61,12 @@ plugin-dependencies: pluginhook plugins: pluginhook docker dokku plugins-install -dependencies: sshcommand pluginhook docker help2man man-db +dependencies: apt-update sshcommand pluginhook docker help2man man-db $(MAKE) -e stack +apt-update: + apt-get update + help2man: apt-get install -qq -y help2man From ea7e3dc61d615edd8b30ccad6a1f7b7f689098ec Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Mar 2015 02:51:18 -0400 Subject: [PATCH 04/12] [ci skip] Switch vagrant box to chef/ubuntu-14.04 The current ubuntu cloud image has a bug where networking appears to stall intermittently, making it difficult to interact with the vm --- Vagrantfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index f65b97ec8..bb349d0d1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,8 +1,7 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -BOX_NAME = ENV["BOX_NAME"] || "trusty" -BOX_URI = ENV["BOX_URI"] || "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" +BOX_NAME = ENV["BOX_NAME"] || "chef/ubuntu-14.04" BOX_MEMORY = ENV["BOX_MEMORY"] || "1024" DOKKU_DOMAIN = ENV["DOKKU_DOMAIN"] || "dokku.me" DOKKU_IP = ENV["DOKKU_IP"] || "10.0.0.2" @@ -19,7 +18,6 @@ Vagrant::configure("2") do |config| config.ssh.forward_agent = true config.vm.box = BOX_NAME - config.vm.box_url = BOX_URI config.vm.synced_folder File.dirname(__FILE__), "/root/dokku" config.vm.provider :virtualbox do |vb| From 45e53d3d9dbcf185403f4132e2072ac55e737c8f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Mar 2015 02:51:29 -0400 Subject: [PATCH 05/12] [ci skip] Remove extra install calls --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 942f63da2..3eacc9376 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -14,7 +14,7 @@ then fi apt-get update -apt-get install -qq -y git make curl software-properties-common man-db help2man +apt-get install -qq -y git make software-properties-common [[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties From 9dfa7ccee6335c9ae484bf67b2c9fa91121722e6 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Mar 2015 02:51:51 -0400 Subject: [PATCH 06/12] [ci skip] Ensure the /root/.ssh directory exists before copying the user's public key into the vm --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index bb349d0d1..5a4a0ad8e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -52,6 +52,6 @@ Vagrant::configure("2") do |config| if Pathname.new(PUBLIC_KEY_PATH).exist? config.vm.provision :file, source: PUBLIC_KEY_PATH, destination: '/tmp/id_rsa.pub' - config.vm.provision :shell, :inline => "rm -f /root/.ssh/authorized_keys && cp /tmp/id_rsa.pub /root/.ssh/authorized_keys" + config.vm.provision :shell, :inline => "rm -f /root/.ssh/authorized_keys && mkdir -p /root/.ssh && sudo cp /tmp/id_rsa.pub /root/.ssh/authorized_keys" end end From 12ee6953bb5e3815edb7fb1f2ad998bb5d42c121 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 8 Apr 2015 19:21:02 -0400 Subject: [PATCH 07/12] [ci skip] modify bootstrap script to handle installing from a deb package For branch-based installs, or anything specifying tags below 0.3.13, we install from source. --- bootstrap.sh | 68 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 18 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 3eacc9376..15764ba0e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,37 +1,69 @@ -#!/usr/bin/env bash +#!/bin/bash +# # A script to bootstrap dokku. # It expects to be run on Ubuntu 14.04 via 'sudo' +# If installing a tag higher than 0.3.13, it may install dokku via a package (so long as the package is higher than 0.3.13) # 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"} -if ! command -v apt-get &>/dev/null -then +if ! command -v apt-get &>/dev/null; then echo "This installation script requires apt-get. For manual installation instructions, consult http://progrium.viewdocs.io/dokku/advanced-installation ." exit 1 fi apt-get update -apt-get install -qq -y git make software-properties-common - [[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties -cd ~ -test -d dokku || git clone $DOKKU_REPO -cd dokku -git fetch origin +dokku_install_source() { + apt-get install -qq -y git make software-properties-common + cd /root + if [ ! -d /root/dokku ]; then + git clone $DOKKU_REPO /root/dokku + fi + + cd /root/dokku + git fetch origin + git checkout $DOKKU_CHECKOUT + make install +} + +dokku_install_package() { + curl --silent https://get.docker.io/gpg 2> /dev/null | apt-key add - 2>&1 >/dev/null + curl --silent https://packagecloud.io/gpg.key 2> /dev/null | apt-key add - 2>&1 >/dev/null + + echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list + echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" > /etc/apt/sources.list.d/dokku.list + + sudo apt-get update > /dev/null + sudo apt-get install -qq -y linux-image-extra-`uname -r` apt-transport-https + + if [[ -n $DOKKU_CHECKOUT ]]; then + sudo apt-get install -qq -y dokku=$DOKKU_CHECKOUT + else + sudo apt-get install -qq -y dokku + fi +} if [[ -n $DOKKU_BRANCH ]]; then - git checkout origin/$DOKKU_BRANCH + export DOKKU_CHECKOUT="origin/$DOKKU_BRANCH" + dokku_install_source elif [[ -n $DOKKU_TAG ]]; then - git checkout $DOKKU_TAG + export DOKKU_SEMVER="${DOKKU_TAG//v}" + major=`echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[1]}'` + minor=`echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[2]}'` + patch=`echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[3]}'` + + # 0.3.13 was the first version with a debian package + if [[ "$major" -eq "0" ]] && [[ "$minor" -lt "4" ]] && [[ "$patch" -lt "13" ]]; then + export DOKKU_CHECKOUT="$DOKKU_TAG" + dokku_install_source + else + export DOKKU_CHECKOUT="$DOKKU_SEMVER" + dokku_install_package + fi +else + dokku_install_package fi - -make install - -echo -echo "Almost done! For next steps on configuration:" -echo " http://progrium.viewdocs.io/dokku/advanced-installation#user-content-configuring" - From b3053fe392076d6987d06a8c28271f1a283f0bed Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 18 Apr 2015 02:48:44 -0400 Subject: [PATCH 08/12] [ci skip] update upgrade documentation for 0.3.18 --- docs/upgrading.md | 99 +++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 55 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 1f49f6adc..a2a02e4e6 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -1,73 +1,62 @@ # Upgrading -Dokku is in active development. You can update the deployment step and the build step separately. +This document covers upgrades for the 0.3.0 series and up. If upgrading from previous versions, we recommend [a fresh install](http://progrium.viewdocs.io/dokku/installation) on a new server. -**Note**: If you are upgrading from a revision prior to [27d4bc8c3c](https://github.com/progrium/dokku/commit/27d4bc8c3c19fe580ef3e65f2f85b85101cd83e4), follow the instructions in [this wiki entry](https://github.com/progrium/dokku/wiki/Migrating-to-Dokku-0.2.0). +> As of 0.3.18, dokku is installed by default via a debian package. Source-based installations are still available, though not recommended. -To update the deploy step (this is updated less frequently): +## Dokku + +If dokku was installed via a debian package, you can upgrade dokku via the following command: + +```shell +sudo apt-get install dokku +``` + +For unattended upgrades, you may run the following command: + +```shell +sudo apt-get install -qq -y dokku +``` + +If you have installed dokku from source, you may run the following commands to upgrade: ```shell cd ~/dokku git pull --tags origin master + +# continue to install from source +sudo DOKKU_BRANCH=master make install + +# upgrade to debian package-based installation sudo make install ``` -Nothing needs to be restarted. Changes will take effect on the next push / deployment. - -To update the build step: +All changes will take effect upon next application deployment. To trigger a rebuild of every application, simply run the following command: ```shell +dokku ps:rebuildall +``` + +## Buildstep image + +If dokku was installed via a debian package, you can upgrade buildstep via the following command: + +```shell +sudo apt-get install buildstep +``` + +For unattended upgrades, you may run the following command: + +```shell +sudo apt-get install -qq -y buildstep +``` + +In some cases, it may be desirable to run a specific version of buildstep. To install/upgrade buildstep from source, run the following commands: + +```shell +cd /tmp git clone https://github.com/progrium/buildstep.git cd buildstep git pull origin master sudo make build ``` - -This will build a fresh Ubuntu Quantal image, install a number of packages, and -eventually replace the Docker image for buildstep. - -## Migrating from 0.1.0 to 0.2.0 - -This should be summary of breaking changes between 0.1 and 0.2 version with instructions to upgrade. - -### software-properties-common - -software-properties-common is now a dependency for plugins. Before running dokku install script, make sure it is installed. - -```shell -> sudo apt-get install software-properties-common -``` - -### Gitreceive removed - -PR [#270](https://github.com/progrium/dokku/pull/270). - -Starting with Dokku 0.2.0, [Gitrecieve](https://github.com/progrium/gitreceive) is replaced by a `git` plugin. - -Dokku no longer uses the `git` user. Everything is done with the `dokku` user account. - -This causes the remote url to change. Instead of pushing to `git@hostname:app`, you should now push to `dokku@hostname:app`. -The url must be modified using the `git remote set-url` command : - - git remote set-url deploy dokku@hostname:app - -Where `deploy` is the name of the remote. - -Additionally, the repositiories on the server must be migrated to work with dokku 0.2.0 - -There is an upgrade [script](https://gist.github.com/plietar/7201430), which is meant to automate this migration. To use it: - -1. run the script as root -2. `git pull` to get the latest version of dokku -3. make install -4. `dokku ps:restartall` - -TDB. - -### Cache directory - -Commit [#6350f373](https://github.com/progrium/dokku/commit/6350f373be2cef4f3bb90912099e1be6196522d1) - -Buildstep have to be re-installed in order to support cache directory. - -TDB. From 0e5bc10ae7aecfd58beffd6a665dd667c9137ffb Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 18 Apr 2015 02:54:21 -0400 Subject: [PATCH 09/12] [ci skip] update advanced installation docs for development --- docs/advanced-installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/advanced-installation.md b/docs/advanced-installation.md index 348eb7270..9ee60240f 100644 --- a/docs/advanced-installation.md +++ b/docs/advanced-installation.md @@ -3,7 +3,7 @@ You can always install dokku straight from the latest - potentially unstable - master release via the following bash command: ```shell -wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash +wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo DOKKU_BRANCH=master bash ``` ## Development @@ -29,7 +29,7 @@ The bootstrap script allows the dokku repository URL to be overridden to bootstr ```shell wget https://raw.github.com/progrium/dokku/master/bootstrap.sh chmod +x bootstrap.sh -sudo DOKKU_REPO=https://github.com/yourusername/dokku.git ./bootstrap.sh +sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh ``` ## Custom buildstep build From e2d3107e8a65fd87b0775f281cfa0a32b87db69d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 18 Apr 2015 02:58:34 -0400 Subject: [PATCH 10/12] [ci skip] add raw debian package installation notes --- docs/getting-started/install/debian.md | 15 +++++++++++++++ docs/installation.md | 8 ++------ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 docs/getting-started/install/debian.md diff --git a/docs/getting-started/install/debian.md b/docs/getting-started/install/debian.md new file mode 100644 index 000000000..42374c7ef --- /dev/null +++ b/docs/getting-started/install/debian.md @@ -0,0 +1,15 @@ +# Debian Package Installation Notes + +As of 0.3.18, dokku defaults to being installed via debian package. While certain hosts may require extra work to get running, you may optionally wish to automate the installation of dokku without the use of our `bootstrap.sh` bash script. The following are the steps run by said script: + +```shell +curl --silent https://get.docker.io/gpg 2> /dev/null | apt-key add - 2>&1 >/dev/null +curl --silent https://packagecloud.io/gpg.key 2> /dev/null | apt-key add - 2>&1 >/dev/null + +echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list +echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" > /etc/apt/sources.list.d/dokku.list + +sudo apt-get update > /dev/null +sudo apt-get install -qq -y linux-image-extra-`uname -r` apt-transport-https +sudo apt-get install -qq -y dokku +``` diff --git a/docs/installation.md b/docs/installation.md index 7c532fd6c..420cffb73 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -11,14 +11,9 @@ 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: ```shell -# This may need to be run twice +# installs dokku via apt-get wget -qO- https://raw.github.com/progrium/dokku/v0.3.17/bootstrap.sh | sudo DOKKU_TAG=v0.3.17 bash -# Install the web installer. See `Configuring` under -# `Advanced Install Customization` if you wish to perform the -# rest of the install via CLI -cd /root/dokku && make dokku-installer - # Go to your server's IP and follow the web installer ``` @@ -29,5 +24,6 @@ For various reasons, certain hosting providers may have other steps that should As well, you may wish to customize your installation in some other fashion. or experiment with vagrant. The guides below should get you started: +- [Debian Package Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/debian) - [Vagrant Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/vagrant) - [Advanced Install Customization](http://progrium.viewdocs.io/dokku/advanced-installation) From a2ed0ef2b689620b8d173bc8ca908c65098a78d7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 18 Apr 2015 03:23:12 -0400 Subject: [PATCH 11/12] [ci skip] fix listing issues in bootstrap.sh --- bootstrap.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 15764ba0e..488ab4fad 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -31,14 +31,14 @@ dokku_install_source() { } dokku_install_package() { - curl --silent https://get.docker.io/gpg 2> /dev/null | apt-key add - 2>&1 >/dev/null - curl --silent https://packagecloud.io/gpg.key 2> /dev/null | apt-key add - 2>&1 >/dev/null + curl --silent https://get.docker.io/gpg 2> /dev/null | apt-key add - > /dev/null 2>&1 + curl --silent https://packagecloud.io/gpg.key 2> /dev/null | apt-key add - > /dev/null 2>&1 echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" > /etc/apt/sources.list.d/dokku.list sudo apt-get update > /dev/null - sudo apt-get install -qq -y linux-image-extra-`uname -r` apt-transport-https + sudo apt-get install -qq -y "linux-image-extra-$(uname -r)" apt-transport-https if [[ -n $DOKKU_CHECKOUT ]]; then sudo apt-get install -qq -y dokku=$DOKKU_CHECKOUT @@ -52,9 +52,9 @@ if [[ -n $DOKKU_BRANCH ]]; then dokku_install_source elif [[ -n $DOKKU_TAG ]]; then export DOKKU_SEMVER="${DOKKU_TAG//v}" - major=`echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[1]}'` - minor=`echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[2]}'` - patch=`echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[3]}'` + major=$(echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[1]}') + minor=$(echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[2]}') + patch=$(echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[3]}') # 0.3.13 was the first version with a debian package if [[ "$major" -eq "0" ]] && [[ "$minor" -lt "4" ]] && [[ "$patch" -lt "13" ]]; then From 23a6656566129367c288a0f502b603567f40c5c5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 18 Apr 2015 03:23:30 -0400 Subject: [PATCH 12/12] [ci skip] ensure we run apt-get update at least once before installing git --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 5a4a0ad8e..af60cf386 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -34,7 +34,7 @@ Vagrant::configure("2") do |config| vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT vm.vm.hostname = "#{DOKKU_DOMAIN}" vm.vm.network :private_network, ip: DOKKU_IP - vm.vm.provision :shell, :inline => "DEBIAN_FRONTEND=noninteractive apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}" + vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}" vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer" end