Compare commits
133 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87573b81bb | ||
|
|
66ef66644f | ||
|
|
e46b0952e2 | ||
|
|
6ab9e04ba6 | ||
|
|
4740ee1edc | ||
|
|
f3113296ee | ||
|
|
6c8c4de398 | ||
|
|
6d5d919a06 | ||
|
|
7af00ef744 | ||
|
|
5f86962c06 | ||
|
|
171e9625f6 | ||
|
|
1f91b33f46 | ||
|
|
e6bd877b48 | ||
|
|
127dd7334f | ||
|
|
3f219a3f8e | ||
|
|
fb5cc76585 | ||
|
|
c5117cb42f | ||
|
|
4c86f88816 | ||
|
|
f100a3ee4c | ||
|
|
a53c61b4d8 | ||
|
|
88f37028a2 | ||
|
|
42b1666fbe | ||
|
|
de9f495e2c | ||
|
|
cda2e3d048 | ||
|
|
991bb4d7f0 | ||
|
|
c9a1a94cc1 | ||
|
|
819608b940 | ||
|
|
dda58a82f9 | ||
|
|
8f816c3433 | ||
|
|
88f2dc7f60 | ||
|
|
da44c240d7 | ||
|
|
cd2ae7ea92 | ||
|
|
23c71c8d69 | ||
|
|
21feb6874a | ||
|
|
ec1b0b530f | ||
|
|
71ee7e73a7 | ||
|
|
d4b85999af | ||
|
|
f7479250c3 | ||
|
|
0f448748e8 | ||
|
|
d5a013a973 | ||
|
|
6a9b3f6df2 | ||
|
|
8398ff7a76 | ||
|
|
4070779d41 | ||
|
|
cce2a41db6 | ||
|
|
15ee3b2e62 | ||
|
|
86b5b71f28 | ||
|
|
8058252426 | ||
|
|
6f91a34f74 | ||
|
|
a1d3477345 | ||
|
|
f71611f5a1 | ||
|
|
0d54423618 | ||
|
|
fcba766a75 | ||
|
|
b6f57b32b0 | ||
|
|
e4fee97d9b | ||
|
|
0dfe92100f | ||
|
|
7a2c1ba3ec | ||
|
|
72aa611d2a | ||
|
|
7cfbdf34ec | ||
|
|
334eabafb5 | ||
|
|
50b1c9d5c6 | ||
|
|
4e25639de4 | ||
|
|
63817fc6f3 | ||
|
|
970647b4ae | ||
|
|
ef113a475c | ||
|
|
9abe7e2b75 | ||
|
|
f5ea960de3 | ||
|
|
8d6f32e1e3 | ||
|
|
d7bc6976ed | ||
|
|
f6c072fa2b | ||
|
|
95239a5731 | ||
|
|
9951a16ccc | ||
|
|
7ac47d2e61 | ||
|
|
d4475e582d | ||
|
|
c4c7886037 | ||
|
|
c98ab6684f | ||
|
|
434672a8dd | ||
|
|
f6a0c3d5f8 | ||
|
|
729677c41a | ||
|
|
6c10fd4c39 | ||
|
|
ccc44b0c16 | ||
|
|
faaf81d6e9 | ||
|
|
d7c8e47e78 | ||
|
|
39ced08b12 | ||
|
|
e62f35f207 | ||
|
|
14833e22cb | ||
|
|
9c5783215f | ||
|
|
180582df2e | ||
|
|
255a533708 | ||
|
|
2d70a10a14 | ||
|
|
58e2391cdb | ||
|
|
ab51c3b4b4 | ||
|
|
a7e4b7e3c6 | ||
|
|
25e5db5a5b | ||
|
|
aca8d0c682 | ||
|
|
65c2cffc6a | ||
|
|
a2bacd8096 | ||
|
|
030405b93d | ||
|
|
10bb4900c0 | ||
|
|
48b3dffecb | ||
|
|
056ff73c28 | ||
|
|
3200c169f4 | ||
|
|
4f7e9d4d58 | ||
|
|
d6443d7560 | ||
|
|
35f1161453 | ||
|
|
95dc3ca20e | ||
|
|
28c29da166 | ||
|
|
c0d3b8c9a9 | ||
|
|
1834ec8087 | ||
|
|
22c9441ddb | ||
|
|
9018fee0e2 | ||
|
|
5ec1dea555 | ||
|
|
6d002425bc | ||
|
|
93b47cb85f | ||
|
|
b4cbaae757 | ||
|
|
11a945c86e | ||
|
|
90f16945f1 | ||
|
|
f40e010ab0 | ||
|
|
b771f0f809 | ||
|
|
f6488147bd | ||
|
|
542f4dd430 | ||
|
|
288d72327d | ||
|
|
7bf22df7c3 | ||
|
|
537906c504 | ||
|
|
dc879e2c4a | ||
|
|
58f28c1aea | ||
|
|
4e1a93224e | ||
|
|
0004dd53e1 | ||
|
|
cf901c9bcc | ||
|
|
b5cf371a55 | ||
|
|
d433614f17 | ||
|
|
2fc3a09b41 | ||
|
|
67705afe3c | ||
|
|
8200348f3c |
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
||||
*Dockerfile
|
||||
.dockerignore
|
||||
.git
|
||||
.vagrant
|
||||
contrib
|
||||
docs
|
||||
tests
|
||||
!contrib/dokku-installer.py
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
*.deb
|
||||
*.rpm
|
||||
.DS_Store
|
||||
.ruby-version
|
||||
.vagrant
|
||||
|
||||
@@ -55,7 +55,7 @@ doesn't already include that problem or suggestion before submitting an issue.
|
||||
If you find a match, add a quick "+1" or "I have this problem too." Doing this
|
||||
helps prioritize the most common problems and requests.
|
||||
|
||||
When reporting issues, please include your host OS (Ubuntu 14.04, Fedora 19,
|
||||
When reporting issues, please include your host OS (Ubuntu 14.04, CentOS 7,
|
||||
etc). Please include:
|
||||
|
||||
* The output of `uname -a`.
|
||||
|
||||
62
HISTORY.md
62
HISTORY.md
@@ -1,5 +1,67 @@
|
||||
# History
|
||||
|
||||
## 0.8.0
|
||||
|
||||
The big kahuna. Lots of documentation changes, and a few bug fixes to make Dokku development a bit easier.
|
||||
|
||||
CentOS 7 users will be happy to see that we now have experimental support for your operating system. Huge thanks to @ebeigarts for working on that feature :)
|
||||
|
||||
Thanks to all the contributors who helped with this release!
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #2407: @josegonzalez Move core post-deploy triggers to core-post-deploy
|
||||
- #2442: @znz Fix `is_tag_force_available` bug when docker major version up
|
||||
- #2452: @mbtamuli Solves SSH Key problem when admin user already exists
|
||||
- #2454: @onbjerg Return exit 1 in config:get if no ENV file exists
|
||||
- #2464: @sseemayer Remove duplicate SSL hostnames
|
||||
- #2465: @polettix Fix issue when importing ssh-keys
|
||||
- #2477: @ebeigarts Fix dokku-redeploy systemd script to start only after docker
|
||||
- #2485: @znz Fix bug when VHOST file is missing newline
|
||||
- #2492: @josegonzalez Fix iteration on all apps for `dokku proxy` command
|
||||
- #2495: @josegonzalez Create the user's `authorized_keys` file if it does not exist
|
||||
- #2496: @josegonzalez Detect nginx versions that support HTTP/2 well
|
||||
- #2518: @josegonzalez Use same check for dockerfile apps during a tar build
|
||||
- #2526: @michaelshobbs Actually fail deploy when app.json script fails
|
||||
- #2539: @ebeigarts Fix dokku-installer.service removal
|
||||
|
||||
### New Features
|
||||
|
||||
- #2378: @knjcode Skip container finish processing when zero downtime is disabled
|
||||
- #2406: @josegonzalez Use apps_create method when renaming an application
|
||||
- #2419: @ebeigarts Support for CentOS 7
|
||||
- #2489: @joshmanders Add plugin uninstall trigger
|
||||
- #2510: @IlyaSemenov Add domains:set and domains:set-global commands
|
||||
- #2544: @michaelshobbs Update herokuish to 0.3.24
|
||||
- #2552: @josegonzalez Allow package building on OSX
|
||||
- #2553: @josegonzalez Add release-related Dockerfiles
|
||||
|
||||
### Documentation
|
||||
|
||||
- #2432: @josegonzalez Clarify DOKKU_SCALE docs
|
||||
- #2433: @alexgleason Add robots.txt plugin to community docs
|
||||
- #2437: @vishnubhagwan Fix warning in installation docs
|
||||
- #2451: @mbtamuli Document the logs plugin
|
||||
- #2470: @fteychene Add build-hook to plugins doc
|
||||
- #2472: @mainto Add dokku-access to plugins doc
|
||||
- #2484: @nahtnam Document build issues when a `Killed` message is displayed
|
||||
- #2486: @OmarShehata Fixing typo & broken link in docs
|
||||
- #2488: @joshmanders Bump font size in documentation
|
||||
- #2493: @josegonzalez Clarify checks documentation
|
||||
- #2497: @joshmanders Make features heading more clear
|
||||
- #2503: @mlebkowski Update dokku-acl plugin link
|
||||
- #2505: @kjschulz Add Dokku Wordpress plugin to docs
|
||||
- #2506: @simonkotwicz Fix typos in deployment docs
|
||||
- #2507: @josegonzalez Update upgrade docs to point out sshcommand and plugn upgrading as well
|
||||
- #2509: @kjschulz Map dokku-community user in plugins
|
||||
- #2511: @IlyaSemenov Clarify instructions for arranging default nginx site
|
||||
- #2515: @sgloutnikov Update DreamHost Cloud install instructions
|
||||
- #2517: @josegonzalez Update docs regarding if the ssh-keys plugin should be in use
|
||||
- #2522: @joshmanders Ensure install documentation can be run via copy-paste
|
||||
- #2525: @OmarShehata Plugin-triggers typo: dokkku -> dokku
|
||||
- #2531: @slava-vishnyakov Document rebuilding app after mounting storage
|
||||
- #2533: @facundomedica Document potential firewall problem on Ubuntu 16.04
|
||||
|
||||
## 0.7.2
|
||||
|
||||
This minor release contains mostly documentation changes, and should be fully backwards compatible with previous 0.7.x releases.
|
||||
|
||||
15
Makefile
15
Makefile
@@ -1,4 +1,4 @@
|
||||
DOKKU_VERSION = master
|
||||
DOKKU_VERSION ?= master
|
||||
|
||||
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.6.0/sshcommand
|
||||
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.2.2/plugn_0.2.2_linux_x86_64.tgz
|
||||
@@ -27,6 +27,7 @@ endif
|
||||
|
||||
include tests.mk
|
||||
include deb.mk
|
||||
include rpm.mk
|
||||
include arch.mk
|
||||
|
||||
all:
|
||||
@@ -34,13 +35,17 @@ all:
|
||||
|
||||
install: dependencies version copyfiles plugin-dependencies plugins
|
||||
|
||||
release: deb-all package_cloud packer
|
||||
release: deb-all rpm-all package_cloud packer
|
||||
|
||||
package_cloud:
|
||||
package_cloud push dokku/dokku/ubuntu/trusty herokuish*.deb
|
||||
package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb
|
||||
package_cloud push dokku/dokku/ubuntu/trusty plugn*.deb
|
||||
package_cloud push dokku/dokku/ubuntu/trusty dokku*.deb
|
||||
package_cloud push dokku/dokku/el/7 herokuish*.rpm
|
||||
package_cloud push dokku/dokku/el/7 sshcommand*.rpm
|
||||
package_cloud push dokku/dokku/el/7 plugn*.rpm
|
||||
package_cloud push dokku/dokku/el/7 dokku*.rpm
|
||||
|
||||
packer:
|
||||
packer build contrib/packer.json
|
||||
@@ -65,13 +70,17 @@ copyfiles:
|
||||
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} || true
|
||||
$(MAKE) addman
|
||||
|
||||
addman: help2man
|
||||
addman: help2man man-db
|
||||
mkdir -p /usr/local/share/man/man1
|
||||
help2man -Nh help -v version -n "configure and get information from your dokku installation" -o /usr/local/share/man/man1/dokku.1 dokku
|
||||
mandb
|
||||
|
||||
version:
|
||||
ifeq ($(DOKKU_VERSION),master)
|
||||
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
|
||||
else
|
||||
echo $(DOKKU_VERSION) > ~dokku/VERSION
|
||||
endif
|
||||
|
||||
plugin-dependencies: plugn
|
||||
sudo -E dokku plugin:install-dependencies --core
|
||||
|
||||
@@ -13,8 +13,12 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen.
|
||||
|
||||
To install the latest stable release, you can run the following commands as a user that has access to `sudo`:
|
||||
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.7.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.7.2 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.8.0/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.8.0 bash bootstrap.sh
|
||||
|
||||
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||
|
||||
If you wish for a more unattended installation method, see [these](http://dokku.viewdocs.io/dokku/getting-started/install/debian/#unattended-installation) docs.
|
||||
|
||||
### Upgrading
|
||||
|
||||
|
||||
11
Vagrantfile
vendored
11
Vagrantfile
vendored
@@ -76,13 +76,22 @@ Vagrant::configure("2") do |config|
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make install-from-deb"
|
||||
end
|
||||
|
||||
config.vm.define "dokku-rpm", autostart: false do |vm|
|
||||
vm.vm.box = "centos/7"
|
||||
vm.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
||||
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 => "cd /root/dokku && bash bootstrap.sh"
|
||||
end
|
||||
|
||||
config.vm.define "build", autostart: false do |vm|
|
||||
vm.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
||||
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 => "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 => "export IS_RELEASE=true && cd /root/dokku && make deb-all"
|
||||
vm.vm.provision :shell, :inline => "export IS_RELEASE=true && cd /root/dokku && make deb-all rpm-all"
|
||||
end
|
||||
|
||||
config.vm.define "build-arch", autostart: false do |vm|
|
||||
|
||||
4
arch.mk
4
arch.mk
@@ -22,7 +22,11 @@ arch-setup:
|
||||
|
||||
arch-dokku: arch-setup
|
||||
echo "-> Update package sums, create metadata file and test the build of the package"
|
||||
ifeq ($(DOKKU_VERSION),master)
|
||||
git describe --tags > /tmp/VERSION
|
||||
else
|
||||
echo $(DOKKU_VERSION) > /tmp/VERSION
|
||||
endif
|
||||
cat /tmp/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/STABLE_VERSION
|
||||
sed -i -e "s/pkgver=.*/pkgver=`cat /tmp/STABLE_VERSION`/" /dokku-arch/PKGBUILD
|
||||
cd /dokku-arch; updpkgsums; mksrcinfo; makepkg -fd
|
||||
|
||||
71
bootstrap.sh
71
bootstrap.sh
@@ -14,10 +14,6 @@ set -eo pipefail; [[ $TRACE ]] && set -x
|
||||
ensure-environment() {
|
||||
local FREE_MEMORY
|
||||
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
||||
if ! command -v apt-get &>/dev/null; then
|
||||
echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hostname -f > /dev/null 2>&1 || {
|
||||
echo "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
|
||||
@@ -33,10 +29,15 @@ ensure-environment() {
|
||||
|
||||
install-requirements() {
|
||||
echo "--> Ensuring we have the proper dependencies"
|
||||
apt-get update -qq > /dev/null
|
||||
if [[ $(lsb_release -sr) == "12.04" ]]; then
|
||||
apt-get -qq -y install python-software-properties
|
||||
fi
|
||||
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian|ubuntu)
|
||||
apt-get update -qq > /dev/null
|
||||
if [[ "$DOKKU_DISTRO_VERSION" == "12.04" ]]; then
|
||||
apt-get -qq -y install python-software-properties
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
install-dokku() {
|
||||
@@ -68,9 +69,14 @@ install-dokku() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
install-dokku-from-source() {
|
||||
local DOKKU_CHECKOUT="$1"
|
||||
|
||||
if ! command -v apt-get &>/dev/null; then
|
||||
echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apt-get -qq -y install git make software-properties-common
|
||||
cd /root
|
||||
if [[ ! -d /root/dokku ]]; then
|
||||
@@ -84,6 +90,21 @@ install-dokku-from-source() {
|
||||
}
|
||||
|
||||
install-dokku-from-package() {
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian|ubuntu)
|
||||
install-dokku-from-deb-package "$@"
|
||||
;;
|
||||
centos)
|
||||
install-dokku-from-rpm-package "$@"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported Linux distribution. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
install-dokku-from-deb-package() {
|
||||
local DOKKU_CHECKOUT="$1"
|
||||
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
|
||||
|
||||
@@ -124,7 +145,39 @@ install-dokku-from-package() {
|
||||
fi
|
||||
}
|
||||
|
||||
install-dokku-from-rpm-package() {
|
||||
local DOKKU_CHECKOUT="$1"
|
||||
|
||||
if [[ "$DOKKU_DISTRO_VERSION" != "7" ]]; then
|
||||
echo "Only CentOS version 7 is supported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "--> Installing docker"
|
||||
curl -fsSL https://get.docker.com/ | sh
|
||||
|
||||
echo "--> Installing epel for nginx packages to be available"
|
||||
yum install -y epel-release
|
||||
|
||||
echo "--> Installing herokuish and dokku"
|
||||
curl -s https://packagecloud.io/install/repositories/dokku/dokku/script.rpm.sh | bash
|
||||
if [[ -n $DOKKU_CHECKOUT ]]; then
|
||||
yum -y install herokuish "dokku-$DOKKU_CHECKOUT"
|
||||
else
|
||||
yum -y install herokuish dokku
|
||||
fi
|
||||
|
||||
echo "--> Starting nginx"
|
||||
systemctl start nginx
|
||||
}
|
||||
|
||||
main() {
|
||||
export DOKKU_DISTRO DOKKU_DISTRO_VERSION
|
||||
# shellcheck disable=SC1091
|
||||
DOKKU_DISTRO=$(. /etc/os-release && echo "$ID")
|
||||
# shellcheck disable=SC1091
|
||||
DOKKU_DISTRO_VERSION=$(. /etc/os-release && echo "$VERSION_ID")
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
|
||||
|
||||
|
||||
34
contrib/build-centos.Dockerfile
Normal file
34
contrib/build-centos.Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get -qq -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
|
||||
RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
WORKDIR /dokku
|
||||
|
||||
COPY Makefile /dokku/
|
||||
|
||||
COPY *.mk /dokku/
|
||||
|
||||
RUN make deb-setup rpm-setup
|
||||
|
||||
COPY . /dokku
|
||||
|
||||
RUN make sshcommand plugn version copyfiles
|
||||
|
||||
ARG DOKKU_VERSION=master
|
||||
ENV DOKKU_VERSION ${DOKKU_VERSION}
|
||||
|
||||
ARG DOKKU_GIT_REV
|
||||
ENV DOKKU_GIT_REV ${DOKKU_GIT_REV}
|
||||
|
||||
ARG IS_RELEASE=false
|
||||
ENV IS_RELEASE ${IS_RELEASE}
|
||||
|
||||
RUN make rpm-herokuish rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil
|
||||
|
||||
RUN mkdir -p /data && cp /tmp/*.rpm /data && ls /data/
|
||||
34
contrib/build-ubuntu.Dockerfile
Normal file
34
contrib/build-ubuntu.Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get -qq -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
|
||||
RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
WORKDIR /dokku
|
||||
|
||||
COPY Makefile /dokku/
|
||||
|
||||
COPY *.mk /dokku/
|
||||
|
||||
RUN make deb-setup rpm-setup
|
||||
|
||||
COPY . /dokku
|
||||
|
||||
RUN make sshcommand plugn version copyfiles
|
||||
|
||||
ARG DOKKU_VERSION=master
|
||||
ENV DOKKU_VERSION ${DOKKU_VERSION}
|
||||
|
||||
ARG DOKKU_GIT_REV
|
||||
ENV DOKKU_GIT_REV ${DOKKU_GIT_REV}
|
||||
|
||||
ARG IS_RELEASE=false
|
||||
ENV IS_RELEASE ${IS_RELEASE}
|
||||
|
||||
RUN make deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil
|
||||
|
||||
RUN mkdir -p /data && cp /tmp/*.deb /data && ls /data/
|
||||
@@ -3,13 +3,14 @@
|
||||
import cgi
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.7.2'
|
||||
VERSION = 'v0.8.0'
|
||||
|
||||
hostname = ''
|
||||
try:
|
||||
@@ -100,8 +101,20 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
with open('{0}/HOSTNAME'.format(dokku_root), 'w') as f:
|
||||
f.write(params['hostname'].value)
|
||||
|
||||
command = ['sshcommand', 'acl-add', 'dokku', 'admin']
|
||||
for key in params['keys'].value.split("\n"):
|
||||
for (index, key) in enumerate(params['keys'].value.splitlines(), 1):
|
||||
user = 'admin'
|
||||
if self.admin_user_exists() is not None:
|
||||
user = 'web-admin'
|
||||
if self.web_admin_user_exists() is not None:
|
||||
index = int(self.web_admin_user_exists()) + 1
|
||||
elif self.web_admin_user_exists() is None:
|
||||
index = 1
|
||||
elif self.admin_user_exists() is None:
|
||||
pass
|
||||
else:
|
||||
index = int(self.admin_user_exists()) + 1
|
||||
user = user + str(index)
|
||||
command = ['sshcommand', 'acl-add', 'dokku', user]
|
||||
proc = subprocess.Popen(command, stdin=subprocess.PIPE)
|
||||
proc.stdin.write(key)
|
||||
proc.stdin.close()
|
||||
@@ -119,6 +132,29 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
self.end_headers()
|
||||
self.wfile.write(json.dumps({'status': 'ok'}))
|
||||
|
||||
def web_admin_user_exists(self):
|
||||
return self.user_exists('web-admin(\d+)')
|
||||
|
||||
def admin_user_exists(self):
|
||||
return self.user_exists('admin(\d+)')
|
||||
|
||||
def user_exists(self, name):
|
||||
command = 'dokku ssh-keys:list'
|
||||
pattern = re.compile(r'NAME="' + name + '"')
|
||||
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
|
||||
max_num = 0
|
||||
exists = False
|
||||
for line in proc.stdout:
|
||||
m = pattern.search(line)
|
||||
if m:
|
||||
# User of the form `user` or `user#` exists
|
||||
exists = True
|
||||
max_num = max(max_num, m.group(1))
|
||||
if exists:
|
||||
return max_num
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def set_debconf_selection(debconf_type, key, value):
|
||||
found = False
|
||||
|
||||
10
deb.mk
10
deb.mk
@@ -1,6 +1,6 @@
|
||||
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
|
||||
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
|
||||
HEROKUISH_VERSION ?= 0.3.19
|
||||
HEROKUISH_VERSION ?= 0.3.24
|
||||
HEROKUISH_ARCHITECTURE = amd64
|
||||
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
|
||||
|
||||
@@ -128,14 +128,22 @@ deb-dokku:
|
||||
cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1
|
||||
gzip -9 /tmp/build/usr/share/man/man1/dokku.1
|
||||
cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
|
||||
ifeq ($(DOKKU_VERSION),master)
|
||||
git describe --tags > /tmp/build/var/lib/dokku/VERSION
|
||||
else
|
||||
echo $(DOKKU_VERSION) > /tmp/build/var/lib/dokku/VERSION
|
||||
endif
|
||||
cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
|
||||
ifneq (,$(findstring false,$(IS_RELEASE)))
|
||||
sed -i.bak -e "s/^/`date +%s`:/" /tmp/build/var/lib/dokku/STABLE_VERSION && rm /tmp/build/var/lib/dokku/STABLE_VERSION.bak
|
||||
endif
|
||||
rm /tmp/build/DEBIAN/lintian-overrides
|
||||
mv debian/lintian-overrides /tmp/build/usr/share/lintian/overrides/dokku
|
||||
ifdef DOKKU_GIT_REV
|
||||
echo "$(DOKKU_GIT_REV)" > /tmp/build/var/lib/dokku/GIT_REV
|
||||
else
|
||||
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
|
||||
endif
|
||||
sed -i "s/^Version: .*/Version: `cat /tmp/build/var/lib/dokku/STABLE_VERSION`/g" /tmp/build/DEBIAN/control
|
||||
dpkg-deb --build /tmp/build "/tmp/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
|
||||
lintian "/tmp/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@@ -1,5 +1,5 @@
|
||||
Package: dokku
|
||||
Version: 0.7.2
|
||||
Version: 0.8.0
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
|
||||
4
debian/postrm
vendored
4
debian/postrm
vendored
@@ -11,13 +11,13 @@ readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
|
||||
readonly DOKKU_LOGS_DIR="${DOKKU_LOGS_DIR:="/var/log/dokku"}"
|
||||
|
||||
main() {
|
||||
if [[ -f /etc/systemd/system/dokku-installer.conf ]] || [[ -f /etc/init/dokku-installer.conf ]]; then
|
||||
if [[ -f /etc/systemd/system/dokku-installer.service ]] || [[ -f /etc/init/dokku-installer.conf ]]; then
|
||||
service dokku-installer stop || true
|
||||
fi
|
||||
|
||||
rm -f /etc/init/dokku-installer.conf
|
||||
rm -f /etc/init/dokku-redeploy.conf
|
||||
rm -f /etc/systemd/system/dokku-installer.conf
|
||||
rm -f /etc/systemd/system/dokku-installer.service
|
||||
rm -f /etc/systemd/system/dokku-redeploy.service
|
||||
rm -f /etc/update-motd.d/99-dokku
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ Dokku accomplishes this by using an `app.json` file. The format in use is simila
|
||||
However, Dokku currently only supports the nodes `scripts.dokku.predeploy` and `scripts.dokku.postdeploy`.
|
||||
For buildpack apps, simply place an `app.json` file in the root of your repository.
|
||||
For dockerfile apps, place `app.json` in the configured `WORKDIR` directory; otherwise Dokku defaults to the buildpack app behavior of looking in `/app`.
|
||||
>NOTE: postdeploy changes are *NOT* committed to the app image.
|
||||
|
||||
> NOTE: postdeploy changes are *NOT* committed to the app image.
|
||||
|
||||
### Example app.json
|
||||
|
||||
|
||||
@@ -77,4 +77,4 @@ The above example will result in the following options being passed to Docker du
|
||||
|
||||
You may also include comments (lines beginning with a #) and blank lines in the DOCKER_OPTIONS file.
|
||||
|
||||
Move information on Docker options can be found here: http://docs.docker.io/en/latest/reference/run/ .
|
||||
More information on Docker options can be found here: https://docs.docker.com/engine/reference/commandline/run/.
|
||||
|
||||
@@ -25,6 +25,13 @@ dokku storage:mount app-name /var/lib/dokku/data/storage:/storage
|
||||
|
||||
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage` to `/storage` inside the container.
|
||||
|
||||
Once you have mounted persistent storage, you will also need to restart the application. See the
|
||||
[process scaling documentation](/dokku/deployment/process-management) for more information.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild app-name
|
||||
```
|
||||
|
||||
A more complete workflow may require making a custom directory for your application and mounting it within your `/app/storage` directory instead. The mount point is *not* relative to your application's working directory, and is instead relative to the root of the container.
|
||||
|
||||
```shell
|
||||
|
||||
@@ -31,30 +31,30 @@ dokku plugin
|
||||
|
||||
```
|
||||
plugn: dev
|
||||
00_dokku-standard 0.7.2 enabled dokku core standard plugin
|
||||
20_events 0.7.2 enabled dokku core events logging plugin
|
||||
apps 0.7.2 enabled dokku core apps plugin
|
||||
build-env 0.7.2 enabled dokku core build-env plugin
|
||||
certs 0.7.2 enabled dokku core certificate management plugin
|
||||
checks 0.7.2 enabled dokku core checks plugin
|
||||
common 0.7.2 enabled dokku core common plugin
|
||||
config 0.7.2 enabled dokku core config plugin
|
||||
docker-options 0.7.2 enabled dokku core docker-options plugin
|
||||
domains 0.7.2 enabled dokku core domains plugin
|
||||
enter 0.7.2 enabled dokku core enter plugin
|
||||
git 0.7.2 enabled dokku core git plugin
|
||||
logs 0.7.2 enabled dokku core logs plugin
|
||||
named-containers 0.7.2 enabled dokku core named containers plugin
|
||||
nginx-vhosts 0.7.2 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.7.2 enabled dokku core plugin plugin
|
||||
proxy 0.7.2 enabled dokku core proxy plugin
|
||||
ps 0.7.2 enabled dokku core ps plugin
|
||||
repo 0.7.2 enabled dokku core repo plugin
|
||||
shell 0.7.2 enabled dokku core shell plugin
|
||||
ssh-keys 0.7.2 enabled dokku core ssh-keys plugin
|
||||
storage 0.7.2 enabled dokku core storage plugin
|
||||
tags 0.7.2 enabled dokku core tags plugin
|
||||
tar 0.7.2 enabled dokku core tar plugin
|
||||
00_dokku-standard 0.8.0 enabled dokku core standard plugin
|
||||
20_events 0.8.0 enabled dokku core events logging plugin
|
||||
apps 0.8.0 enabled dokku core apps plugin
|
||||
build-env 0.8.0 enabled dokku core build-env plugin
|
||||
certs 0.8.0 enabled dokku core certificate management plugin
|
||||
checks 0.8.0 enabled dokku core checks plugin
|
||||
common 0.8.0 enabled dokku core common plugin
|
||||
config 0.8.0 enabled dokku core config plugin
|
||||
docker-options 0.8.0 enabled dokku core docker-options plugin
|
||||
domains 0.8.0 enabled dokku core domains plugin
|
||||
enter 0.8.0 enabled dokku core enter plugin
|
||||
git 0.8.0 enabled dokku core git plugin
|
||||
logs 0.8.0 enabled dokku core logs plugin
|
||||
named-containers 0.8.0 enabled dokku core named containers plugin
|
||||
nginx-vhosts 0.8.0 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.8.0 enabled dokku core plugin plugin
|
||||
proxy 0.8.0 enabled dokku core proxy plugin
|
||||
ps 0.8.0 enabled dokku core ps plugin
|
||||
repo 0.8.0 enabled dokku core repo plugin
|
||||
shell 0.8.0 enabled dokku core shell plugin
|
||||
ssh-keys 0.8.0 enabled dokku core ssh-keys plugin
|
||||
storage 0.8.0 enabled dokku core storage plugin
|
||||
tags 0.8.0 enabled dokku core tags plugin
|
||||
tar 0.8.0 enabled dokku core tar plugin
|
||||
```
|
||||
|
||||
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.
|
||||
@@ -72,17 +72,6 @@ Receiving objects: 100% (646/646), 134.24 KiB | 0 bytes/s, done.
|
||||
Resolving deltas: 100% (406/406), done.
|
||||
Checking connectivity... done.
|
||||
-----> Plugin postgres enabled
|
||||
-----> Migrating zero downtime env variables to 0.5.x. The following variables have been deprecated
|
||||
=====> DOKKU_SKIP_ALL_CHECKS DOKKU_SKIP_DEFAULT_CHECKS
|
||||
=====> Please use dokku checks:[disable|enable] <app> to control zero downtime functionality
|
||||
=====> Migration complete
|
||||
=====>
|
||||
-----> Migrating zero downtime env variables to 0.6.x. The following variables will be migrated
|
||||
=====> DOKKU_CHECKS_ENABLED -> DOKKU_CHECKS_SKIPPED
|
||||
=====> Migration complete
|
||||
=====>
|
||||
Adding user dokku to group adm
|
||||
Starting nginx (via systemctl): nginx.service.
|
||||
```
|
||||
|
||||
You can also uninstall a third-party plugin using the `plugin:uninstall` command:
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
|
||||
@@ -2,37 +2,37 @@
|
||||
"name": "Dokku",
|
||||
"icons": [
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.7.2\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.8.0\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.7.2\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.8.0\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.7.2\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.8.0\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.7.2\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.8.0\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.7.2\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.8.0\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.7.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.8.0\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
padding-bottom: 40px;
|
||||
color: #5a5a5a;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
@@ -21,7 +20,7 @@ h1 {
|
||||
.header .heading {
|
||||
color: #fff;
|
||||
font-size: 23px;
|
||||
margin: 0;
|
||||
margin: 7px 0 0 0;
|
||||
padding: 0 0 0 1em;
|
||||
}
|
||||
.header a {
|
||||
@@ -36,13 +35,13 @@ h1 {
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.header .navbar-brand a {
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/dokku.png);
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/dokku.png);
|
||||
text-indent: 40px;
|
||||
}
|
||||
.blurb {
|
||||
color: #424242;
|
||||
background-color: #ededed;
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/gplaypattern.png);
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/gplaypattern.png);
|
||||
padding: 45px 0;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -67,7 +66,6 @@ h1 {
|
||||
color: #444;
|
||||
display: block;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
margin: 0 20px;
|
||||
padding: 3px 0;
|
||||
text-align: center;
|
||||
@@ -246,7 +244,6 @@ a.list-group-item {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
box-sizing: border-box;
|
||||
color: rgb(71, 74, 84);
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
{ "max-versions": [ "0.3.26", "0.4.14", "0.5.8", "0.6.5", "0.7.2" ] }
|
||||
{
|
||||
"max-versions": [
|
||||
"0.3.26",
|
||||
"0.4.14",
|
||||
"0.5.8",
|
||||
"0.6.5",
|
||||
"0.7.2",
|
||||
"0.8.0"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
|
||||
[blag]: https://github.com/blag
|
||||
[cameron-martin]: https://github.com/cameron-martin
|
||||
[candlewaster]: https://notabug.org/candlewaster
|
||||
[cedricziel]: https://github.com/cedricziel
|
||||
[cef]: https://github.com/cef
|
||||
[cjblomqvist]: https://github.com/cjblomqvist
|
||||
@@ -68,6 +69,7 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
[cu12]: https://github.com/cu12
|
||||
[darkpixel]: https://github.com/darkpixel
|
||||
[dokku]: https://github.com/dokku
|
||||
[dokku-community]: https://github.com/dokku-community
|
||||
[dyson]: https://github.com/dyson
|
||||
[F4-Group]: https://github.com/F4-Group
|
||||
[fermuch]: https://github.com/fermuch
|
||||
@@ -118,6 +120,7 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
[thrashr888]: https://github.com/thrashr888
|
||||
[wmluke]: https://github.com/wmluke
|
||||
[Zenedith]: https://github.com/Zenedith
|
||||
[fteychene]: https://github.com/fteychene
|
||||
|
||||
### Datastores
|
||||
|
||||
@@ -161,7 +164,7 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
[c77cbf1]: https://github.com/dokku/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
|
||||
[28de3ec]: https://github.com/dokku/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
|
||||
|
||||
### Dokku Features
|
||||
### Plugins Implementing New Dokku Functionality
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
@@ -180,8 +183,10 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
| [Nuke Containers](https://github.com/josegonzalez/dokku-nuke) | [josegonzalez][] | 0.4.0+ |
|
||||
| [Open App Ports](https://github.com/josegonzalez/dokku-ports) | [josegonzalez][] | 0.3.x |
|
||||
| [Proctype Filter](https://github.com/michaelshobbs/dokku-proctype-filter) | [michaelshobbs][] | 0.4.0+ |
|
||||
| [robots.txt](https://notabug.org/candlewaster/dokku-robots.txt) | [candlewaster][] | 0.4.x |
|
||||
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>3</sup> | [cedricziel][] | 0.4.0+ |
|
||||
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>4</sup> | [cedricziel][] | 0.3.x |
|
||||
| [Application build hook](https://github.com/fteychene/dokku-build-hook) | [fteychene][] | 0.4.0+ |
|
||||
|
||||
[217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
|
||||
|
||||
@@ -216,10 +221,11 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
| [Rollbar](https://github.com/iloveitaly/dokku-rollbar) | [iloveitaly][] | 0.5.0+ |
|
||||
| [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ |
|
||||
| [Tor](https://github.com/michaelshobbs/dokku-tor) | [michaelshobbs][] | 0.4.0+ |
|
||||
| [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Łebkowski][] | 0.4.0+ |
|
||||
| [User ACL](https://github.com/dokku-community/dokku-acl) | [Maciej Łebkowski][] | 0.4.0+ |
|
||||
| [Webhooks](https://github.com/nickstenning/dokku-webhooks) | [nickstenning][] | 0.3.x |
|
||||
| [Wkhtmltopdf](https://github.com/mbriskar/dokku-wkhtmltopdf) | [mbriskar][] | 0.4.0+ |
|
||||
| [Wordpress Setup](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | |
|
||||
| [Dokku Wordpress](https://github.com/dokku-community/dokku-wordpress) | [dokku-community][] | 0.4.0+ |
|
||||
| [Access](https://github.com/mainto/dokku-access) | [mainto](https://github.com/mainto) | 0.4.0+ |
|
||||
|
||||
### Deprecated Plugins
|
||||
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
> New as of 0.3.10
|
||||
|
||||
```
|
||||
domains [<app>] # List domains
|
||||
domains:add <app> <domain> [<domain> ...] # Add domains to app
|
||||
domains:add-global <domain> [<domain> ...] # Add global domain names
|
||||
domains [<app>] # List domains
|
||||
domains:clear <app> # Clear all domains for app
|
||||
domains:disable <app> # Disable VHOST support
|
||||
domains:enable <app> # Enable VHOST support
|
||||
domains:remove <app> <domain> [<domain> ...] # Remove domains from app
|
||||
domains:remove-global <domain> [<domain> ...] # Remove global domain names
|
||||
domains:set <app> <domain> [<domain> ...] # Set domains for app
|
||||
domains:set-global <domain> [<domain> ...] # Set global domain names
|
||||
```
|
||||
|
||||
> Adding a domain before deploying an application will result in port mappings being set. This may cause issues for applications that use non-standard ports, as those will not be automatically detected. Please refer to the [proxy documentation](/dokku/advanced-usage/proxy-management/) for information as to how to reconfigure the mappings.
|
||||
@@ -68,11 +70,16 @@ dokku domains:clear myapp
|
||||
|
||||
# remove a custom domain from app
|
||||
dokku domains:remove myapp example.com
|
||||
|
||||
# set all custom domains for app
|
||||
dokku domains:set myapp example.com example.org
|
||||
```
|
||||
|
||||
## Default site
|
||||
|
||||
By default, Dokku will route any received request with an unknown HOST header value to the lexicographically first site in the nginx config stack. If this is not the desired behavior, you may want to add the following configuration to the global nginx configuration. This will catch all unknown HOST header values and return a `410 Gone` response. You can replace the `return 410;` with `return 444;` which will cause nginx to not respond to requests that do not match known domains (connection refused).
|
||||
By default, Dokku will route any received request with an unknown HOST header value to the lexicographically first site in the nginx config stack. If this is not the desired behavior, you may want to add the following configuration to the global nginx configuration.
|
||||
|
||||
Create the file at `/etc/nginx/conf.d/00-default-vhost.conf`:
|
||||
|
||||
```nginx
|
||||
server {
|
||||
@@ -85,17 +92,8 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
You may also wish to use a separate vhost in your `/etc/nginx/sites-enabled` directory. To do so, create the vhost in that directory as `/etc/nginx/sites-enabled/00-default.conf`. You will also need to change two lines in the main `nginx.conf`:
|
||||
This will catch all unknown HOST header values and return a `410 Gone` response. You can replace the `return 410;` with `return 444;` which will cause nginx to not respond to requests that do not match known domains (connection refused).
|
||||
|
||||
```nginx
|
||||
# Swap both conf.d include line and the sites-enabled include line. From:
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
|
||||
# to the following
|
||||
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
```
|
||||
The configuration file must be loaded before `/etc/nginx/conf.d/dokku.conf`, so it can not be arranged as a vhost in `/etc/nginx/sites-enabled` that is only processed afterwards.
|
||||
|
||||
Alternatively, you may push an app to your Dokku host with a name like "00-default". As long as it lists first in `ls /home/dokku/*/nginx.conf | head`, it will be used as the default nginx vhost.
|
||||
|
||||
@@ -29,8 +29,7 @@ The `certs:add` command can be used to push a `tar` containing a certificate `.c
|
||||
|
||||
```shell
|
||||
tar cvf cert-key.tar server.crt server.key
|
||||
# replace APP with the name of your application
|
||||
dokku certs:add <app> < cert-key.tar
|
||||
dokku certs:add node-js-app < cert-key.tar
|
||||
```
|
||||
|
||||
> Note: If your `.crt` file came alongside a `.ca-bundle`, you'll want to concatenate those into a single `.crt` file before adding it to the `.tar`.
|
||||
|
||||
@@ -101,6 +101,17 @@ If you only want to rebuild and tag a container, you can skip the deployment pha
|
||||
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
|
||||
```
|
||||
|
||||
### Re-Deploying / restarting
|
||||
|
||||
If you need to re-deploy (or restart) your app:
|
||||
|
||||
```shell
|
||||
# on your Dokku host
|
||||
dokku ps:rebuild ruby-rails-sample
|
||||
```
|
||||
|
||||
See the [process scaling documentation](/dokku/deployment/process-management) for more information.
|
||||
|
||||
### Deploying with private git submodules
|
||||
|
||||
Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
|
||||
|
||||
33
docs/deployment/logs.md
Normal file
33
docs/deployment/logs.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Log Management
|
||||
|
||||
```
|
||||
logs <app> # display recent log output
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Application Logs
|
||||
You can easily get logs of an application using the `logs` command:
|
||||
|
||||
```shell
|
||||
dokku logs node-js-app
|
||||
```
|
||||
|
||||
## Behavioral modifiers
|
||||
|
||||
Dokku also supports certain command-line arguments that augment the `log` command's behavior.
|
||||
|
||||
```
|
||||
-n, --num NUM # the number of lines to display
|
||||
-p, --ps PS # only display logs from the given process
|
||||
-t, --tail # continually stream logs
|
||||
-q, --quiet # display raw logs without colors, time and names
|
||||
```
|
||||
|
||||
You can use these modifiers as follows:
|
||||
|
||||
|
||||
```shell
|
||||
dokku logs node-js-app -t -p web
|
||||
```
|
||||
will show logs continually from the web process.
|
||||
@@ -14,12 +14,11 @@ In certain cases you may want to specify a custom buildpack. While Dokku uses he
|
||||
To use a specific buildpack, you can run the following Dokku command:
|
||||
|
||||
```shell
|
||||
# replace APP with the name of your application
|
||||
# replace REPOSITORY_URL with your buildpack's url
|
||||
dokku config:set APP BUILDPACK_URL=REPOSITORY_URL
|
||||
dokku config:set node-js-app BUILDPACK_URL=REPOSITORY_URL
|
||||
|
||||
# example: using a specific ruby buildpack version
|
||||
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v142
|
||||
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v142
|
||||
```
|
||||
|
||||
Please check the documentation for your particular buildpack as you may need to include configuration files (such as a Procfile) in your project root.
|
||||
@@ -45,16 +44,14 @@ As Dokku pins all buildpacks via herokuish releases, there may be occasions wher
|
||||
|
||||
```shell
|
||||
# using the latest nodejs buildpack
|
||||
# replace APP with the name of your application
|
||||
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs
|
||||
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs
|
||||
```
|
||||
|
||||
You may also wish to use a **specific** version of a buildpack, which is also simple
|
||||
|
||||
```shell
|
||||
# using v87 of the nodejs buildpack
|
||||
# replace APP with the name of your application
|
||||
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v87
|
||||
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v87
|
||||
```
|
||||
|
||||
## Specifying commands via Procfile
|
||||
|
||||
@@ -34,7 +34,7 @@ ENTRYPOINT ["node"]
|
||||
You can do:
|
||||
|
||||
```shell
|
||||
dokku config:set APP DOKKU_DOCKERFILE_START_CMD="--harmony server.js"
|
||||
dokku config:set node-js-app DOKKU_DOCKERFILE_START_CMD="--harmony server.js"
|
||||
```
|
||||
|
||||
To tell docker what to run.
|
||||
|
||||
@@ -29,7 +29,7 @@ dokku run my-app console
|
||||
If you want to remove the container after a command has started, you can run the following command:
|
||||
|
||||
```shell
|
||||
# keep `run` containers around
|
||||
# don't keep `run` containers around
|
||||
dokku config:set --global DOKKU_RM_CONTAINER=1
|
||||
|
||||
# revert the above setting and keep containers around
|
||||
|
||||
@@ -15,7 +15,7 @@ ps:restart-policy <app> # Shows the restart-policy for an
|
||||
ps:set-restart-policy <app> <policy> # Sets app restart-policy
|
||||
```
|
||||
|
||||
By default, Dokku will only start a single `web` process - if defined - though process scaling can be managed by the `ps` plugin or via a custom `DOKKU_SCALE` file.
|
||||
By default, Dokku will only start a single `web` process - if defined - though process scaling can be managed by the `ps` plugin or [via a custom `DOKKU_SCALE` file](/dokku/deployment/process-management/#manually-managing-process-scaling).
|
||||
|
||||
> The `web` proctype is the only proctype that will invoke custom checks as defined by a CHECKS file. It is also the only process type that will be launched in a container that is either proxied via nginx or bound to an external port.
|
||||
|
||||
@@ -178,7 +178,7 @@ Restart policies have no bearing on server reboot, and Dokku will always attempt
|
||||
|
||||
## Manually managing process scaling
|
||||
|
||||
You can optionally create a `DOKKU_SCALE` file in the root of your repository. Dokku expects this file to contain one line for every process defined in your Procfile.
|
||||
You can optionally _commit_ a `DOKKU_SCALE` file to the root of your repository - *not* to the /home/dokku/APP directory. Dokku expects this file to contain one line for every process defined in your Procfile.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -187,4 +187,6 @@ web=1
|
||||
worker=2
|
||||
```
|
||||
|
||||
If it is not committed to the repository, the `DOKKU_SCALE` file will otherwise be automatically generated based on your `ps:scale` settings.
|
||||
|
||||
> *NOTE*: Dokku will always use the DOKKU_SCALE file that ships with the repo to override any local settings.
|
||||
|
||||
@@ -12,7 +12,7 @@ When pushing to Dokku, ssh key based authorization is the preferred authenticati
|
||||
|
||||
Users in Dokku are managed via the `~/dokku/.ssh/authorized_keys` file. It is **highly** recommended that you follow the steps below to manage users on a Dokku server.
|
||||
|
||||
> Users of older versions of Dokku should use the `sshcommand` binary to manage keys. Please refer to the Dokku documentation for your version for more details.
|
||||
> Users of older versions of Dokku may use the `sshcommand` binary to manage keys instead of the `ssh-keys` plugin. Please refer to the Dokku documentation for your version for more details.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -10,18 +10,32 @@ checks:run <app> [process-type(s)] Runs zero-downtime checks for all proce
|
||||
checks:skip <app> [process-type(s)] Skip zero-downtime checks for all processes (or comma-separated process-type list)
|
||||
```
|
||||
|
||||
Following a deploy, Dokku will wait `10` seconds before routing traffic to the new container to give your application time to boot up. If the application is not running after this time, then the deploy is failed and your old container will continue serving traffic. You can modify this value globally or on a per-application basis:
|
||||
|
||||
```shell
|
||||
dokku config:set --global DOKKU_DEFAULT_CHECKS_WAIT=30
|
||||
dokku config:set node-js-app DOKKU_DEFAULT_CHECKS_WAIT=30
|
||||
```
|
||||
|
||||
You can also choose to skip checks or disable zero-downtime completely on a per-application/per-process basis
|
||||
|
||||
> Note that `checks:disable` will now (as of 0.6.0) cause downtime for that process-type during deployments.
|
||||
By default, Dokku will wait `10` seconds after starting each container before assuming it is up and proceeding with the deploy. Once this has occurred for all containers started by for an application, traffic will be switched to point to your new containers. Dokku will also wait a further `60` seconds _after_ the deploy is complete before terminating old containers in order to give time for long running connections to terminate. In either case, you may have more than one container running for a given application.
|
||||
|
||||
You may both create user-defined checks for web processes using a `CHECKS` file, as well as customize any and all parts of this experience using the checks plugin.
|
||||
|
||||
## Configuring Check Settings using the `config` plugin
|
||||
|
||||
There are certain settings that can be configured via environment variables:
|
||||
|
||||
- `DOKKU_DEFAULT_CHECKS_WAIT`: (default: `10`) If no user-defined checks are specified - or if the process being checked is not a `web` process - this is the period of time Dokku will wait before checking that a container is still running.
|
||||
- `DOKKU_DOCKER_STOP_TIMEOUT`: (default: `10`) Configurable grace period given to the `docker stop` command. If a container has not stopped by this time, a `kill -9` signal or equivalent is sent in order to force-terminate the container. Both the `ps:stop` and `apps:destroy` commands _also_ respect this value. If not specified, the docker defaults for the [docker stop command](https://docs.docker.com/engine/reference/commandline/stop/) will be used.
|
||||
- `DOKKU_WAIT_TO_RETIRE`: (default: `60`) After a successful deploy, the grace period given to old containers before they are stopped/terminated. This is useful for ensuring completion of long-running http connections.
|
||||
|
||||
The following settings may also be specified in the `CHECKS` file, though are available as environment variables in order to ease application reuse.
|
||||
|
||||
- `DOKKU_CHECKS_WAIT`: (default: `5`) Wait this many seconds for the container to start before running checks.
|
||||
- `DOKKU_CHECKS_TIMEOUT`: (default: `30`) Wait this many seconds for each response before marking it as a failure.
|
||||
- `DOKKU_CHECKS_ATTEMPTS`: (default: `5`) Number of retries for to run for a specific check before marking it as a failure
|
||||
|
||||
## Skipping and Disabling Checks
|
||||
|
||||
> Note that `checks:disable` will now (as of 0.6.0) cause downtime for that process-type during deployments. Previously, it acted as `checks:skip` currently does.
|
||||
|
||||
You can choose to skip checks completely on a per-application/per-process basis. Skipping checks will avoid the default 10 second waiting period entirely, as well as any other user-defined checks.
|
||||
|
||||
```shell
|
||||
# process type specification is optional
|
||||
dokku checks:skip node-js-app worker,web
|
||||
```
|
||||
|
||||
@@ -33,8 +47,7 @@ dokku checks:skip node-js-app worker,web
|
||||
DOKKU_CHECKS_SKIPPED: worker,web
|
||||
```
|
||||
|
||||
Additionally, any given process can only be configured to disable zero-downtime. example:
|
||||
|
||||
Zero-downtime checks can also be disabled completely. This will stop old containers **before** new ones start, which may result in broken connections and downtime if your application fails to boot properly.
|
||||
|
||||
```shell
|
||||
dokku checks:disable node-js-app worker
|
||||
@@ -48,14 +61,67 @@ dokku checks:disable node-js-app worker
|
||||
DOKKU_CHECKS_SKIPPED: web
|
||||
```
|
||||
|
||||
Dokku will wait `60` seconds before stopping the old container so that existing connections are given a chance to complete. You can modify this value globally or on a per-application basis:
|
||||
## Customizing Checks
|
||||
|
||||
```shell
|
||||
dokku config:set --global DOKKU_WAIT_TO_RETIRE=120
|
||||
dokku config:set <app> DOKKU_WAIT_TO_RETIRE=120
|
||||
If your application needs a longer period to boot up - perhaps to load data into memory, or because of slow boot time - you may also use dokku's `checks` functionality to more precisely check whether an application can serve traffic or not.
|
||||
|
||||
Checks are run against the detected `web` process from your application's `Procfile`. For non-web processes, Dokku will fallback to the aforementioned process uptime check.
|
||||
|
||||
To specify checks, add a `CHECKS` file to the root of your project directory. The `CHECKS` file should be plain text and may contain:
|
||||
|
||||
- Check instructions
|
||||
- Settings (NAME=VALUE)
|
||||
- Comments (lines starting with #)
|
||||
- Empty lines
|
||||
|
||||
> For dockerfile-based deploys, the file *must* be in `/app/CHECKS` within the container. `/app` is used by default as the root container directory for buildpack-based deploys.
|
||||
|
||||
### Check Instructions
|
||||
|
||||
The format of a check instruction is a path or relative URL, optionally followed by the expected content:
|
||||
|
||||
```
|
||||
/about Our Amazing Team
|
||||
```
|
||||
|
||||
> Note that during this time, multiple containers may be running on your server, which can be an issue for memory-hungry applications on memory-constrained servers.
|
||||
The `CHECKS` file can contain multiple checks:
|
||||
|
||||
```
|
||||
/ My Amazing App
|
||||
/stylesheets/index.css .body
|
||||
/scripts/index.js $(function()
|
||||
/images/logo.png
|
||||
```
|
||||
|
||||
To check an application that supports multiple hostnames, use relative URLs that include the hostname:
|
||||
|
||||
```
|
||||
//admin.example.com Admin Dashboard
|
||||
//static.example.com/logo.png
|
||||
```
|
||||
|
||||
You can also specify the protocol to explicitly check HTTPS requests:
|
||||
|
||||
```
|
||||
https://admin.example.com Admin Dashboard
|
||||
https://static.example.com/logo.png
|
||||
```
|
||||
|
||||
While a full url may be used in order to invoke checks, if you are using relative urls, the port *must* be omitted.
|
||||
|
||||
### Check Settings
|
||||
|
||||
The default behavior is to wait for `5` seconds before running the checks, to timeout the checks after `30` seconds, and to attempt the checks `5` times. If the checks fail `5` times, the deployment is considered failed and the old container will continue serving traffic.
|
||||
|
||||
You can change the default behavior by setting `WAIT`, `TIMEOUT`, and `ATTEMPTS` to different values in the `CHECKS` file:
|
||||
|
||||
```
|
||||
WAIT=30 # Wait 1/2 minute
|
||||
TIMEOUT=60 # Timeout after a minute
|
||||
ATTEMPTS=10 # Attempt checks 10 times
|
||||
|
||||
/ My Amazing App
|
||||
```
|
||||
|
||||
## Manually Invoking Checks
|
||||
|
||||
@@ -92,7 +158,7 @@ dokku checks:run APP
|
||||
Checks can be scoped to a particular process type:
|
||||
|
||||
```shell
|
||||
dokku checks:run APP worker
|
||||
dokku checks:run node-js-app worker
|
||||
```
|
||||
|
||||
```
|
||||
@@ -108,7 +174,7 @@ dokku checks:run APP worker
|
||||
An app process id may also be specified:
|
||||
|
||||
```shell
|
||||
dokku checks:run APP web.2
|
||||
dokku checks:run node-js-app web.2
|
||||
```
|
||||
|
||||
```
|
||||
@@ -124,7 +190,7 @@ dokku checks:run APP web.2
|
||||
Non-existent process types will result in an error:
|
||||
|
||||
```shell
|
||||
dokku checks:run APP non-existent
|
||||
dokku checks:run node-js-app non-existent
|
||||
```
|
||||
|
||||
```
|
||||
@@ -135,7 +201,7 @@ Invalid process type specified (APP.non-existent)
|
||||
Non-existent process ids will *also* result in an error
|
||||
|
||||
```shell
|
||||
dokku checks:run APP web.3
|
||||
dokku checks:run node-js-app web.3
|
||||
```
|
||||
|
||||
```
|
||||
@@ -143,88 +209,6 @@ dokku checks:run APP web.3
|
||||
Invalid container id specified (APP.web.3)
|
||||
```
|
||||
|
||||
## Customizing Checks
|
||||
|
||||
If your application needs a longer period to boot up - perhaps to load data into memory, or because of slow boot time - you may also use dokku's `checks` functionality to more precisely check whether an application can serve traffic or not.
|
||||
|
||||
Checks are run against the detected `web` process from your application's `Procfile`. For non-web processes, Dokku will fallback to the aforementioned process uptime check.
|
||||
|
||||
To specify checks, add a `CHECKS` file to the root of your project directory. The `CHECKS` file should be plain text and may contain:
|
||||
|
||||
* Check instructions
|
||||
* Settings (NAME=VALUE)
|
||||
* Comments (lines starting with #)
|
||||
* Empty lines
|
||||
|
||||
> For dockerfile-based deploys, the file *must* be in `/app/CHECKS` within the container. `/app` is used by default as the root container directory for buildpack-based deploys.
|
||||
|
||||
### Check Instructions
|
||||
|
||||
The format of a check instruction is a path or relative URL, optionally followed by the expected content:
|
||||
|
||||
```
|
||||
/about Our Amazing Team
|
||||
```
|
||||
|
||||
The `CHECKS` file can contain multiple checks:
|
||||
|
||||
```
|
||||
/ My Amazing App
|
||||
/stylesheets/index.css .body
|
||||
/scripts/index.js $(function()
|
||||
/images/logo.png
|
||||
```
|
||||
|
||||
To check an application that supports multiple hostnames, use relative URLs that include the hostname:
|
||||
|
||||
```
|
||||
//admin.example.com Admin Dashboard
|
||||
//static.example.com/logo.png
|
||||
```
|
||||
|
||||
You can also specify the protocol to explicitly check HTTPS requests:
|
||||
|
||||
```
|
||||
https://admin.example.com Admin Dashboard
|
||||
https://static.example.com/logo.png
|
||||
```
|
||||
|
||||
### Check Settings
|
||||
|
||||
The default behavior is to wait for `5` seconds before running the checks, to timeout the checks after `30` seconds, and to attempt the checks `5` times. If the checks fail `5` times, the deployment is considered failed and the old container will continue serving traffic.
|
||||
|
||||
You can change the default behavior by setting `WAIT`, `TIMEOUT`, and `ATTEMPTS` to different values in the `CHECKS` file:
|
||||
|
||||
```
|
||||
WAIT=30 # Wait 1/2 minute
|
||||
TIMEOUT=60 # Timeout after a minute
|
||||
ATTEMPTS=10 # Attempt checks 10 times
|
||||
|
||||
/ My Amazing App
|
||||
```
|
||||
|
||||
You can also override the default `WAIT`, `TIMEOUT`, and `ATTEMPTS` variables for the global Dokku installation:
|
||||
|
||||
```shell
|
||||
dokku config:set --global DOKKU_CHECKS_WAIT=30
|
||||
dokku config:set --global DOKKU_CHECKS_TIMEOUT=60
|
||||
dokku config:set --global DOKKU_CHECKS_ATTEMPTS=10
|
||||
```
|
||||
|
||||
If your application runs multiple processes (a background worker configured in your `Procfile`, for example) and you have checks to ensure that your web application has booted up, you may want to disable the default check wait time for that application to avoid the `10` second wait per non-web process:
|
||||
|
||||
```shell
|
||||
dokku config:set <app> DOKKU_DEFAULT_CHECKS_WAIT=0
|
||||
```
|
||||
|
||||
### Configuring docker stop timeout
|
||||
|
||||
[By default](https://docs.docker.com/engine/reference/commandline/stop/), docker will wait 10 seconds from the time the `stop` command is passed to a container before it attempts to kill said container. This timeout can be configured on a per-app basis in Dokku by setting the `DOKKU_DOCKER_STOP_TIMEOUT` configuration variable. This timeout applies to normal zero-downtime deployments as well as the `ps:stop` and `apps:destroy` commands.
|
||||
|
||||
```shell
|
||||
dokku config:set $APP DOKKU_DOCKER_STOP_TIMEOUT=20
|
||||
```
|
||||
|
||||
## Example: Successful Rails Deployment
|
||||
|
||||
In this example, a Rails application is successfully deployed to dokku. The initial round of checks fails while the server is starting, but once it starts they succeed and the deployment is successful. `WAIT` is set to `10` because our application takes a while to boot up. `ATTEMPTS` is set to `6`, but the third attempt succeeds.
|
||||
|
||||
@@ -150,8 +150,8 @@ A few notes:
|
||||
- As some plugins require access to set app config settings and do not want/require the default Heroku-style behavior of a restart, we have the following "internal" commands that provide this functionality :
|
||||
|
||||
```shell
|
||||
dokku config:set --no-restart APP KEY1=VALUE1 [KEY2=VALUE2 ...]
|
||||
dokku config:unset --no-restart APP KEY1 [KEY2 ...]
|
||||
dokku config:set --no-restart node-js-app KEY1=VALUE1 [KEY2=VALUE2 ...]
|
||||
dokku config:unset --no-restart node-js-app KEY1 [KEY2 ...]
|
||||
```
|
||||
- From time to time you may want to allow other plugins access to (some of) your plugin's functionality. You can expose this by including a `functions` file in your plugin for others to source. Consider all functions in that file to be publicly accessible by other plugins. Any functions not wished to be made "public" should reside within your plugin trigger or commands files.
|
||||
- As of 0.4.0, we allow image tagging and deployment of said tagged images. Therefore, hard-coding of `$IMAGE` as `dokku/$APP` is no longer sufficient. Instead, for non `pre/post-build-*` plugins, use `get_running_image_tag()` & `get_app_image_name()` as sourced from common/functions. See the [plugin triggers](/dokku/development/plugin-triggers) doc for examples.
|
||||
|
||||
@@ -27,7 +27,7 @@ There are a number of plugin-related triggers. These can be optionally implement
|
||||
|
||||
The following plugin triggers describe those available to a Dokku installation. As well, there is an example for each trigger that you can use as templates for your own plugin development.
|
||||
|
||||
> The example plugin trigger code is not guaranteed to be implemented as in within dokkku, and are merely simplified examples. Please look at the Dokku source for larger, more in-depth examples.
|
||||
> The example plugin trigger code is not guaranteed to be implemented as in within dokku, and are merely simplified examples. Please look at the Dokku source for larger, more in-depth examples.
|
||||
|
||||
### `post-config-update`
|
||||
|
||||
@@ -134,6 +134,24 @@ help_content
|
||||
esac
|
||||
```
|
||||
|
||||
### `core-post-deploy`
|
||||
|
||||
> To avoid issues with community plugins, this plugin trigger should be used *only* for core plugins. Please avoid using this trigger in your own plugins.
|
||||
|
||||
- Description: Allows running of commands after an application's processes have been scaled up, but before old containers are torn down. Dokku core currently uses this to switch traffic on nginx.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Notify an external service that a successful deploy has occurred.
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
curl "http://httpstat.us/200"
|
||||
```
|
||||
|
||||
### `dependencies`
|
||||
|
||||
- Description: Used to install system-level dependencies. Invoked by `plugin:install-dependencies`.
|
||||
@@ -430,7 +448,9 @@ dokku postgres:destroy $APP
|
||||
|
||||
### `post-deploy`
|
||||
|
||||
- Description: Allows running of commands after an application's processes have been scaled up, but before old containers are torn down. Dokku core currently uses this to switch traffic on nginx.
|
||||
> Please see [core-post-deploy](#core-post-deploy) if contributing a core plugin with the `post-deploy` hook.
|
||||
|
||||
- Description: Allows running of commands after an application's processes have been scaled up, but before old containers are torn down. Dokku calls this _after_ `core-post-deploy`. Deployment Tasks are also invoked by this plugin trigger.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS $IMAGE_TAG`
|
||||
- Example:
|
||||
@@ -447,7 +467,7 @@ curl "http://httpstat.us/200"
|
||||
### `post-domains-update`
|
||||
|
||||
- Description: Allows you to run commands once the domain for an application has been updated. It also sends in the command that has been used. This can be "add", "clear" or "remove". The third argument will be the optional list of domains
|
||||
- Invoked by: `dokku domains:add`, `dokku domains:clear`, `dokku domains:remove`
|
||||
- Invoked by: `dokku domains:add`, `dokku domains:clear`, `dokku domains:remove`, `dokku domains:set`
|
||||
- Arguments: `$APP` `action name` `domains`
|
||||
- Example:
|
||||
|
||||
@@ -846,6 +866,26 @@ APP="$1"; IMAGE_TAG="$2"
|
||||
some code to remove a docker hub tag because it's not implemented in the CLI....
|
||||
```
|
||||
|
||||
### `uninstall`
|
||||
|
||||
- Description: Used to cleanup after itself.
|
||||
- Invoked by: `dokku plugin:uninstall`
|
||||
- Arguments: `$PLUGIN`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Cleanup up extra containers created
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
PLUGIN="$1"
|
||||
|
||||
[[ "$PLUGIN" = "my-plugin" ]] && docker rmi -f "${PLUGIN_IMAGE_DEPENDENCY}"
|
||||
```
|
||||
|
||||
> To avoid uninstalling other plugins make sure to check the plugin name like shown in the example.
|
||||
|
||||
### `update`
|
||||
|
||||
- Description: Can be used to run plugin updates on a regular interval. You can schedule the invoker in a cron-task to ensure your system gets regular updates.
|
||||
|
||||
@@ -20,7 +20,7 @@ To propose a release, the following tasks need to be performed:
|
||||
- The versioned links should be updated or added to the `docs/assets/versions.json` file.
|
||||
- A list of changes must be made in the `HISTORY.md`.
|
||||
- A tag must be created locally with your release version
|
||||
- Debian packages *must* be created via `vagrant up build`
|
||||
- Debian and RPM packages *must* be created via `vagrant up build`
|
||||
- The packages should be uploaded to packagecloud.io
|
||||
- All changes are pushed to master and the tag should be turned into a release which will contain the changelog.
|
||||
- ArchLinux package description *must* be updated via `vagrant up build-arch` (needs to be done after the tag is pushed to GitHub, because it is based on that)
|
||||
@@ -37,9 +37,9 @@ git tag v0.9.9
|
||||
|
||||
At the moment, tags need not be signed, though that may change in the future.
|
||||
|
||||
## Debian Packages
|
||||
## Debian and RPM packages
|
||||
|
||||
The `build` target in the Dokku `Vagrantfile` creates debian packages for Dokku at a point in time. The version will be based upon the latest local tag - you may create your own, internal tags/releases if that is so desired.
|
||||
The `build` target in the Dokku `Vagrantfile` creates debian and rpm packages for Dokku at a point in time. The version will be based upon the latest local tag - you may create your own, internal tags/releases if that is so desired.
|
||||
|
||||
Debian package information is held in the `debian` directory of the Dokku project.
|
||||
|
||||
@@ -51,6 +51,7 @@ git tag v0.9.9
|
||||
vagrant up build
|
||||
export PACKAGECLOUD_TOKEN=SOME_TOKEN
|
||||
package_cloud push dokku/dokku/ubuntu/trusty dokku_0.9.9_amd64.deb
|
||||
package_cloud push dokku/dokku/el/7 dokku-0.9.9-1.x86_64.rpm
|
||||
```
|
||||
|
||||
If new versions of other packages were created, these should also be pushed at this time.
|
||||
@@ -66,7 +67,7 @@ The workflow looks like this:
|
||||
```shell
|
||||
# having dokku-arch in ../dokku-arch
|
||||
vagrant up build-arch
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.7.2-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.8.0-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
cd ../dokku-arch
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m 'Update to dokku 0.9.9'
|
||||
|
||||
@@ -4,7 +4,7 @@ You can always install Dokku straight from the latest - potentially unstable - m
|
||||
|
||||
```shell
|
||||
# using a branch results in installing from source
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh;
|
||||
sudo DOKKU_BRANCH=master bash bootstrap.sh
|
||||
```
|
||||
|
||||
@@ -29,7 +29,7 @@ sudo SSHCOMMAND_URL=https://raw.githubusercontent.com/yourusername/sshcommand/ma
|
||||
The bootstrap script allows the Dokku repository URL to be overridden to bootstrap a host from your own clone of Dokku using the `DOKKU_REPO` environment variable. Example:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh;
|
||||
chmod +x bootstrap.sh
|
||||
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
|
||||
```
|
||||
|
||||
@@ -5,3 +5,7 @@ On Digital Ocean, there is a pre-made image that can be run for Dokku. You can c
|
||||
When choosing your Droplet configuration, please disable IPv6 on the droplet. There are known issues with IPv6 on Digital Ocean and Docker, and many have been reported to the Dokku issue tracker.
|
||||
|
||||
If you would like to run Dokku on an IPv6 Digital Ocean Droplet, please consult [this guide](https://jeffloughridge.wordpress.com/2015/01/17/native-ipv6-functionality-in-docker/) for modifying Docker to run under the Digital Ocean IPv6 configuration.
|
||||
|
||||
Once Dokku is installed, you can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||
|
||||
If you wish for a more unattended installation method, see [these](http://dokku.viewdocs.io/dokku/getting-started/install/debian/#unattended-installation) docs.
|
||||
|
||||
@@ -4,7 +4,7 @@ Cloud-init script can be used to automate installation of Dokku on
|
||||
Dreamhost (or any other OpenStack-compatible cloud with minimal
|
||||
changes).
|
||||
|
||||
A new server can be created on DreamHost Cloud from the command line
|
||||
A new server instance can be created on DreamHost Cloud from the command line
|
||||
using openstack client or from the web UI and with the same command
|
||||
use a cloud-init script to install Dokku. Install the [openstack
|
||||
cli](https://help.dreamhost.com/hc/en-us/articles/216185658-How-to-Install-the-OpenStack-command-line-clients),
|
||||
@@ -18,18 +18,18 @@ source openrc.sh # Set the environment variables for DreamHost Cloud
|
||||
```
|
||||
|
||||
This allows openstack client to connect to DreamHost API endpoints.
|
||||
The command below creates a new server named `my-dokku-instance` based
|
||||
on Ubuntu 14.04, with 2GB RAM and 1CPU (the flavor called
|
||||
`semisonic`), opening network port access to http and ssh (the
|
||||
The command below creates a new server instance named `my-dokku-instance`
|
||||
based on Ubuntu 14.04, with 2GB RAM and 1CPU (the flavor called
|
||||
`supersonic`), opening network port access to http and ssh (the
|
||||
`default` security group), and the name of the chosen SSH key. This
|
||||
key will be automatically added to the new server in the
|
||||
`authorized_keys` for the default SSH user (`dhc-user`), and it will
|
||||
`authorized_keys` for the default SSH user (`ubuntu`), and it will
|
||||
be reused by Dokku.
|
||||
|
||||
```sh
|
||||
openstack server create \
|
||||
--image Ubuntu-14.04 \
|
||||
--flavor gp1.semisonic \
|
||||
--flavor gp1.supersonic \
|
||||
--security-group default \
|
||||
--key-name $YOUR_SSH_KEYNAME \
|
||||
--user-data dokku-cloudinit.sh \
|
||||
@@ -178,8 +178,20 @@ debconf_selections: |
|
||||
# set the domain name of the new Dokku server
|
||||
dokku dokku/hostname string $YOUR_FULL_QUALIFIED_DOMAIN
|
||||
# this copies over the public SSH key assigned to the server
|
||||
dokku dokku/key_file string /home/dhc-user/.ssh/authorized_keys
|
||||
dokku dokku/key_file string /home/ubuntu/.ssh/authorized_keys
|
||||
|
||||
packages:
|
||||
- dokku
|
||||
```
|
||||
|
||||
Shortly after running the create command you will get a confirmation that the
|
||||
instance has been created, and after about a minute it should be ready to login.
|
||||
Check the IP of the instance through the web UI or by running:
|
||||
|
||||
```sh
|
||||
nova list
|
||||
```
|
||||
|
||||
SSH with the `ubuntu` username and the public key previously added.
|
||||
Keep in mind that if you logged in quick enough dokku might still be installing
|
||||
in the background, and not be ready. The installation takes a few minutes.
|
||||
|
||||
18
docs/getting-started/install/rpm.md
Normal file
18
docs/getting-started/install/rpm.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# RPM Package Installation Notes
|
||||
|
||||
> New as of 0.8.0
|
||||
|
||||
Dokku defaults to being installed via RPM package on CentOS 7. 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
|
||||
# install docker
|
||||
curl -fsSL https://get.docker.com/ | sh
|
||||
|
||||
# install epel for nginx packages to be available
|
||||
sudo yum install -y epel-release
|
||||
|
||||
# install dokku
|
||||
curl -s https://packagecloud.io/install/repositories/dokku/dokku/script.rpm.sh | sudo bash
|
||||
sudo yum install -y herokuish dokku
|
||||
sudo dokku plugin:install-dependencies --core
|
||||
```
|
||||
@@ -21,8 +21,8 @@ To install the latest stable version of dokku, you can run the following shell c
|
||||
|
||||
```shell
|
||||
# for debian systems, installs Dokku via apt-get
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.7.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.7.2 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.8.0/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.8.0 bash bootstrap.sh
|
||||
```
|
||||
|
||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||
@@ -31,7 +31,7 @@ The installation process takes about 5-10 minutes, depending upon internet conne
|
||||
|
||||
Once the installation is complete, you can open a browser to setup your SSH key and virtualhost settings. Open your browser of choice and navigate to the host's IP address - or the domain you assigned to that IP previously - and configure Dokku via the web admin.
|
||||
|
||||
*If you don't complete setup via the web installer (even if you set up SSH keys and virtual hosts otherwise) your Dokku installation will remain vulnerable to anyone finding the setup page and inserting their key.*
|
||||
>**Warning:** If you don't complete setup via the web installer (even if you set up SSH keys and virtual hosts otherwise) your Dokku installation will remain vulnerable to anyone finding the setup page and inserting their key.
|
||||
|
||||
#### 3. Deploy your first application
|
||||
Once you save your settings, the web admin will self-terminate and you should be able to run or deploy to the Dokku installation.
|
||||
@@ -48,6 +48,7 @@ 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](/dokku/getting-started/install/debian/)
|
||||
- [RPM Package Installation Notes](/dokku/getting-started/install/rpm/)
|
||||
- [Vagrant Installation Notes](/dokku/getting-started/install/vagrant/)
|
||||
- [Advanced Install Customization](/dokku/getting-started/advanced-installation/)
|
||||
|
||||
|
||||
@@ -154,3 +154,42 @@ dokku config:set --global CURL_CONNECT_TIMEOUT=30
|
||||
```
|
||||
|
||||
Please see https://github.com/dokku/dokku/issues/509
|
||||
|
||||
***
|
||||
|
||||
__Symptom:__ Build fails with `Killed` message.
|
||||
|
||||
__Solution:__
|
||||
|
||||
This generally occurs when the server runs out of memory. You can either add more ram to your server or setup swap space. The follow script will create 2gb of swap space.
|
||||
|
||||
```shell
|
||||
sudo install -o root -g root -m 0600 /dev/null /swapfile
|
||||
dd if=/dev/zero of=/swapfile bs=1k count=2048k
|
||||
mkswap /swapfile
|
||||
swapon /swapfile
|
||||
echo "/swapfile swap swap auto 0 0" | sudo tee -a /etc/fstab
|
||||
sudo sysctl -w vm.swappiness=10
|
||||
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
__Symptom:__ I successfully deployed my application with no deployment errors but I'm receiving Connection Timeout when attempting to access the application.
|
||||
|
||||
__Solution:__
|
||||
|
||||
This can occur if Dokku is running on a system with a firewall like ufw enabled (some OS versions like Ubuntu 16.04 have this enabled by default). You can check if this is your case by running the following script:
|
||||
|
||||
```shell
|
||||
sudo ufw status
|
||||
```
|
||||
|
||||
If the previous script returned `Status: active` and a list of ports, ufw is enabled and is probably the cause of the symptom described above. To disable it, run:
|
||||
|
||||
```shell
|
||||
sudo ufw disable
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ If Dokku was installed via `apt-get install dokku` or `bootstrap.sh` (most commo
|
||||
```shell
|
||||
sudo apt-get update
|
||||
dokku apps
|
||||
dokku ps:stop <app> # repeat to shut down each running app
|
||||
sudo apt-get install -qq -y dokku herokuish
|
||||
dokku ps:stop APP # repeat to shut down each running app
|
||||
sudo apt-get install -qq -y dokku herokuish sshcommand plugn
|
||||
dokku ps:rebuildall # rebuilds all applications
|
||||
```
|
||||
|
||||
@@ -46,7 +46,7 @@ If you installed Dokku from source (less common), upgrade with:
|
||||
|
||||
```shell
|
||||
dokku apps
|
||||
dokku ps:stop <app> # repeat to shut down each running app
|
||||
dokku ps:stop APP # repeat to shut down each running app
|
||||
cd ~/dokku
|
||||
git pull --tags origin master
|
||||
|
||||
|
||||
@@ -7,33 +7,33 @@
|
||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400.7.2" rel="stylesheet" type="text/css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400.8.0" rel="stylesheet" type="text/css">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<style>
|
||||
</style>
|
||||
@@ -98,12 +98,12 @@
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.7.2/bootstrap.sh</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.8.0/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.7.2 bash bootstrap.sh</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.8.0 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||
|
||||
@@ -10,26 +10,26 @@
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400:sans-serif|Open+Sans:400:sans-serif" rel="stylesheet" type="text/css">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<script>
|
||||
@@ -43,7 +43,7 @@
|
||||
</script>
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<style>
|
||||
@@ -198,6 +198,7 @@
|
||||
|
||||
<a href="/{{NAME}}/deployment/application-deployment/" class="list-group-item">Deploying an Application</a>
|
||||
<a href="/{{NAME}}/deployment/application-management/" class="list-group-item">Application Management</a>
|
||||
<a href="/{{NAME}}/deployment/logs/" class="list-group-item">Application Logs</a>
|
||||
<a href="/{{NAME}}/deployment/remote-commands/" class="list-group-item">Remote Commands</a>
|
||||
<a href="/{{NAME}}/deployment/one-off-processes/" class="list-group-item">One Off Processes/Cron</a>
|
||||
<a href="/{{NAME}}/deployment/process-management/" class="list-group-item">Process Scaling</a>
|
||||
|
||||
14
dokku
14
dokku
@@ -7,17 +7,9 @@ export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
|
||||
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source "$f"; done
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
case "$(lsb_release -si)" in
|
||||
Arch)
|
||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="arch"}
|
||||
;;
|
||||
Debian)
|
||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="debian"}
|
||||
;;
|
||||
*)
|
||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
|
||||
;;
|
||||
esac
|
||||
export DOKKU_DISTRO
|
||||
# shellcheck disable=SC1091
|
||||
DOKKU_DISTRO=$(. /etc/os-release > /dev/null 2>&1 || true ; echo "$ID")
|
||||
|
||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
|
||||
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
||||
|
||||
23
plugins/00_dokku-standard/core-post-deploy
Executable file
23
plugins/00_dokku-standard/core-post-deploy
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
cleanup_container_state() {
|
||||
declare desc="core post-deploy state cleanup"
|
||||
local trigger="core-post-deploy cleanup_container_state"
|
||||
local APP="$1"; local PROCTYPES="$(egrep -v "^#" "$DOKKU_ROOT/$APP/DOKKU_SCALE" | awk -F '=' '{ print $1 }' | xargs)"
|
||||
local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 3 -n | xargs)"
|
||||
|
||||
local CONTAINER_FILE
|
||||
for CONTAINER_FILE in $CONTAINER_FILES; do
|
||||
local CONTAINER_TYPE="$(awk -F '.' '{ print $2 }' <<< "$CONTAINER_FILE")"
|
||||
if [[ "$(is_val_in_list "$CONTAINER_TYPE" "$PROCTYPES" " ")" == "false" ]]; then
|
||||
dokku_log_info1 "Container type ($CONTAINER_TYPE) is no longer defined. Removing state"
|
||||
local IP_FILE="${CONTAINER_FILE//CONTAINER/IP}"
|
||||
local PORT_FILE="${CONTAINER_FILE//CONTAINER/PORT}"
|
||||
rm -f "$DOKKU_ROOT/$APP/$CONTAINER_FILE" "$DOKKU_ROOT/$APP/$IP_FILE" "$DOKKU_ROOT/$APP/$PORT_FILE"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
cleanup_container_state "$@"
|
||||
@@ -42,7 +42,7 @@ execute_script() {
|
||||
COMMAND+=" rm -rf /tmp/cache ; "
|
||||
COMMAND+=" ln -sf /cache /tmp/cache ; "
|
||||
COMMAND+=" fi ; "
|
||||
COMMAND+=" $SCRIPT_CMD ;"
|
||||
COMMAND+=" $SCRIPT_CMD || exit 1;"
|
||||
COMMAND+=" if [[ -d '/cache' ]]; then "
|
||||
COMMAND+=" echo removing installation cache... ; "
|
||||
COMMAND+=" rm -f /tmp/cache ; "
|
||||
|
||||
@@ -30,7 +30,8 @@ if [[ $(systemctl 2> /dev/null) =~ -\.mount ]]; then
|
||||
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
|
||||
[Unit]
|
||||
Description=Dokku app redeploy service
|
||||
After=docker.target
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -5,30 +5,11 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
|
||||
|
||||
exec_app_json_scripts() {
|
||||
declare desc="core app.json scripts execution"
|
||||
local trigger="pre-deploy app_json_scripts"
|
||||
local trigger="post-deploy app_json_scripts"
|
||||
local APP="$1"; local IMAGE_TAG="$4"; local PHASE_SCRIPT_KEY="postdeploy"
|
||||
|
||||
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
||||
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
|
||||
}
|
||||
|
||||
cleanup_container_state() {
|
||||
declare desc="core post-deploy state cleanup"
|
||||
local trigger="post-deploy cleanup_container_state"
|
||||
local APP="$1"; local PROCTYPES="$(egrep -v "^#" "$DOKKU_ROOT/$APP/DOKKU_SCALE" | awk -F '=' '{ print $1 }' | xargs)"
|
||||
local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 3 -n | xargs)"
|
||||
|
||||
local CONTAINER_FILE
|
||||
for CONTAINER_FILE in $CONTAINER_FILES; do
|
||||
local CONTAINER_TYPE="$(awk -F '.' '{ print $2 }' <<< "$CONTAINER_FILE")"
|
||||
if [[ "$(is_val_in_list "$CONTAINER_TYPE" "$PROCTYPES" " ")" == "false" ]]; then
|
||||
dokku_log_info1 "Container type ($CONTAINER_TYPE) is no longer defined. Removing state"
|
||||
local IP_FILE="${CONTAINER_FILE//CONTAINER/IP}"
|
||||
local PORT_FILE="${CONTAINER_FILE//CONTAINER/PORT}"
|
||||
rm -f "$DOKKU_ROOT/$APP/$CONTAINER_FILE" "$DOKKU_ROOT/$APP/$IP_FILE" "$DOKKU_ROOT/$APP/$PORT_FILE"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
exec_app_json_scripts "$@"
|
||||
cleanup_container_state "$@"
|
||||
|
||||
1
plugins/20_events/core-post-deploy
Symbolic link
1
plugins/20_events/core-post-deploy
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
@@ -12,7 +12,7 @@ flag_rsyslog_needs_restart=n
|
||||
# exits gracefully if the path already exists
|
||||
mkdir -m 775 -p "$DOKKU_LOGS_DIR"
|
||||
case "$DOKKU_DISTRO" in
|
||||
arch|debian)
|
||||
arch|debian|centos)
|
||||
chgrp dokku "$DOKKU_LOGS_DIR"
|
||||
;;
|
||||
*)
|
||||
@@ -23,7 +23,7 @@ esac
|
||||
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
|
||||
touch "$DOKKU_EVENTS_LOGFILE"
|
||||
case "$DOKKU_DISTRO" in
|
||||
arch|debian)
|
||||
arch|debian|centos)
|
||||
chgrp dokku "$DOKKU_EVENTS_LOGFILE"
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core apps plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -13,11 +13,11 @@ apps_rename_cmd() {
|
||||
local NEW_APP="$3"
|
||||
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$NEW_APP"
|
||||
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR"; then
|
||||
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
||||
fi
|
||||
rm -rf "$OLD_CACHE_DIR"
|
||||
apps_create "$NEW_APP"
|
||||
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
|
||||
DOKKU_APPS_FORCE_DELETE=1 apps_destroy "$OLD_APP"
|
||||
[[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core build-env plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -26,6 +26,6 @@ get_ssl_hostnames() {
|
||||
else
|
||||
local SSL_HOSTNAMES=$SSL_HOSTNAME
|
||||
fi
|
||||
echo -e "$SSL_HOSTNAMES"
|
||||
echo -e "$SSL_HOSTNAMES" | sort -u
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core certificate management plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core checks plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -554,6 +554,8 @@ dokku_deploy_cmd() {
|
||||
dokku_log_info2 "stopping $APP.$PROC_TYPE ($cid)"
|
||||
# shellcheck disable=SC2086
|
||||
docker stop $DOCKER_STOP_TIME_ARG "$cid" &> /dev/null
|
||||
# remove cid from oldids to skip the old container finish processing
|
||||
oldids="$(remove_val_from_list "$cid" "$oldids" " ")"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -651,6 +653,7 @@ dokku_deploy_cmd() {
|
||||
done < "$DOKKU_SCALE_FILE"
|
||||
|
||||
dokku_log_info1 "Running post-deploy"
|
||||
plugn trigger core-post-deploy "$APP" "$port" "$ipaddr" "$IMAGE_TAG"
|
||||
plugn trigger post-deploy "$APP" "$port" "$ipaddr" "$IMAGE_TAG"
|
||||
|
||||
# kill the old container
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core common plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -150,7 +150,7 @@ config_get() {
|
||||
|
||||
config_create "$ENV_FILE"
|
||||
if [[ ! -s $ENV_FILE ]]; then
|
||||
return 0
|
||||
return 1
|
||||
fi
|
||||
|
||||
local KEY="${*: -1}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core config plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core docker-options plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -15,6 +15,8 @@ case "$1" in
|
||||
domains:enable <app>, Enable VHOST support
|
||||
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
||||
domains:remove-global <domain> [<domain> ...], Remove global domain names
|
||||
domains:set <app> <domain> [<domain> ...], Set domains for app
|
||||
domains:set-global <domain> [<domain> ...], Set global domain names
|
||||
help_content
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ domains_add() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]];then
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
|
||||
domains_enable "$APP" --no-restart
|
||||
fi
|
||||
|
||||
@@ -105,12 +105,34 @@ domains_remove() {
|
||||
plugn trigger post-domains-update "$APP" "remove" "$@"
|
||||
}
|
||||
|
||||
domains_set() {
|
||||
declare desc="set list of domains for app"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
shift 1
|
||||
for DOMAIN in "$@"; do
|
||||
if ! (is_valid_hostname "$DOMAIN"); then
|
||||
dokku_log_fail "$DOMAIN is invalid. exiting..."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$*" | tr " " "\n" > "$APP_VHOST_PATH"
|
||||
dokku_log_info1 "Set $* for $APP"
|
||||
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
|
||||
domains_enable "$APP" --no-restart
|
||||
fi
|
||||
|
||||
plugn trigger post-domains-update "$APP" "set" "$@"
|
||||
}
|
||||
|
||||
domains_disable() {
|
||||
declare desc="disable domains/VHOST support"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "true" ]];then
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "true" ]]; then
|
||||
disable_app_vhost "$APP"
|
||||
else
|
||||
dokku_log_info1 "domains (VHOST) support is already disabled for app ($APP)"
|
||||
@@ -123,7 +145,7 @@ domains_enable() {
|
||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local DEFAULT_VHOSTS="$(get_default_vhosts "$APP")"
|
||||
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]];then
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
|
||||
if [[ -n "$DEFAULT_VHOSTS" ]]; then
|
||||
echo "$DEFAULT_VHOSTS" > "$APP_VHOST_PATH"
|
||||
fi
|
||||
@@ -148,7 +170,7 @@ domains_add_global() {
|
||||
if [[ $(egrep -w "^$DOMAIN$" "$GLOBAL_VHOST_PATH" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
|
||||
dokku_log_info1 "Skipping: $DOMAIN already added"
|
||||
else
|
||||
echo "$DOMAIN" >> "$GLOBAL_VHOST_PATH"
|
||||
sed -i -e "\$a\\$DOMAIN" "$GLOBAL_VHOST_PATH"
|
||||
dokku_log_info1 "Added $DOMAIN"
|
||||
fi
|
||||
done
|
||||
@@ -163,3 +185,17 @@ domains_remove_global() {
|
||||
dokku_log_info1 "Removed $DOMAIN"
|
||||
done
|
||||
}
|
||||
|
||||
domains_set_global() {
|
||||
declare desc="set list of global domains"
|
||||
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||
|
||||
for DOMAIN in "$@"; do
|
||||
if ! (is_valid_hostname "$DOMAIN"); then
|
||||
dokku_log_fail "$DOMAIN is invalid. exiting..."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$*" | tr " " "\n" > "$GLOBAL_VHOST_PATH"
|
||||
dokku_log_info1 "Set $*"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core domains plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
16
plugins/domains/subcommands/set
Executable file
16
plugins/domains/subcommands/set
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||
|
||||
domains_set_cmd() {
|
||||
declare desc="set domains for app via command line"
|
||||
local cmd="domains:set"
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z $3 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 <domain> [<domain> ...]"
|
||||
|
||||
shift 1
|
||||
domains_set "$@"
|
||||
}
|
||||
|
||||
domains_set_cmd "$@"
|
||||
15
plugins/domains/subcommands/set-global
Executable file
15
plugins/domains/subcommands/set-global
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||
|
||||
domains_set_global_cmd() {
|
||||
declare desc="set global domain names via command line"
|
||||
local cmd="domains:set-global"
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 <domain> [<domain> ...]"
|
||||
|
||||
shift 1
|
||||
domains_set_global "$@"
|
||||
}
|
||||
|
||||
domains_set_global_cmd "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core enter plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core git plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core logs plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
named_containers_post_deploy() {
|
||||
named_containers_core_post_deploy() {
|
||||
declare desc="names deployed app container is consistent manner"
|
||||
local trigger="named_containers_post_deploy"
|
||||
local trigger="named_containers_core_post_deploy"
|
||||
local APP="$1"; local APP_ROOT="$DOKKU_ROOT/$APP"
|
||||
local container
|
||||
|
||||
@@ -38,4 +38,4 @@ named_containers_post_deploy() {
|
||||
shopt -u nullglob
|
||||
}
|
||||
|
||||
named_containers_post_deploy "$@"
|
||||
named_containers_core_post_deploy "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core named containers plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -5,9 +5,9 @@ source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||
|
||||
nginx_post_deploy() {
|
||||
declare desc="nginx-vhosts post-deploy plugin trigger"
|
||||
local trigger="nginx_post_deploy"
|
||||
nginx_core_post_deploy() {
|
||||
declare desc="nginx-vhosts core-post-deploy plugin trigger"
|
||||
local trigger="nginx_core_post_deploy"
|
||||
local APP="$1"
|
||||
if [[ -f "$DOKKU_ROOT/$APP/IP.web.1" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT.web.1" ]]; then
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
|
||||
@@ -21,5 +21,5 @@ nginx_post_deploy() {
|
||||
}
|
||||
|
||||
if [[ "$(get_app_proxy_type "$1")" == "nginx" ]]; then
|
||||
nginx_post_deploy "$@"
|
||||
nginx_core_post_deploy "$@"
|
||||
fi
|
||||
@@ -39,9 +39,9 @@ restart_nginx() {
|
||||
sudo /sbin/service nginx reload > /dev/null
|
||||
;;
|
||||
|
||||
arch)
|
||||
arch|centos)
|
||||
sudo /usr/bin/systemctl reload nginx
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ get_custom_nginx_template() {
|
||||
}
|
||||
|
||||
is_spdy_enabled() {
|
||||
declare desc="detects whether the installed nginx version has spdy or http2 support"
|
||||
declare desc="detects whether the installed nginx version has spdy support"
|
||||
local NGINX_VERSION="$1"
|
||||
local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
|
||||
local HAS_SUPPORT=true
|
||||
@@ -174,6 +174,33 @@ is_spdy_enabled() {
|
||||
echo $HAS_SUPPORT
|
||||
}
|
||||
|
||||
is_http2_enabled() {
|
||||
declare desc="detects whether the installed nginx version has http2 support"
|
||||
local NGINX_VERSION="$1"
|
||||
local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
|
||||
local HAS_SUPPORT=false
|
||||
|
||||
if ! which nginx > /dev/null 2>&1; then
|
||||
echo $HAS_SUPPORT
|
||||
return
|
||||
fi
|
||||
|
||||
MAJOR_VERSION=$(echo "$NGINX_VERSION" | awk '{split($0,a,"."); print a[1]}')
|
||||
MINOR_VERSION=$(echo "$NGINX_VERSION" | awk '{split($0,a,"."); print a[2]}')
|
||||
PATCH_VERSION=$(echo "$NGINX_VERSION" | awk '{split($0,a,"."); print a[3]}')
|
||||
if [[ "$MAJOR_VERSION" -ge "2" ]]; then
|
||||
HAS_SUPPORT=true
|
||||
elif [[ "$MAJOR_VERSION" -eq "1" ]]; then
|
||||
if [[ "$MINOR_VERSION" -eq "11" ]] && [[ "$PATCH_VERSION" -ge "5" ]]; then
|
||||
HAS_SUPPORT=true
|
||||
elif [[ "$MINOR_VERSION" -ge "12" ]]; then
|
||||
HAS_SUPPORT=true
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $HAS_SUPPORT
|
||||
}
|
||||
|
||||
nginx_build_config() {
|
||||
declare desc="build nginx config to proxy app containers using sigil"
|
||||
local APP="$1"; verify_app_name "$APP"
|
||||
@@ -250,6 +277,7 @@ nginx_build_config() {
|
||||
|
||||
local NGINX_VERSION="$(nginx -v 2>&1 | cut -d'/' -f 2)"
|
||||
local SPDY_SUPPORTED="$(is_spdy_enabled "$NGINX_VERSION")"
|
||||
local HTTP2_SUPPORTED="$(is_http2_enabled "$NGINX_VERSION")"
|
||||
|
||||
eval "$(config_export app "$APP")"
|
||||
local SIGIL_PARAMS=(-f $NGINX_TEMPLATE APP="$APP" DOKKU_ROOT="$DOKKU_ROOT"
|
||||
@@ -257,6 +285,7 @@ nginx_build_config() {
|
||||
DOKKU_APP_LISTENERS="$DOKKU_APP_LISTENERS"
|
||||
PASSED_LISTEN_IP_PORT="$PASSED_LISTEN_IP_PORT"
|
||||
SPDY_SUPPORTED="$SPDY_SUPPORTED"
|
||||
HTTP2_SUPPORTED="$HTTP2_SUPPORTED"
|
||||
DOKKU_APP_LISTEN_PORT="$DOKKU_APP_LISTEN_PORT" DOKKU_APP_LISTEN_IP="$DOKKU_APP_LISTEN_IP"
|
||||
APP_SSL_PATH="$APP_SSL_PATH" SSL_INUSE="$SSL_INUSE" SSL_SERVER_NAME="$SSL_SERVER_NAME"
|
||||
NGINX_PORT="$NGINX_PORT" NGINX_SSL_PORT="$NGINX_SSL_PORT" RAW_TCP_PORTS="$RAW_TCP_PORTS"
|
||||
|
||||
@@ -17,6 +17,11 @@ case "$DOKKU_DISTRO" in
|
||||
arch)
|
||||
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload nginx, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
|
||||
;;
|
||||
|
||||
centos)
|
||||
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload nginx, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
|
||||
echo "Defaults:dokku !requiretty" >> /etc/sudoers.d/dokku-nginx
|
||||
;;
|
||||
esac
|
||||
|
||||
chmod 0440 /etc/sudoers.d/dokku-nginx
|
||||
@@ -66,10 +71,8 @@ case "$DOKKU_DISTRO" in
|
||||
"$NGINX_INIT" nginx start || "$NGINX_INIT" nginx reload
|
||||
;;
|
||||
|
||||
arch)
|
||||
arch|centos)
|
||||
NGINX_INIT="/usr/bin/systemctl"
|
||||
"$NGINX_INIT" start nginx || "$NGINX_INIT" reload nginx
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core nginx-vhosts plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -38,8 +38,8 @@ server {
|
||||
}
|
||||
{{ else if eq $scheme "https"}}
|
||||
server {
|
||||
listen [::]:{{ $listen_port }} ssl {{ if eq $.SPDY_SUPPORTED "true" }}spdy{{ else }}http2{{ end }};
|
||||
listen {{ $listen_port }} ssl {{ if eq $.SPDY_SUPPORTED "true" }}spdy{{ else }}http2{{ end }};
|
||||
listen [::]:{{ $listen_port }} ssl {{ if eq $.SPDY_SUPPORTED "true" }}spdy{{ else if eq $.HTTP2_SUPPORTED "true" }}http2{{ end }};
|
||||
listen {{ $listen_port }} ssl {{ if eq $.SPDY_SUPPORTED "true" }}spdy{{ else if eq $.HTTP2_SUPPORTED "true" }}http2{{ end }};
|
||||
{{ if $.SSL_SERVER_NAME }}server_name {{ $.SSL_SERVER_NAME }}; {{ end }}
|
||||
{{ if $.NOSSL_SERVER_NAME }}server_name {{ $.NOSSL_SERVER_NAME }}; {{ end }}
|
||||
access_log /var/log/nginx/{{ $.APP }}-access.log;
|
||||
|
||||
@@ -70,6 +70,7 @@ uninstall_plugin() {
|
||||
local PLUGIN="$1"
|
||||
[[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot uninstall a core plugin"
|
||||
[[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed"
|
||||
plugn trigger uninstall "$PLUGIN"
|
||||
plugn uninstall "$PLUGIN"
|
||||
dokku_log_info1_quiet "Plugin $PLUGIN uninstalled"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core plugin plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core proxy plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -6,13 +6,14 @@ source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||
proxy_main_cmd() {
|
||||
declare desc="displays app proxy implementation via command line"
|
||||
local cmd="proxy"
|
||||
local ALL_APPS=$(dokku_apps)
|
||||
if [[ -n "$2" ]]; then
|
||||
local APP="$2"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
local APPS=$(dokku_apps)
|
||||
if [[ -n "$1" ]]; then
|
||||
local APPS="$1"
|
||||
fi
|
||||
local APPS=${APP:="$ALL_APPS"}
|
||||
|
||||
dokku_col_log_info1_quiet "App Name" "Proxy Type"
|
||||
local app
|
||||
for app in $APPS; do
|
||||
verify_app_name "$app"
|
||||
dokku_col_log_msg "$app" "$(get_app_proxy_type "$app")"
|
||||
|
||||
@@ -4,13 +4,13 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
ps_post_deploy() {
|
||||
declare desc="ps post-deploy plugin trigger"
|
||||
local trigger="ps_post_deploy"
|
||||
ps_core_post_deploy() {
|
||||
declare desc="ps core-post-deploy plugin trigger"
|
||||
local trigger="ps_core_post_deploy"
|
||||
local APP="$1"
|
||||
|
||||
remove_procfile "$APP"
|
||||
config_set --no-restart "$APP" DOKKU_APP_RESTORE=1
|
||||
}
|
||||
|
||||
ps_post_deploy "$@"
|
||||
ps_core_post_deploy "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core ps plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core repo plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core shell plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -5,10 +5,19 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
verify_ssh_key_file() {
|
||||
declare desc="Test that public key is valid"
|
||||
[[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found."
|
||||
ssh-keygen -l -f "${DOKKU_ROOT}/.ssh/authorized_keys" &> /dev/null || dokku_log_fail "${DOKKU_ROOT}/.ssh/authorized_keys failed ssh-keygen check."
|
||||
local key line=0
|
||||
while read key ; do
|
||||
line=$((line + 1))
|
||||
ssh-keygen -l -f /dev/stdin <<< "$key" &> /dev/null || dokku_log_fail "${DOKKU_ROOT}/.ssh/authorized_keys line $line failed ssh-keygen check."
|
||||
done <"${DOKKU_ROOT}/.ssh/authorized_keys"
|
||||
}
|
||||
|
||||
verify_ssh_key_exists() {
|
||||
declare desc="Test that public key exists"
|
||||
[[ -e ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found."
|
||||
}
|
||||
|
||||
create_ssh_key_file() {
|
||||
declare desc="Ensure the public key file exists"
|
||||
touch "${DOKKU_ROOT}/.ssh/authorized_keys"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core ssh-keys plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -14,10 +14,15 @@ add_keys() {
|
||||
key_contents="$key_from_pipe"
|
||||
elif [[ -n "$key_file" ]]; then
|
||||
key_contents="$(cat "$key_file")"
|
||||
ssh-keygen -lf /dev/stdin <<< "$key_contents" &> /dev/null || dokku_log_fail "Key from file is not a valid ssh public key"
|
||||
fi
|
||||
[[ -n "$name" && -n "$key_contents" ]] || dokku_log_fail "Two arguments are required if not piping, ie: dokku ssh-keys:add <NAME> <KEY_FILE>"
|
||||
local count="$(wc -l <<< "$key_contents")"
|
||||
[ "$count" -eq 1 ] || dokku_log_fail 'Too many keys provided, set one per invocation of dokku ssh-keys:add <NAME> <KEY_FILE>'
|
||||
create_ssh_key_file
|
||||
verify_ssh_key_exists
|
||||
echo "$key_contents" | sshcommand acl-add dokku "$name" || dokku_log_fail "sshcommand returned an error: $?"
|
||||
verify_ssh_key_file
|
||||
}
|
||||
|
||||
add_keys "$@"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core storage plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -9,7 +9,9 @@ is_tag_force_available() {
|
||||
PATCH_VERSION=$(echo "$CLIENT_VERSION_STRING" | awk '{split($0,a,"."); print a[3]}')
|
||||
|
||||
# docker tag -f was dropped in 1.12.0
|
||||
if [[ "$MAJOR_VERSION" -ge 1 ]] && [[ "$MINOR_VERSION" -ge 12 ]]; then
|
||||
if [[ "$MAJOR_VERSION" -gt 1 ]]; then
|
||||
return 1
|
||||
elif [[ "$MAJOR_VERSION" -eq 1 ]] && [[ "$MINOR_VERSION" -ge 12 ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core tags plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
@@ -24,7 +24,7 @@ tar_build() {
|
||||
tar -x -C "$TAR_BUILD_TMP_WORK_DIR" -f "$DOKKU_ROOT/$APP/src.tar" --strip-components="$BOGUS_PARTS"
|
||||
chmod -R u+r "$TAR_BUILD_TMP_WORK_DIR"
|
||||
|
||||
if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then
|
||||
if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]] && [[ -z $(config_get "$APP" BUILDPACK_URL || true) ]]; then
|
||||
plugn trigger pre-receive-app "$APP" "dockerfile" "$TAR_BUILD_TMP_WORK_DIR"
|
||||
dokku_receive "$APP" "dockerfile" "$TAR_BUILD_TMP_WORK_DIR" | sed -u "s/^/"$'\e[1G'"/"
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core tar plugin"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
[plugin.config]
|
||||
|
||||
178
rpm.mk
Normal file
178
rpm.mk
Normal file
@@ -0,0 +1,178 @@
|
||||
RPM_ARCHITECTURE = x86_64
|
||||
HEROKUISH_RPM_PACKAGE_NAME = herokuish-$(HEROKUISH_VERSION)-1.$(RPM_ARCHITECTURE).rpm
|
||||
PLUGN_RPM_PACKAGE_NAME = plugn-$(PLUGN_VERSION)-1.$(RPM_ARCHITECTURE).rpm
|
||||
SSHCOMMAND_RPM_PACKAGE_NAME = sshcommand-$(SSHCOMMAND_VERSION)-1.$(RPM_ARCHITECTURE).rpm
|
||||
SIGIL_RPM_PACKAGE_NAME = gliderlabs-sigil-$(SIGIL_VERSION)-1.$(RPM_ARCHITECTURE).rpm
|
||||
|
||||
.PHONY: rpm-all
|
||||
|
||||
rpm-all: rpm-setup rpm-herokuish rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil
|
||||
mv /tmp/*.rpm .
|
||||
@echo "Done"
|
||||
|
||||
rpm-setup:
|
||||
@echo "-> Installing rpm build requirements"
|
||||
@sudo apt-get update -qq > /dev/null
|
||||
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 rpm > /dev/null 2>&1
|
||||
@command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
@ssh -o StrictHostKeyChecking=no git@github.com || true
|
||||
|
||||
rpm-herokuish:
|
||||
rm -rf /tmp/tmp /tmp/build $(HEROKUISH_RPM_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build
|
||||
|
||||
@echo "-> Cloning repository"
|
||||
git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" \
|
||||
--branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null
|
||||
rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore
|
||||
|
||||
@echo "-> Copying files into place"
|
||||
mkdir -p "/tmp/build/var/lib"
|
||||
cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish
|
||||
|
||||
@echo "-> Creating $(HEROKUISH_RPM_PACKAGE_NAME)"
|
||||
sudo fpm -t rpm -s dir -C /tmp/build -n herokuish \
|
||||
-v $(HEROKUISH_VERSION) \
|
||||
-a $(RPM_ARCHITECTURE) \
|
||||
-p $(HEROKUISH_RPM_PACKAGE_NAME) \
|
||||
--depends 'docker-engine >= 1.9.1' \
|
||||
--depends 'sudo' \
|
||||
--after-install rpm/herokuish.postinst \
|
||||
--url "https://github.com/$(HEROKUISH_REPO_NAME)" \
|
||||
--description $(HEROKUISH_DESCRIPTION) \
|
||||
--license 'MIT License' \
|
||||
.
|
||||
mv *.rpm /tmp
|
||||
|
||||
rpm-dokku:
|
||||
rm -rf /tmp/tmp /tmp/build dokku_*_$(RPM_ARCHITECTURE).rpm
|
||||
mkdir -p /tmp/tmp /tmp/build
|
||||
|
||||
mkdir -p /tmp/build/usr/bin
|
||||
mkdir -p /tmp/build/usr/share/doc/dokku
|
||||
mkdir -p /tmp/build/usr/share/dokku/contrib
|
||||
mkdir -p /tmp/build/usr/share/lintian/overrides
|
||||
mkdir -p /tmp/build/usr/share/man/man1
|
||||
mkdir -p /tmp/build/var/lib/dokku/core-plugins/available
|
||||
|
||||
cp dokku /tmp/build/usr/bin
|
||||
cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
|
||||
find . -name ".DS_Store" -depth -exec rm {} \;
|
||||
cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available
|
||||
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done
|
||||
$(MAKE) help2man
|
||||
$(MAKE) addman
|
||||
cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1
|
||||
gzip -9 /tmp/build/usr/share/man/man1/dokku.1
|
||||
cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
|
||||
ifeq ($(DOKKU_VERSION),master)
|
||||
git describe --tags > /tmp/build/var/lib/dokku/VERSION
|
||||
else
|
||||
echo $(DOKKU_VERSION) > /tmp/build/var/lib/dokku/VERSION
|
||||
endif
|
||||
cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
|
||||
ifneq (,$(findstring false,$(IS_RELEASE)))
|
||||
sed -i.bak -e "s/^/`date +%s`-/" /tmp/build/var/lib/dokku/STABLE_VERSION && rm /tmp/build/var/lib/dokku/STABLE_VERSION.bak
|
||||
endif
|
||||
ifdef DOKKU_GIT_REV
|
||||
echo "$(DOKKU_GIT_REV)" > /tmp/build/var/lib/dokku/GIT_REV
|
||||
else
|
||||
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
|
||||
endif
|
||||
|
||||
@echo "-> Creating rpm package"
|
||||
VERSION=$$(cat /tmp/build/var/lib/dokku/STABLE_VERSION); \
|
||||
sudo fpm -t rpm -s dir -C /tmp/build -n dokku \
|
||||
-v "$$VERSION" \
|
||||
-a $(RPM_ARCHITECTURE) \
|
||||
-p "dokku-$$VERSION-1.x86_64.rpm" \
|
||||
--depends 'git' \
|
||||
--depends 'make' \
|
||||
--depends 'curl' \
|
||||
--depends 'gcc' \
|
||||
--depends 'man-db' \
|
||||
--depends 'sshcommand' \
|
||||
--depends 'gliderlabs-sigil' \
|
||||
--depends 'docker-engine >= 1.9.1' \
|
||||
--depends 'bind-utils' \
|
||||
--depends 'nginx' \
|
||||
--depends 'plugn' \
|
||||
--depends 'sudo' \
|
||||
--depends 'python' \
|
||||
--depends 'nc' \
|
||||
--after-install rpm/dokku.postinst \
|
||||
--url "https://github.com/$(DOKKU_REPO_NAME)" \
|
||||
--description $(DOKKU_DESCRIPTION) \
|
||||
--license 'MIT License' \
|
||||
.
|
||||
mv *.rpm /tmp
|
||||
|
||||
rpm-plugn:
|
||||
rm -rf /tmp/tmp /tmp/build $(PLUGN_RPM_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
|
||||
|
||||
@echo "-> Downloading package"
|
||||
wget -q -O /tmp/tmp/plugn-$(PLUGN_VERSION).tgz $(PLUGN_URL)
|
||||
cd /tmp/tmp/ && tar zxf /tmp/tmp/plugn-$(PLUGN_VERSION).tgz
|
||||
|
||||
@echo "-> Copying files into place"
|
||||
cp /tmp/tmp/plugn /tmp/build/usr/bin/plugn && chmod +x /tmp/build/usr/bin/plugn
|
||||
|
||||
@echo "-> Creating $(PLUGN_RPM_PACKAGE_NAME)"
|
||||
sudo fpm -t rpm -s dir -C /tmp/build -n plugn \
|
||||
--version $(PLUGN_VERSION) \
|
||||
-a $(RPM_ARCHITECTURE) \
|
||||
--package $(PLUGN_RPM_PACKAGE_NAME) \
|
||||
--url "https://github.com/$(PLUGN_REPO_NAME)" \
|
||||
--category utils \
|
||||
--description "$$PLUGN_DESCRIPTION" \
|
||||
--license 'MIT License' \
|
||||
.
|
||||
mv *.rpm /tmp
|
||||
|
||||
rpm-sshcommand:
|
||||
rm -rf /tmp/tmp /tmp/build $(SSHCOMMAND_RPM_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
|
||||
|
||||
@echo "-> Downloading package"
|
||||
wget -q -O /tmp/tmp/sshcommand-$(SSHCOMMAND_VERSION) $(SSHCOMMAND_URL)
|
||||
|
||||
@echo "-> Copying files into place"
|
||||
mkdir -p "/tmp/build/usr/bin"
|
||||
cp /tmp/tmp/sshcommand-$(SSHCOMMAND_VERSION) /tmp/build/usr/bin/sshcommand
|
||||
chmod +x /tmp/build/usr/bin/sshcommand
|
||||
|
||||
@echo "-> Creating $(SSHCOMMAND_RPM_PACKAGE_NAME)"
|
||||
sudo fpm -t rpm -s dir -C /tmp/build -n sshcommand \
|
||||
--version $(SSHCOMMAND_VERSION) \
|
||||
-a $(RPM_ARCHITECTURE) \
|
||||
--package $(SSHCOMMAND_RPM_PACKAGE_NAME) \
|
||||
--url "https://github.com/$(SSHCOMMAND_REPO_NAME)" \
|
||||
--category admin \
|
||||
--description "$$SSHCOMMAND_DESCRIPTION" \
|
||||
--license 'MIT License' \
|
||||
.
|
||||
mv *.rpm /tmp
|
||||
|
||||
rpm-sigil:
|
||||
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
|
||||
|
||||
@echo "-> Downloading package"
|
||||
wget -q -O /tmp/tmp/sigil-$(SIGIL_VERSION).tgz $(SIGIL_URL)
|
||||
cd /tmp/tmp/ && tar zxf /tmp/tmp/sigil-$(SIGIL_VERSION).tgz
|
||||
|
||||
@echo "-> Copying files into place"
|
||||
cp /tmp/tmp/sigil /tmp/build/usr/bin/sigil && chmod +x /tmp/build/usr/bin/sigil
|
||||
|
||||
@echo "-> Creating $(SIGIL_RPM_PACKAGE_NAME)"
|
||||
sudo fpm -t rpm -s dir -C /tmp/build -n gliderlabs-sigil \
|
||||
--version $(SIGIL_VERSION) \
|
||||
-a $(RPM_ARCHITECTURE) \
|
||||
--package $(SIGIL_RPM_PACKAGE_NAME) \
|
||||
--url "https://github.com/$(SIGIL_REPO_NAME)" \
|
||||
--category utils \
|
||||
--description "$$SIGIL_DESCRIPTION" \
|
||||
--license 'MIT License' \
|
||||
.
|
||||
mv *.rpm /tmp
|
||||
63
rpm/dokku.postinst
Normal file
63
rpm/dokku.postinst
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
set +o posix # rpm uses /bin/sh that forces bash in posix mode
|
||||
set -eo pipefail; [[ $TRACE ]] && set -x
|
||||
|
||||
setup-user() {
|
||||
echo "Setting up dokku user"
|
||||
getent passwd dokku >/dev/null || useradd -m -s /bin/bash dokku
|
||||
mkdir -p "$DOKKU_ROOT/.ssh"
|
||||
touch "$DOKKU_ROOT/.ssh/authorized_keys"
|
||||
chown -R dokku:dokku "$DOKKU_ROOT/.ssh"
|
||||
usermod -aG docker dokku
|
||||
}
|
||||
|
||||
setup-storage() {
|
||||
echo "Setting up storage directories"
|
||||
mkdir -p "${DOKKU_LIB_ROOT}/data" "${DOKKU_LIB_ROOT}/data/storage"
|
||||
chown dokku:dokku -R "${DOKKU_LIB_ROOT}/data"
|
||||
}
|
||||
|
||||
setup-plugins() {
|
||||
echo "Setting up plugin directories"
|
||||
# should be replaced by `plugn init`
|
||||
mkdir -p "${DOKKU_LIB_ROOT}/core-plugins/available" "${DOKKU_LIB_ROOT}/plugins/available"
|
||||
mkdir -p "${DOKKU_LIB_ROOT}/core-plugins/enabled" "${DOKKU_LIB_ROOT}/plugins/enabled"
|
||||
touch "${DOKKU_LIB_ROOT}/core-plugins/config.toml" "${DOKKU_LIB_ROOT}/plugins/config.toml"
|
||||
|
||||
echo "Enabling all core plugins"
|
||||
find "${DOKKU_LIB_ROOT}/core-plugins/available" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
||||
if [ ! -d "${DOKKU_LIB_ROOT}/plugins/available/$plugin" ]; then
|
||||
ln -s "${DOKKU_LIB_ROOT}/core-plugins/available/$plugin" "${DOKKU_LIB_ROOT}/plugins/available/$plugin"
|
||||
PLUGIN_PATH="${DOKKU_LIB_ROOT}/core-plugins" plugn enable "$plugin"
|
||||
PLUGIN_PATH="${DOKKU_LIB_ROOT}/plugins" plugn enable "$plugin"
|
||||
fi
|
||||
done
|
||||
find -L "${DOKKU_LIB_ROOT}" -type l -delete
|
||||
chown dokku:dokku -R "${DOKKU_LIB_ROOT}/plugins" "${DOKKU_LIB_ROOT}/core-plugins"
|
||||
|
||||
echo "Install all core plugins"
|
||||
dokku plugin:install --core
|
||||
}
|
||||
|
||||
setup-sshcommand() {
|
||||
echo "Ensure proper sshcommand path"
|
||||
echo '/usr/bin/dokku' > "${DOKKU_ROOT}/.sshcommand"
|
||||
}
|
||||
|
||||
setup-version() {
|
||||
rm -f "${DOKKU_ROOT}/VERSION"
|
||||
cp "${DOKKU_LIB_ROOT}/STABLE_VERSION" "${DOKKU_ROOT}/VERSION"
|
||||
}
|
||||
|
||||
main() {
|
||||
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
|
||||
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
|
||||
|
||||
setup-user
|
||||
setup-storage
|
||||
setup-plugins
|
||||
setup-sshcommand
|
||||
setup-version
|
||||
}
|
||||
|
||||
main
|
||||
20
rpm/herokuish.postinst
Normal file
20
rpm/herokuish.postinst
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set +o posix # rpm uses /bin/sh that forces bash in posix mode
|
||||
|
||||
main() {
|
||||
echo 'Starting docker'
|
||||
systemctl start docker
|
||||
|
||||
sleep 5
|
||||
|
||||
count=$(sudo docker images | grep -c gliderlabs/herokuish)
|
||||
if [ "$count" -ne 0 ]; then
|
||||
echo 'Removing old herokuish image'
|
||||
sudo docker rmi gliderlabs/herokuish
|
||||
fi
|
||||
|
||||
echo 'Importing herokuish into docker (around 5 minutes)'
|
||||
sudo docker build -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null
|
||||
}
|
||||
|
||||
main
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user