Merge branch 'master' into update-docs
This commit is contained in:
commit
5b92085c29
121 files changed
+1531
-629
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
*Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
|
.vagrant
|
||||||
|
contrib
|
||||||
|
docs
|
||||||
|
tests
|
||||||
|
!contrib/dokku-installer.py
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
*.deb
|
*.deb
|
||||||
|
*.rpm
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.ruby-version
|
.ruby-version
|
||||||
.vagrant
|
.vagrant
|
||||||
|
|||||||
+1
-1
@@ -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
|
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.
|
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:
|
etc). Please include:
|
||||||
|
|
||||||
* The output of `uname -a`.
|
* The output of `uname -a`.
|
||||||
|
|||||||
+62
@@ -1,5 +1,67 @@
|
|||||||
# History
|
# 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
|
## 0.7.2
|
||||||
|
|
||||||
This minor release contains mostly documentation changes, and should be fully backwards compatible with previous 0.7.x releases.
|
This minor release contains mostly documentation changes, and should be fully backwards compatible with previous 0.7.x releases.
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ Description of problem:
|
|||||||
|
|
||||||
Output of the following commands
|
Output of the following commands
|
||||||
|
|
||||||
|
<!-- If you're running 0.4.10+ just use dokku report-->
|
||||||
|
|
||||||
- `uname -a`:
|
- `uname -a`:
|
||||||
- `free -m`:
|
- `free -m`:
|
||||||
- `docker version`:
|
- `docker version`:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
DOKKU_VERSION = master
|
DOKKU_VERSION ?= master
|
||||||
|
|
||||||
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.6.0/sshcommand
|
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
|
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 tests.mk
|
||||||
include deb.mk
|
include deb.mk
|
||||||
|
include rpm.mk
|
||||||
include arch.mk
|
include arch.mk
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@@ -34,13 +35,17 @@ all:
|
|||||||
|
|
||||||
install: dependencies version copyfiles plugin-dependencies plugins
|
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:
|
||||||
package_cloud push dokku/dokku/ubuntu/trusty herokuish*.deb
|
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 sshcommand*.deb
|
||||||
package_cloud push dokku/dokku/ubuntu/trusty plugn*.deb
|
package_cloud push dokku/dokku/ubuntu/trusty plugn*.deb
|
||||||
package_cloud push dokku/dokku/ubuntu/trusty dokku*.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:
|
||||||
packer build contrib/packer.json
|
packer build contrib/packer.json
|
||||||
@@ -65,13 +70,17 @@ copyfiles:
|
|||||||
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} || true
|
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} || true
|
||||||
$(MAKE) addman
|
$(MAKE) addman
|
||||||
|
|
||||||
addman: help2man
|
addman: help2man man-db
|
||||||
mkdir -p /usr/local/share/man/man1
|
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
|
help2man -Nh help -v version -n "configure and get information from your dokku installation" -o /usr/local/share/man/man1/dokku.1 dokku
|
||||||
mandb
|
mandb
|
||||||
|
|
||||||
version:
|
version:
|
||||||
|
ifeq ($(DOKKU_VERSION),master)
|
||||||
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
|
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
|
plugin-dependencies: plugn
|
||||||
sudo -E dokku plugin:install-dependencies --core
|
sudo -E dokku plugin:install-dependencies --core
|
||||||
|
|||||||
@@ -7,23 +7,26 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen.
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
A fresh VM running any one of
|
A fresh VM running any of the following operating systems:
|
||||||
- `Debian 8.2 x64`
|
|
||||||
- `Ubuntu 14.04 x64`
|
- Ubuntu 16.04 x64
|
||||||
- `Ubuntu 16.04 x64`
|
- Ubuntu 14.04 x64
|
||||||
|
- Debian 8.2 x64
|
||||||
|
- CentOS 7 x64 *(experimental)*
|
||||||
|
- Arch Linux x64 *(experimental)*
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.7.2/bootstrap.sh
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.8.0/bootstrap.sh
|
||||||
sudo DOKKU_TAG=v0.7.2 bash 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.
|
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, you can see [these](http://dokku.viewdocs.io/dokku/getting-started/install/debian/#unattended-installation) docs.
|
If you wish for a more unattended installation method, see [these](http://dokku.viewdocs.io/dokku/getting-started/install/debian/#unattended-installation) docs.
|
||||||
|
|
||||||
### Upgrade
|
### Upgrade
|
||||||
|
|
||||||
|
|||||||
Vendored
+10
-1
@@ -76,13 +76,22 @@ Vagrant::configure("2") do |config|
|
|||||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make install-from-deb"
|
vm.vm.provision :shell, :inline => "cd /root/dokku && make install-from-deb"
|
||||||
end
|
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|
|
config.vm.define "build", autostart: false do |vm|
|
||||||
vm.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
vm.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
||||||
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
||||||
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||||
vm.vm.network :private_network, ip: DOKKU_IP
|
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 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
|
end
|
||||||
|
|
||||||
config.vm.define "build-arch", autostart: false do |vm|
|
config.vm.define "build-arch", autostart: false do |vm|
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ arch-setup:
|
|||||||
|
|
||||||
arch-dokku: arch-setup
|
arch-dokku: arch-setup
|
||||||
echo "-> Update package sums, create metadata file and test the build of the package"
|
echo "-> Update package sums, create metadata file and test the build of the package"
|
||||||
|
ifeq ($(DOKKU_VERSION),master)
|
||||||
git describe --tags > /tmp/VERSION
|
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
|
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
|
sed -i -e "s/pkgver=.*/pkgver=`cat /tmp/STABLE_VERSION`/" /dokku-arch/PKGBUILD
|
||||||
cd /dokku-arch; updpkgsums; mksrcinfo; makepkg -fd
|
cd /dokku-arch; updpkgsums; mksrcinfo; makepkg -fd
|
||||||
+62
-9
@@ -14,10 +14,6 @@ set -eo pipefail; [[ $TRACE ]] && set -x
|
|||||||
ensure-environment() {
|
ensure-environment() {
|
||||||
local FREE_MEMORY
|
local FREE_MEMORY
|
||||||
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
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 || {
|
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"
|
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() {
|
install-requirements() {
|
||||||
echo "--> Ensuring we have the proper dependencies"
|
echo "--> Ensuring we have the proper dependencies"
|
||||||
apt-get update -qq > /dev/null
|
|
||||||
if [[ $(lsb_release -sr) == "12.04" ]]; then
|
case "$DOKKU_DISTRO" in
|
||||||
apt-get -qq -y install python-software-properties
|
debian|ubuntu)
|
||||||
fi
|
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() {
|
install-dokku() {
|
||||||
@@ -68,9 +69,14 @@ install-dokku() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
install-dokku-from-source() {
|
install-dokku-from-source() {
|
||||||
local DOKKU_CHECKOUT="$1"
|
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
|
apt-get -qq -y install git make software-properties-common
|
||||||
cd /root
|
cd /root
|
||||||
if [[ ! -d /root/dokku ]]; then
|
if [[ ! -d /root/dokku ]]; then
|
||||||
@@ -84,6 +90,21 @@ install-dokku-from-source() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install-dokku-from-package() {
|
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 DOKKU_CHECKOUT="$1"
|
||||||
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
|
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
|
||||||
|
|
||||||
@@ -124,7 +145,39 @@ install-dokku-from-package() {
|
|||||||
fi
|
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() {
|
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 DEBIAN_FRONTEND=noninteractive
|
||||||
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
|
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
|
||||||
|
|
||||||
|
|||||||
@@ -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/
|
||||||
@@ -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 cgi
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import SimpleHTTPServer
|
import SimpleHTTPServer
|
||||||
import SocketServer
|
import SocketServer
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
VERSION = 'v0.7.2'
|
VERSION = 'v0.8.0'
|
||||||
|
|
||||||
hostname = ''
|
hostname = ''
|
||||||
try:
|
try:
|
||||||
@@ -100,8 +101,20 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||||||
with open('{0}/HOSTNAME'.format(dokku_root), 'w') as f:
|
with open('{0}/HOSTNAME'.format(dokku_root), 'w') as f:
|
||||||
f.write(params['hostname'].value)
|
f.write(params['hostname'].value)
|
||||||
|
|
||||||
command = ['sshcommand', 'acl-add', 'dokku', 'admin']
|
for (index, key) in enumerate(params['keys'].value.splitlines(), 1):
|
||||||
for key in params['keys'].value.split("\n"):
|
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 = subprocess.Popen(command, stdin=subprocess.PIPE)
|
||||||
proc.stdin.write(key)
|
proc.stdin.write(key)
|
||||||
proc.stdin.close()
|
proc.stdin.close()
|
||||||
@@ -119,6 +132,29 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(json.dumps({'status': 'ok'}))
|
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):
|
def set_debconf_selection(debconf_type, key, value):
|
||||||
found = False
|
found = False
|
||||||
|
|||||||
+119
-73
@@ -1,10 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
export DOKKU_PORT=${DOKKU_PORT:=22}
|
||||||
|
export DOKKU_HOST=${DOKKU_HOST:=}
|
||||||
|
|
||||||
MOVES=(ABLE ABNORMA AGAIN AIREXPL ANG ANGER ASAIL ATTACK AURORA AWL BAN BAND BARE BEAT BEATED BELLY BIND BITE BLOC BLOOD BODY BOOK BREATH BUMP CAST CHAM CLAMP CLAP CLAW CLEAR CLI CLIP CLOUD CONTRO CONVY COOLHIT CRASH CRY CUT DESCRI D-FIGHT DIG DITCH DIV DOZ DRE DUL DU-PIN DYE EARTH EDU EG-BOMB EGG ELEGY ELE-HIT EMBODY EMPLI ENGL ERUPT EVENS EXPLOR EYES FALL FAST F-CAR F-DANCE FEARS F-FIGHT FIGHT FIR FIRE FIREHIT FLAME FLAP FLASH FLEW FORCE FRA FREEZE FROG G-BIRD GENKISS GIFT G-KISS G-MOUSE GRADE GROW HAMMER HARD HAT HATE H-BOMB HELL-R HEMP HINT HIT HU HUNT HYPNOSI INHA IRO IRONBAR IR-WING J-GUN KEE KICK KNIF KNIFE KNOCK LEVEL LIGH LIGHHIT LIGHT LIVE L-WALL MAD MAJUS MEL MELO MESS MILK MIMI MISS MIXING MOVE MUD NI-BED NOISY NOONLI NULL N-WAVE PAT PEACE PIN PLAN PLANE POIS POL POWDE POWE POWER PRIZE PROTECT PROUD RAGE RECOR REFLAC REFREC REGR RELIV RENEW R-FIGHT RING RKICK ROCK ROUND RUS RUSH SAND SAW SCISSOR SCRA SCRIPT SEEN SERVER SHADOW SHELL SHINE SHO SIGHT SIN SMALL SMELT SMOK SNAKE SNO SNOW SOU SO-WAVE SPAR SPEC SPID S-PIN SPRA STAM STARE STEA STONE STORM STRU STRUG STUDEN SUBS SUCID SUN-LIG SUNRIS SUPLY S-WAVE TAILS TANGL TASTE TELLI THANK TONKICK TOOTH TORL TRAIN TRIKICK TUNGE VOLT WA-GUN WATCH WAVE W-BOMB WFALL WFING WHIP WHIRL WIND WOLF WOOD WOR YUJA)
|
fn-random-number() {
|
||||||
NAMES=(SEED GRASS FLOWE SHAD CABR SNAKE GOLD COW GUIKI PEDAL DELAN B-FLY BIDE KEYU FORK LAP PIGE PIJIA CAML LAT BIRD BABOO VIV ABOKE PIKAQ RYE SAN BREAD LIDEL LIDE PIP PIKEX ROK JUGEN PUD BUDE ZHIB GELU GRAS FLOW LAFUL ATH BALA CORN MOLUF DESP DAKED MIMI BOLUX KODA GELUD MONK SUMOY GEDI WENDI NILEM NILE NILEC KEZI YONGL HUDE WANLI GELI GUAIL MADAQ WUCI WUCI MUJEF JELLY SICIB GELU NELUO BOLI JIALE YED YEDE CLO SCARE AOCO DEDE DEDEI BAWU JIUG BADEB BADEB HOLE BALUX GES FANT QUAR YIHE SWAB SLIPP CLU DEPOS BILIY YUANO SOME NO YELA EMPT ZECUN XIAHE BOLEL DEJI MACID XIHON XITO LUCK MENJI GELU DECI XIDE DASAJ DONGN RICUL MINXI BALIY ZENDA LUZEL HELE5 0FENB KAIL JIAND CARP JINDE LAPU MUDE YIFU LINLI SANDI HUSI JINC OUMU OUMUX CAP KUIZA PUD TIAO FRMAN CLAU SPARK DRAGO BOLIU GUAIL MIYOU MIY QIAOK BEIL MUKEI RIDED MADAM BAGEP CROC ALIGE OUDAL OUD DADA HEHE YEDEA NUXI NUXIN ROUY ALIAD STICK QIANG LAAND PIQI PI PUPI DEKE DEKEJ NADI NADIO MALI PEA ELECT FLOWE MAL MALI HUSHU NILEE YUZI POPOZ DUZI HEBA XIAN SHAN YEYEA WUY LUO KEFE HULA CROW YADEH MOW ANNAN SUONI KYLI HULU HUDEL YEHE GULAE YEHE BLU GELAN BOAT NIP POIT HELAK XINL BEAR LINB MAGEH MAGEJ WULI YIDE RIVE FISH AOGU DELIE MANTE KONMU DELU HELU HUAN HUMA DONGF JINCA HEDE DEFU LIBY JIAPA MEJI HELE BUHU MILK HABI THUN GARD DON YANGQ SANAQ BANQ LUJ PHIX SIEI EGG)
|
|
||||||
|
|
||||||
random_number() {
|
|
||||||
[[ -n "$1" ]] && RANGE="$1"
|
[[ -n "$1" ]] && RANGE="$1"
|
||||||
if [[ -n "$RANGE" ]]; then
|
if [[ -n "$RANGE" ]]; then
|
||||||
number=$RANDOM
|
number=$RANDOM
|
||||||
@@ -15,94 +14,141 @@ random_number() {
|
|||||||
echo $number
|
echo $number
|
||||||
}
|
}
|
||||||
|
|
||||||
random_name() {
|
fn-random-name() {
|
||||||
NUM1=$(random_number ${#MOVES[@]})
|
local NUM1 NUM2 NUM3 UPPER_APPNAME lower_appname
|
||||||
NUM2=$(random_number ${#MOVES[@]})
|
local MOVES=(ABLE ABNORMA AGAIN AIREXPL ANG ANGER ASAIL ATTACK AURORA AWL BAN BAND BARE BEAT BEATED BELLY BIND BITE BLOC BLOOD BODY BOOK BREATH BUMP CAST CHAM CLAMP CLAP CLAW CLEAR CLI CLIP CLOUD CONTRO CONVY COOLHIT CRASH CRY CUT DESCRI D-FIGHT DIG DITCH DIV DOZ DRE DUL DU-PIN DYE EARTH EDU EG-BOMB EGG ELEGY ELE-HIT EMBODY EMPLI ENGL ERUPT EVENS EXPLOR EYES FALL FAST F-CAR F-DANCE FEARS F-FIGHT FIGHT FIR FIRE FIREHIT FLAME FLAP FLASH FLEW FORCE FRA FREEZE FROG G-BIRD GENKISS GIFT G-KISS G-MOUSE GRADE GROW HAMMER HARD HAT HATE H-BOMB HELL-R HEMP HINT HIT HU HUNT HYPNOSI INHA IRO IRONBAR IR-WING J-GUN KEE KICK KNIF KNIFE KNOCK LEVEL LIGH LIGHHIT LIGHT LIVE L-WALL MAD MAJUS MEL MELO MESS MILK MIMI MISS MIXING MOVE MUD NI-BED NOISY NOONLI NULL N-WAVE PAT PEACE PIN PLAN PLANE POIS POL POWDE POWE POWER PRIZE PROTECT PROUD RAGE RECOR REFLAC REFREC REGR RELIV RENEW R-FIGHT RING RKICK ROCK ROUND RUS RUSH SAND SAW SCISSOR SCRA SCRIPT SEEN SERVER SHADOW SHELL SHINE SHO SIGHT SIN SMALL SMELT SMOK SNAKE SNO SNOW SOU SO-WAVE SPAR SPEC SPID S-PIN SPRA STAM STARE STEA STONE STORM STRU STRUG STUDEN SUBS SUCID SUN-LIG SUNRIS SUPLY S-WAVE TAILS TANGL TASTE TELLI THANK TONKICK TOOTH TORL TRAIN TRIKICK TUNGE VOLT WA-GUN WATCH WAVE W-BOMB WFALL WFING WHIP WHIRL WIND WOLF WOOD WOR YUJA)
|
||||||
NUM3=$(random_number ${#NAMES[@]})
|
local NAMES=(SEED GRASS FLOWE SHAD CABR SNAKE GOLD COW GUIKI PEDAL DELAN B-FLY BIDE KEYU FORK LAP PIGE PIJIA CAML LAT BIRD BABOO VIV ABOKE PIKAQ RYE SAN BREAD LIDEL LIDE PIP PIKEX ROK JUGEN PUD BUDE ZHIB GELU GRAS FLOW LAFUL ATH BALA CORN MOLUF DESP DAKED MIMI BOLUX KODA GELUD MONK SUMOY GEDI WENDI NILEM NILE NILEC KEZI YONGL HUDE WANLI GELI GUAIL MADAQ WUCI WUCI MUJEF JELLY SICIB GELU NELUO BOLI JIALE YED YEDE CLO SCARE AOCO DEDE DEDEI BAWU JIUG BADEB BADEB HOLE BALUX GES FANT QUAR YIHE SWAB SLIPP CLU DEPOS BILIY YUANO SOME NO YELA EMPT ZECUN XIAHE BOLEL DEJI MACID XIHON XITO LUCK MENJI GELU DECI XIDE DASAJ DONGN RICUL MINXI BALIY ZENDA LUZEL HELE5 0FENB KAIL JIAND CARP JINDE LAPU MUDE YIFU LINLI SANDI HUSI JINC OUMU OUMUX CAP KUIZA PUD TIAO FRMAN CLAU SPARK DRAGO BOLIU GUAIL MIYOU MIY QIAOK BEIL MUKEI RIDED MADAM BAGEP CROC ALIGE OUDAL OUD DADA HEHE YEDEA NUXI NUXIN ROUY ALIAD STICK QIANG LAAND PIQI PI PUPI DEKE DEKEJ NADI NADIO MALI PEA ELECT FLOWE MAL MALI HUSHU NILEE YUZI POPOZ DUZI HEBA XIAN SHAN YEYEA WUY LUO KEFE HULA CROW YADEH MOW ANNAN SUONI KYLI HULU HUDEL YEHE GULAE YEHE BLU GELAN BOAT NIP POIT HELAK XINL BEAR LINB MAGEH MAGEJ WULI YIDE RIVE FISH AOGU DELIE MANTE KONMU DELU HELU HUAN HUMA DONGF JINCA HEDE DEFU LIBY JIAPA MEJI HELE BUHU MILK HABI THUN GARD DON YANGQ SANAQ BANQ LUJ PHIX SIEI EGG)
|
||||||
|
|
||||||
UPPER_APPNAME="${MOVES[${NUM1}]}-${MOVES[${NUM2}]}-${NAMES[${NUM3}]}"
|
NUM1=$(fn-random-number ${#MOVES[@]})
|
||||||
|
NUM2=$(fn-random-number ${#MOVES[@]})
|
||||||
|
NUM3=$(fn-random-number ${#NAMES[@]})
|
||||||
|
|
||||||
[[ "$BASH_VERSION" =~ 4.* ]] && lower_appname=${UPPER_APPNAME,,}
|
UPPER_APPNAME="${MOVES[${NUM1}]}-${MOVES[${NUM2}]}-${NAMES[${NUM3}]}"
|
||||||
[[ -z "$lower_appname" ]] && lower_appname=$(echo "$UPPER_APPNAME" | tr '[:upper:]' '[:lower:]')
|
|
||||||
echo "$lower_appname"
|
[[ "$BASH_VERSION" =~ 4.* ]] && lower_appname=${UPPER_APPNAME,,}
|
||||||
|
[[ -z "$lower_appname" ]] && lower_appname=$(echo "$UPPER_APPNAME" | tr '[:upper:]' '[:lower:]')
|
||||||
|
echo "$lower_appname"
|
||||||
}
|
}
|
||||||
|
|
||||||
client_help_msg() {
|
fn-client-help-msg() {
|
||||||
echo "==> Configure the DOKKU_HOST environment variable or run $0 from a repository with a git remote named dokku"
|
echo "==> Configure the DOKKU_HOST environment variable or run $0 from a repository with a git remote named dokku" 1>&2
|
||||||
echo "--> i.e. git remote add dokku dokku@<dokku-host>:<app-name>"
|
echo "--> i.e. git remote add dokku dokku@<dokku-host>:<app-name>" 1>&2
|
||||||
exit 20 # exit with specific status. only used in units tests for now
|
exit 20 # exit with specific status. only used in units tests for now
|
||||||
}
|
}
|
||||||
|
|
||||||
is_git_repo() {
|
fn-is-git-repo() {
|
||||||
git rev-parse &>/dev/null
|
git rev-parse &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
has_dokku_remote() {
|
fn-has-dokku-remote() {
|
||||||
git remote show | grep dokku
|
git remote show | grep -E "^${DOKKU_GIT_REMOTE}\s"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -z $DOKKU_HOST ]]; then
|
fn-dokku-host() {
|
||||||
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
|
declare DOKKU_GIT_REMOTE="$1" DOKKU_HOST="$2"
|
||||||
DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null || true)
|
|
||||||
else
|
if [[ -z "$DOKKU_HOST" ]]; then
|
||||||
client_help_msg
|
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
|
||||||
|
DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^${DOKKU_GIT_REMOTE}\s" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null || true)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
export DOKKU_PORT=${DOKKU_PORT:=22}
|
if [[ -z "$DOKKU_HOST" ]]; then
|
||||||
|
fn-client-help-msg
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -z $DOKKU_HOST ]]; then
|
echo "$DOKKU_HOST"
|
||||||
_dokku() {
|
}
|
||||||
appname=""
|
|
||||||
|
main() {
|
||||||
|
declare CMD="$1" APP_ARG="$2"
|
||||||
|
local APP="" DOKKU_GIT_REMOTE="dokku" DOKKU_REMOTE_HOST=""
|
||||||
|
local cmd_set=false arg_set="$2" next_index=1 skip=false args=("$@")
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [[ "$skip" == "true" ]]; then
|
||||||
|
next_index=$(( next_index + 1 ))
|
||||||
|
skip=false
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$arg" == "--app" ]]; then
|
||||||
|
APP=${args[$next_index]}
|
||||||
|
skip=true
|
||||||
|
shift 2
|
||||||
|
elif [[ "$arg" == "--remote" ]]; then
|
||||||
|
DOKKU_GIT_REMOTE=${args[$next_index]}
|
||||||
|
skip=true
|
||||||
|
shift 2
|
||||||
|
elif [[ "$arg" =~ ^--.* ]]; then
|
||||||
|
[[ "$cmd_set" == "true" ]] && APP_ARG="$arg" && break
|
||||||
|
[[ "$arg" == "--trace" ]] && export DOKKU_TRACE=1 && set -x
|
||||||
|
else
|
||||||
|
if [[ "$cmd_set" == "true" ]]; then
|
||||||
|
APP_ARG="$arg"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
CMD="$arg"
|
||||||
|
cmd_set=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
next_index=$(( next_index + 1 ))
|
||||||
|
done
|
||||||
|
|
||||||
|
DOKKU_REMOTE_HOST="$(fn-dokku-host "$DOKKU_GIT_REMOTE" "$DOKKU_HOST")"
|
||||||
|
|
||||||
|
if [[ -z "$APP" ]]; then
|
||||||
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
|
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
|
||||||
set +e
|
set +e
|
||||||
appname=$(git remote -v 2>/dev/null | grep -Ei "dokku@$DOKKU_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
|
APP=$(git remote -v 2>/dev/null | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
|
||||||
set -e
|
set -e
|
||||||
else
|
else
|
||||||
echo "This is not a git repository"
|
echo "This is not a git repository"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
apps:create)
|
|
||||||
if [[ -z "$2" ]]; then
|
|
||||||
appname=$(random_name)
|
|
||||||
counter=0
|
|
||||||
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_HOST" apps 2>/dev/null| grep -q "$appname"; do
|
|
||||||
if [[ $counter -ge 100 ]]; then
|
|
||||||
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
|
|
||||||
ssh -p "$DOKKU_PORT" "dokku@$DOKKU_HOST" apps
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
appname=$(random_name)
|
|
||||||
counter=$((counter+1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
|
||||||
appname="$2"
|
|
||||||
fi
|
|
||||||
if git remote add dokku "dokku@$DOKKU_HOST:$appname"; then
|
|
||||||
echo "-----> Dokku remote added at $DOKKU_HOST"
|
|
||||||
echo "-----> Application name is $appname"
|
|
||||||
else
|
|
||||||
echo "! Dokku remote not added! Do you already have a dokku remote?"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
apps:destroy)
|
|
||||||
is_git_repo && has_dokku_remote && git remote remove dokku
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[[ -n "$@" ]] && [[ -n "$appname" ]] && app_arg="--app $appname"
|
|
||||||
# echo "ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_HOST -- $app_arg $@"
|
|
||||||
# shellcheck disable=SC2068,SC2086
|
|
||||||
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_HOST -- $app_arg $@
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]] || [[ "$0" == $(which dokku) ]]; then
|
|
||||||
_dokku "$@"
|
|
||||||
exit $?
|
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
client_help_msg
|
case "$CMD" in
|
||||||
|
apps:create)
|
||||||
|
if [[ -z "$APP_ARG" ]]; then
|
||||||
|
APP=$(fn-random-name)
|
||||||
|
counter=0
|
||||||
|
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps 2>/dev/null| grep -q "$APP"; do
|
||||||
|
if [[ $counter -ge 100 ]]; then
|
||||||
|
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
|
||||||
|
ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
APP=$(random_name)
|
||||||
|
counter=$((counter+1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
APP="$APP_ARG"
|
||||||
|
fi
|
||||||
|
if git remote add dokku "dokku@$DOKKU_REMOTE_HOST:$APP"; then
|
||||||
|
echo "-----> Dokku remote added at ${DOKKU_REMOTE_HOST} called ${DOKKU_GIT_REMOTE}"
|
||||||
|
echo "-----> Application name is ${APP}"
|
||||||
|
else
|
||||||
|
echo "! Dokku remote not added! Do you already have a dokku remote?"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
apps:destroy)
|
||||||
|
fn-is-git-repo && fn-has-dokku-remote && git remote remove "$DOKKU_GIT_REMOTE"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
[[ " apps certs help ls nginx shell storage trace version " == *" $CMD "* ]] && unset APP
|
||||||
|
[[ " certs:chain domains:add-global domains:remove-global domains:set-global ps:rebuildall ps:restartall ps:restore " == *" $CMD "* ]] && unset APP
|
||||||
|
[[ "$CMD" =~ events*|plugin*|ssh-keys* ]] && unset APP
|
||||||
|
[[ -n "$APP_ARG" ]] && [[ "$APP_ARG" == "--global" ]] && unset APP
|
||||||
|
[[ -n "$@" ]] && [[ -n "$APP" ]] && app_arg="--app $APP"
|
||||||
|
# echo "ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@"
|
||||||
|
# shellcheck disable=SC2068,SC2086
|
||||||
|
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]] || [[ "$0" == $(which dokku) ]]; then
|
||||||
|
main "$@"
|
||||||
|
exit $?
|
||||||
fi
|
fi
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
|
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
|
||||||
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
|
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
|
||||||
HEROKUISH_VERSION ?= 0.3.19
|
HEROKUISH_VERSION ?= 0.3.24
|
||||||
HEROKUISH_ARCHITECTURE = amd64
|
HEROKUISH_ARCHITECTURE = amd64
|
||||||
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
|
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
|
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
|
gzip -9 /tmp/build/usr/share/man/man1/dokku.1
|
||||||
cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
|
cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
|
||||||
|
ifeq ($(DOKKU_VERSION),master)
|
||||||
git describe --tags > /tmp/build/var/lib/dokku/VERSION
|
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
|
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)))
|
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
|
sed -i.bak -e "s/^/`date +%s`:/" /tmp/build/var/lib/dokku/STABLE_VERSION && rm /tmp/build/var/lib/dokku/STABLE_VERSION.bak
|
||||||
endif
|
endif
|
||||||
rm /tmp/build/DEBIAN/lintian-overrides
|
rm /tmp/build/DEBIAN/lintian-overrides
|
||||||
mv debian/lintian-overrides /tmp/build/usr/share/lintian/overrides/dokku
|
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
|
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
|
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"
|
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"
|
lintian "/tmp/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
Package: dokku
|
Package: dokku
|
||||||
Version: 0.7.2
|
Version: 0.8.0
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
|
|||||||
Vendored
+2
-2
@@ -11,13 +11,13 @@ readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
|
|||||||
readonly DOKKU_LOGS_DIR="${DOKKU_LOGS_DIR:="/var/log/dokku"}"
|
readonly DOKKU_LOGS_DIR="${DOKKU_LOGS_DIR:="/var/log/dokku"}"
|
||||||
|
|
||||||
main() {
|
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
|
service dokku-installer stop || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /etc/init/dokku-installer.conf
|
rm -f /etc/init/dokku-installer.conf
|
||||||
rm -f /etc/init/dokku-redeploy.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/systemd/system/dokku-redeploy.service
|
||||||
rm -f /etc/update-motd.d/99-dokku
|
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`.
|
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 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`.
|
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
|
### 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.
|
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/.
|
||||||
@@ -11,34 +11,44 @@ storage:mount <app> <host-dir:container-dir> # Create a new bind mount
|
|||||||
storage:unmount <app> <host-dir:container-dir> # Remove an existing bind mount
|
storage:unmount <app> <host-dir:container-dir> # Remove an existing bind mount
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> The storage plugin is compatible with storage mounts created with the docker-options. The storage plugin will only list mounts from the deploy/run phase.
|
||||||
|
|
||||||
## Ideology and Background
|
## Ideology and Background
|
||||||
|
|
||||||
The storage plugin requires explicit paths on the host side. This is intentional to ensure that new users avoid running into unexpected results with implicit paths that may not exist (a feature deprecate in [Docker 1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0])). The container directory is created for the mount point in the container. Any existing directory contents are not accessible after a mount is added to the container. Dokku creates a new directory `/var/lib/dokku/data/storage` during installation, it's the general consensus that new users should use this directory. Mounts are only available at run and deploy times, you must redeploy (restart) an app to mount or unmount to an existing app's container.
|
The storage plugin requires explicit paths on the host side. This is intentional to ensure that new users avoid running into unexpected results with implicit paths that may not exist (a feature deprecate in [Docker 1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0])). The container directory is created for the mount point in the container. Any existing directory contents are not accessible after a mount is added to the container. Dokku creates a new directory `/var/lib/dokku/data/storage` during installation, it's the general consensus that new users should use this directory. Mounts are only available at run and deploy times, you must redeploy (restart) an app to mount or unmount to an existing app's container.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
This example demonstrates how to mount the recommended directory to `/storage` inside the container:
|
This example demonstrates how to mount the recommended directory to `/storage` inside an application called `node-js-app`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku storage:mount app-name /var/lib/dokku/data/storage:/storage
|
# we use a subdirectory inside of the host directory to scope it to just the app
|
||||||
|
dokku storage:mount node-js-app /var/lib/dokku/data/storage/node-js-app:/storage
|
||||||
```
|
```
|
||||||
|
|
||||||
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage` to `/storage` inside the container.
|
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.
|
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
|
```shell
|
||||||
# creating storage for the app 'ruby-rails-sample'
|
# creating storage for the app 'node-js-app'
|
||||||
mkdir -p /var/lib/dokku/data/storage/ruby-rails-sample
|
mkdir -p /var/lib/dokku/data/storage/node-js-app
|
||||||
|
|
||||||
# ensure the proper user has access to this directory
|
# ensure the proper user has access to this directory
|
||||||
chown -R dokku:dokku /var/lib/dokku/data/storage/ruby-rails-sample
|
chown -R dokku:dokku /var/lib/dokku/data/storage/node-js-app
|
||||||
|
|
||||||
# as of 0.7.x, you should chown using the `32767` user and group id
|
# as of 0.7.x, you should chown using the `32767` user and group id
|
||||||
chown -R 32767:32767 /var/lib/dokku/data/storage/ruby-rails-sample
|
chown -R 32767:32767 /var/lib/dokku/data/storage/node-js-app
|
||||||
|
|
||||||
# mount the directory into your container's /app/storage directory, relative to root
|
# mount the directory into your container's /app/storage directory, relative to root
|
||||||
dokku storage:mount app-name /var/lib/dokku/data/storage/app-name:/app/storage
|
dokku storage:mount app-name /var/lib/dokku/data/storage/node-js-app:/app/storage
|
||||||
```
|
```
|
||||||
|
|
||||||
You can mount one or more directories as desired by following the above pattern.
|
You can mount one or more directories as desired by following the above pattern.
|
||||||
@@ -73,15 +83,10 @@ You cannot use mounted volumes during the build phase of a Dockerfile deploy. Th
|
|||||||
|
|
||||||
> Note: **This can cause data loss** if you bind a mount under `/app` in buildpack apps as herokuish will attempt to remove the original app path during the build phase.
|
> Note: **This can cause data loss** if you bind a mount under `/app` in buildpack apps as herokuish will attempt to remove the original app path during the build phase.
|
||||||
|
|
||||||
## Docker-Options Note
|
## Application User and Persistent Storage file ownership (buildpack apps only)
|
||||||
|
|
||||||
The storage plugin is compatible with storage mounts created with the docker-options. The storage plugin will only list mounts from the deploy phase.
|
|
||||||
|
|
||||||
|
|
||||||
> New as of 0.7.1
|
> New as of 0.7.1
|
||||||
|
|
||||||
## Application User and Persistent Storage file ownership (buildpack apps only)
|
|
||||||
|
|
||||||
By default, Dokku will execute your buildpack application processes as the `herokuishuser` user. You may override this by setting the `DOKKU_APP_USER` config variable.
|
By default, Dokku will execute your buildpack application processes as the `herokuishuser` user. You may override this by setting the `DOKKU_APP_USER` config variable.
|
||||||
|
|
||||||
> NOTE: this user must exist in your herokuish image.
|
> NOTE: this user must exist in your herokuish image.
|
||||||
|
|||||||
@@ -31,30 +31,30 @@ dokku plugin
|
|||||||
|
|
||||||
```
|
```
|
||||||
plugn: dev
|
plugn: dev
|
||||||
00_dokku-standard 0.7.2 enabled dokku core standard plugin
|
00_dokku-standard 0.8.0 enabled dokku core standard plugin
|
||||||
20_events 0.7.2 enabled dokku core events logging plugin
|
20_events 0.8.0 enabled dokku core events logging plugin
|
||||||
apps 0.7.2 enabled dokku core apps plugin
|
apps 0.8.0 enabled dokku core apps plugin
|
||||||
build-env 0.7.2 enabled dokku core build-env plugin
|
build-env 0.8.0 enabled dokku core build-env plugin
|
||||||
certs 0.7.2 enabled dokku core certificate management plugin
|
certs 0.8.0 enabled dokku core certificate management plugin
|
||||||
checks 0.7.2 enabled dokku core checks plugin
|
checks 0.8.0 enabled dokku core checks plugin
|
||||||
common 0.7.2 enabled dokku core common plugin
|
common 0.8.0 enabled dokku core common plugin
|
||||||
config 0.7.2 enabled dokku core config plugin
|
config 0.8.0 enabled dokku core config plugin
|
||||||
docker-options 0.7.2 enabled dokku core docker-options plugin
|
docker-options 0.8.0 enabled dokku core docker-options plugin
|
||||||
domains 0.7.2 enabled dokku core domains plugin
|
domains 0.8.0 enabled dokku core domains plugin
|
||||||
enter 0.7.2 enabled dokku core enter plugin
|
enter 0.8.0 enabled dokku core enter plugin
|
||||||
git 0.7.2 enabled dokku core git plugin
|
git 0.8.0 enabled dokku core git plugin
|
||||||
logs 0.7.2 enabled dokku core logs plugin
|
logs 0.8.0 enabled dokku core logs plugin
|
||||||
named-containers 0.7.2 enabled dokku core named containers plugin
|
named-containers 0.8.0 enabled dokku core named containers plugin
|
||||||
nginx-vhosts 0.7.2 enabled dokku core nginx-vhosts plugin
|
nginx-vhosts 0.8.0 enabled dokku core nginx-vhosts plugin
|
||||||
plugin 0.7.2 enabled dokku core plugin plugin
|
plugin 0.8.0 enabled dokku core plugin plugin
|
||||||
proxy 0.7.2 enabled dokku core proxy plugin
|
proxy 0.8.0 enabled dokku core proxy plugin
|
||||||
ps 0.7.2 enabled dokku core ps plugin
|
ps 0.8.0 enabled dokku core ps plugin
|
||||||
repo 0.7.2 enabled dokku core repo plugin
|
repo 0.8.0 enabled dokku core repo plugin
|
||||||
shell 0.7.2 enabled dokku core shell plugin
|
shell 0.8.0 enabled dokku core shell plugin
|
||||||
ssh-keys 0.7.2 enabled dokku core ssh-keys plugin
|
ssh-keys 0.8.0 enabled dokku core ssh-keys plugin
|
||||||
storage 0.7.2 enabled dokku core storage plugin
|
storage 0.8.0 enabled dokku core storage plugin
|
||||||
tags 0.7.2 enabled dokku core tags plugin
|
tags 0.8.0 enabled dokku core tags plugin
|
||||||
tar 0.7.2 enabled dokku core tar 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.
|
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.
|
Resolving deltas: 100% (406/406), done.
|
||||||
Checking connectivity... done.
|
Checking connectivity... done.
|
||||||
-----> Plugin postgres enabled
|
-----> 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:
|
You can also uninstall a third-party plugin using the `plugin:uninstall` command:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
> New as of 0.6.0
|
> New as of 0.6.0
|
||||||
|
|
||||||
```
|
```
|
||||||
repo:gc <app> # Runs 'git gc --agressive' against the application's repo
|
repo:gc <app> # Runs 'git gc --aggressive' against the application's repo
|
||||||
repo:purge-cache <app> # Deletes the contents of the build cache stored in the repository
|
repo:purge-cache <app> # Deletes the contents of the build cache stored in the repository
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ The repository plugin is meant to allow users to perform management commands aga
|
|||||||
|
|
||||||
### Git Garbage Collection
|
### Git Garbage Collection
|
||||||
|
|
||||||
This will run a git gc --agressive against the applications repo. This is performed on the Dokku host, and not within an application container.
|
This will run a git gc --aggressive against the applications repo. This is performed on the Dokku host, and not within an application container.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku repo:gc node-js-app
|
dokku repo:gc node-js-app
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<browserconfig>
|
<browserconfig>
|
||||||
<msapplication>
|
<msapplication>
|
||||||
<tile>
|
<tile>
|
||||||
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.7.2/docs/assets/favicons/mstile-70x70.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.7.2/docs/assets/favicons/mstile-150x150.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.7.2/docs/assets/favicons/mstile-310x310.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.7.2/docs/assets/favicons/mstile-310x150.png"/>
|
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.8.0/docs/assets/favicons/mstile-310x150.png"/>
|
||||||
<TileColor>#da532c</TileColor>
|
<TileColor>#da532c</TileColor>
|
||||||
</tile>
|
</tile>
|
||||||
</msapplication>
|
</msapplication>
|
||||||
|
|||||||
@@ -2,37 +2,37 @@
|
|||||||
"name": "Dokku",
|
"name": "Dokku",
|
||||||
"icons": [
|
"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",
|
"sizes": "36x36",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "0.75"
|
"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",
|
"sizes": "48x48",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.0"
|
"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",
|
"sizes": "72x72",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.5"
|
"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",
|
"sizes": "96x96",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "2.0"
|
"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",
|
"sizes": "144x144",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "3.0"
|
"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",
|
"sizes": "192x192",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "4.0"
|
"density": "4.0"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
body {
|
body {
|
||||||
font-family: 'Open Sans', sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 12px;
|
|
||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
color: #5a5a5a;
|
color: #5a5a5a;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
@@ -21,7 +20,7 @@ h1 {
|
|||||||
.header .heading {
|
.header .heading {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 23px;
|
font-size: 23px;
|
||||||
margin: 0;
|
margin: 7px 0 0 0;
|
||||||
padding: 0 0 0 1em;
|
padding: 0 0 0 1em;
|
||||||
}
|
}
|
||||||
.header a {
|
.header a {
|
||||||
@@ -36,13 +35,13 @@ h1 {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
.header .navbar-brand a {
|
.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;
|
text-indent: 40px;
|
||||||
}
|
}
|
||||||
.blurb {
|
.blurb {
|
||||||
color: #424242;
|
color: #424242;
|
||||||
background-color: #ededed;
|
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;
|
padding: 45px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@@ -67,7 +66,6 @@ h1 {
|
|||||||
color: #444;
|
color: #444;
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 14px;
|
|
||||||
margin: 0 20px;
|
margin: 0 20px;
|
||||||
padding: 3px 0;
|
padding: 3px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -211,6 +209,7 @@ h1 {
|
|||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
border: none;
|
border: none;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
padding: .2rem .5rem;
|
padding: .2rem .5rem;
|
||||||
color: #157577;
|
color: #157577;
|
||||||
@@ -246,10 +245,9 @@ a.list-group-item {
|
|||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: rgb(71, 74, 84);
|
color: rgb(71, 74, 84);
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
line-height: 20px;
|
line-height: 1.5;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.markdown-body h1 {
|
.markdown-body h1 {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -69,6 +69,7 @@ Note: The following plugins have been supplied by our community and may not have
|
|||||||
[cu12]: https://github.com/cu12
|
[cu12]: https://github.com/cu12
|
||||||
[darkpixel]: https://github.com/darkpixel
|
[darkpixel]: https://github.com/darkpixel
|
||||||
[dokku]: https://github.com/dokku
|
[dokku]: https://github.com/dokku
|
||||||
|
[dokku-community]: https://github.com/dokku-community
|
||||||
[dyson]: https://github.com/dyson
|
[dyson]: https://github.com/dyson
|
||||||
[F4-Group]: https://github.com/F4-Group
|
[F4-Group]: https://github.com/F4-Group
|
||||||
[fermuch]: https://github.com/fermuch
|
[fermuch]: https://github.com/fermuch
|
||||||
@@ -119,6 +120,7 @@ Note: The following plugins have been supplied by our community and may not have
|
|||||||
[thrashr888]: https://github.com/thrashr888
|
[thrashr888]: https://github.com/thrashr888
|
||||||
[wmluke]: https://github.com/wmluke
|
[wmluke]: https://github.com/wmluke
|
||||||
[Zenedith]: https://github.com/Zenedith
|
[Zenedith]: https://github.com/Zenedith
|
||||||
|
[fteychene]: https://github.com/fteychene
|
||||||
|
|
||||||
### Datastores
|
### Datastores
|
||||||
|
|
||||||
@@ -162,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
|
[c77cbf1]: https://github.com/dokku/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
|
||||||
[28de3ec]: https://github.com/dokku/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
|
[28de3ec]: https://github.com/dokku/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
|
||||||
|
|
||||||
### Dokku Features
|
### Plugins Implementing New Dokku Functionality
|
||||||
|
|
||||||
| Plugin | Author | Compatibility |
|
| Plugin | Author | Compatibility |
|
||||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||||
@@ -184,6 +186,7 @@ Note: The following plugins have been supplied by our community and may not have
|
|||||||
| [robots.txt](https://notabug.org/candlewaster/dokku-robots.txt) | [candlewaster][] | 0.4.x |
|
| [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 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 |
|
| [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
|
[217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
|
||||||
|
|
||||||
@@ -218,10 +221,10 @@ 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+ |
|
| [Rollbar](https://github.com/iloveitaly/dokku-rollbar) | [iloveitaly][] | 0.5.0+ |
|
||||||
| [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ |
|
| [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ |
|
||||||
| [Tor](https://github.com/michaelshobbs/dokku-tor) | [michaelshobbs][] | 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 |
|
| [Webhooks](https://github.com/nickstenning/dokku-webhooks) | [nickstenning][] | 0.3.x |
|
||||||
| [Wkhtmltopdf](https://github.com/mbriskar/dokku-wkhtmltopdf) | [mbriskar][] | 0.4.0+ |
|
| [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+ |
|
| [Access](https://github.com/mainto/dokku-access) | [mainto](https://github.com/mainto) | 0.4.0+ |
|
||||||
|
|
||||||
### Deprecated Plugins
|
### Deprecated Plugins
|
||||||
|
|||||||
@@ -3,14 +3,16 @@
|
|||||||
> New as of 0.3.10
|
> New as of 0.3.10
|
||||||
|
|
||||||
```
|
```
|
||||||
|
domains [<app>|--global] # List domains
|
||||||
domains:add <app> <domain> [<domain> ...] # Add domains to app
|
domains:add <app> <domain> [<domain> ...] # Add domains to app
|
||||||
domains:add-global <domain> [<domain> ...] # Add global domain names
|
domains:add-global <domain> [<domain> ...] # Add global domain names
|
||||||
domains [<app>] # List domains
|
|
||||||
domains:clear <app> # Clear all domains for app
|
domains:clear <app> # Clear all domains for app
|
||||||
domains:disable <app> # Disable VHOST support
|
domains:disable <app> # Disable VHOST support
|
||||||
domains:enable <app> # Enable VHOST support
|
domains:enable <app> # Enable VHOST support
|
||||||
domains:remove <app> <domain> [<domain> ...] # Remove domains from app
|
domains:remove <app> <domain> [<domain> ...] # Remove domains from app
|
||||||
domains:remove-global <domain> [<domain> ...] # Remove global domain names
|
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.
|
> 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
|
# remove a custom domain from app
|
||||||
dokku domains:remove myapp example.com
|
dokku domains:remove myapp example.com
|
||||||
|
|
||||||
|
# set all custom domains for app
|
||||||
|
dokku domains:set myapp example.com example.org
|
||||||
```
|
```
|
||||||
|
|
||||||
## Default site
|
## 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
|
```nginx
|
||||||
server {
|
server {
|
||||||
@@ -85,17 +92,10 @@ 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`:
|
Make sure to reload nginx after creating this file by running `service nginx reload`.
|
||||||
|
|
||||||
```nginx
|
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).
|
||||||
# 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
|
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.
|
||||||
|
|
||||||
include /etc/nginx/sites-enabled/*;
|
|
||||||
include /etc/nginx/conf.d/*.conf;
|
|
||||||
```
|
|
||||||
|
|
||||||
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.
|
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
|
```shell
|
||||||
tar cvf cert-key.tar server.crt server.key
|
tar cvf cert-key.tar server.crt server.key
|
||||||
# replace APP with the name of your application
|
dokku certs:add node-js-app < cert-key.tar
|
||||||
dokku certs:add <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`.
|
> 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`.
|
||||||
@@ -51,7 +50,7 @@ Note that with the default nginx template, requests will be redirected to the `h
|
|||||||
|
|
||||||
The `certs:generate` command will walk you through the correct `openssl` commands to create a key, csr and a self-signed cert for a given app/domain. We automatically put the self-signed cert in place as well as add the specified domain to the application configuration.
|
The `certs:generate` command will walk you through the correct `openssl` commands to create a key, csr and a self-signed cert for a given app/domain. We automatically put the self-signed cert in place as well as add the specified domain to the application configuration.
|
||||||
|
|
||||||
If you decide to obtain a CA signed certficate, you can import that certificate using the aformentioned `dokku certs:add` command.
|
If you decide to obtain a CA signed certificate, you can import that certificate using the aforementioned `dokku certs:add` command.
|
||||||
|
|
||||||
### Certificate information
|
### Certificate information
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
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
|
### 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.
|
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.
|
||||||
|
|||||||
@@ -24,13 +24,8 @@ Dokku also supports certain command-line arguments that augment the `log` comman
|
|||||||
-q, --quiet # display raw logs without colors, time and names
|
-q, --quiet # display raw logs without colors, time and names
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use these modifiers as
|
You can use these modifiers as follows:
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku logs <app> <modifiers>
|
|
||||||
```
|
|
||||||
|
|
||||||
For example,
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku logs node-js-app -t -p web
|
dokku logs node-js-app -t -p web
|
||||||
|
|||||||
@@ -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:
|
To use a specific buildpack, you can run the following Dokku command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# replace APP with the name of your application
|
|
||||||
# replace REPOSITORY_URL with your buildpack's url
|
# 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
|
# 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.
|
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
|
```shell
|
||||||
# using the latest nodejs buildpack
|
# using the latest nodejs buildpack
|
||||||
# replace APP with the name of your application
|
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs
|
||||||
dokku config:set 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
|
You may also wish to use a **specific** version of a buildpack, which is also simple
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# using v87 of the nodejs buildpack
|
# using v87 of the nodejs buildpack
|
||||||
# replace APP with the name of your application
|
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v87
|
||||||
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v87
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Specifying commands via Procfile
|
## Specifying commands via Procfile
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ ENTRYPOINT ["node"]
|
|||||||
You can do:
|
You can do:
|
||||||
|
|
||||||
```shell
|
```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.
|
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:
|
If you want to remove the container after a command has started, you can run the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# keep `run` containers around
|
# don't keep `run` containers around
|
||||||
dokku config:set --global DOKKU_RM_CONTAINER=1
|
dokku config:set --global DOKKU_RM_CONTAINER=1
|
||||||
|
|
||||||
# revert the above setting and keep containers around
|
# revert the above setting and keep containers around
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ dokku ps node-js-app
|
|||||||
|
|
||||||
### Rebuilding applications
|
### Rebuilding applications
|
||||||
|
|
||||||
There are some Dokku commands which will not automatically rebuild an application's environment, or which can be told to skip a rebuild. For instance, you may wish to run mulitple `config:set` commands without a restart so as to speed up configuration. In these cases, you can ultimately trigger an application rebuild using `ps:rebuild`
|
There are some Dokku commands which will not automatically rebuild an application's environment, or which can be told to skip a rebuild. For instance, you may wish to run multiple `config:set` commands without a restart so as to speed up configuration. In these cases, you can ultimately trigger an application rebuild using `ps:rebuild`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku ps:rebuild node-js-app
|
dokku ps:rebuild node-js-app
|
||||||
@@ -92,7 +92,7 @@ dokku ps:scale node-js-app
|
|||||||
|
|
||||||
### Stopping applications
|
### Stopping applications
|
||||||
|
|
||||||
Deployed applications can be stopped using the `ps:stop` command. This turns all running containers for an application, and will result in a `502 Bad Gateway` reponse for the default nginx proxy implementation.
|
Deployed applications can be stopped using the `ps:stop` command. This turns all running containers for an application, and will result in a `502 Bad Gateway` response for the default nginx proxy implementation.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku ps:stop node-js-app
|
dokku ps:stop node-js-app
|
||||||
|
|||||||
@@ -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 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
|
## 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)
|
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:
|
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.
|
||||||
|
|
||||||
```shell
|
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.
|
||||||
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
|
## Configuring Check Settings using the `config` plugin
|
||||||
|
|
||||||
> Note that `checks:disable` will now (as of 0.6.0) cause downtime for that process-type during deployments.
|
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
|
```shell
|
||||||
|
# process type specification is optional
|
||||||
dokku checks:skip node-js-app worker,web
|
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
|
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
|
```shell
|
||||||
dokku checks:disable node-js-app worker
|
dokku checks:disable node-js-app worker
|
||||||
@@ -48,14 +61,67 @@ dokku checks:disable node-js-app worker
|
|||||||
DOKKU_CHECKS_SKIPPED: web
|
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
|
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.
|
||||||
dokku config:set --global DOKKU_WAIT_TO_RETIRE=120
|
|
||||||
dokku config:set <app> DOKKU_WAIT_TO_RETIRE=120
|
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
|
## Manually Invoking Checks
|
||||||
|
|
||||||
@@ -92,7 +158,7 @@ dokku checks:run APP
|
|||||||
Checks can be scoped to a particular process type:
|
Checks can be scoped to a particular process type:
|
||||||
|
|
||||||
```shell
|
```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:
|
An app process id may also be specified:
|
||||||
|
|
||||||
```shell
|
```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:
|
Non-existent process types will result in an error:
|
||||||
|
|
||||||
```shell
|
```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
|
Non-existent process ids will *also* result in an error
|
||||||
|
|
||||||
```shell
|
```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)
|
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
|
## 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.
|
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 :
|
- 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
|
```shell
|
||||||
dokku config:set --no-restart APP KEY1=VALUE1 [KEY2=VALUE2 ...]
|
dokku config:set --no-restart node-js-app KEY1=VALUE1 [KEY2=VALUE2 ...]
|
||||||
dokku config:unset --no-restart APP KEY1 [KEY2 ...]
|
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.
|
- 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.
|
- 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 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`
|
### `post-config-update`
|
||||||
|
|
||||||
@@ -134,6 +134,24 @@ help_content
|
|||||||
esac
|
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`
|
### `dependencies`
|
||||||
|
|
||||||
- Description: Used to install system-level dependencies. Invoked by `plugin:install-dependencies`.
|
- Description: Used to install system-level dependencies. Invoked by `plugin:install-dependencies`.
|
||||||
@@ -430,7 +448,9 @@ dokku postgres:destroy $APP
|
|||||||
|
|
||||||
### `post-deploy`
|
### `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`
|
- Invoked by: `dokku deploy`
|
||||||
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS $IMAGE_TAG`
|
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS $IMAGE_TAG`
|
||||||
- Example:
|
- Example:
|
||||||
@@ -447,7 +467,7 @@ curl "http://httpstat.us/200"
|
|||||||
### `post-domains-update`
|
### `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
|
- 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`
|
- Arguments: `$APP` `action name` `domains`
|
||||||
- Example:
|
- 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....
|
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`
|
### `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.
|
- 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.
|
- 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 list of changes must be made in the `HISTORY.md`.
|
||||||
- A tag must be created locally with your release version
|
- 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
|
- 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.
|
- 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)
|
- 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.
|
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.
|
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
|
vagrant up build
|
||||||
export PACKAGECLOUD_TOKEN=SOME_TOKEN
|
export PACKAGECLOUD_TOKEN=SOME_TOKEN
|
||||||
package_cloud push dokku/dokku/ubuntu/trusty dokku_0.9.9_amd64.deb
|
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.
|
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
|
```shell
|
||||||
# having dokku-arch in ../dokku-arch
|
# having dokku-arch in ../dokku-arch
|
||||||
vagrant up build-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
|
cd ../dokku-arch
|
||||||
git add PKGBUILD .SRCINFO
|
git add PKGBUILD .SRCINFO
|
||||||
git commit -m 'Update to dokku 0.9.9'
|
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
|
```shell
|
||||||
# using a branch results in installing from source
|
# 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
|
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:
|
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
|
```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
|
chmod +x bootstrap.sh
|
||||||
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
|
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -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
|
Dreamhost (or any other OpenStack-compatible cloud with minimal
|
||||||
changes).
|
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
|
using openstack client or from the web UI and with the same command
|
||||||
use a cloud-init script to install Dokku. Install the [openstack
|
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),
|
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.
|
This allows openstack client to connect to DreamHost API endpoints.
|
||||||
The command below creates a new server named `my-dokku-instance` based
|
The command below creates a new server instance named `my-dokku-instance`
|
||||||
on Ubuntu 14.04, with 2GB RAM and 1CPU (the flavor called
|
based on Ubuntu 14.04, with 2GB RAM and 1CPU (the flavor called
|
||||||
`semisonic`), opening network port access to http and ssh (the
|
`supersonic`), opening network port access to http and ssh (the
|
||||||
`default` security group), and the name of the chosen SSH key. This
|
`default` security group), and the name of the chosen SSH key. This
|
||||||
key will be automatically added to the new server in the
|
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.
|
be reused by Dokku.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
openstack server create \
|
openstack server create \
|
||||||
--image Ubuntu-14.04 \
|
--image Ubuntu-14.04 \
|
||||||
--flavor gp1.semisonic \
|
--flavor gp1.supersonic \
|
||||||
--security-group default \
|
--security-group default \
|
||||||
--key-name $YOUR_SSH_KEYNAME \
|
--key-name $YOUR_SSH_KEYNAME \
|
||||||
--user-data dokku-cloudinit.sh \
|
--user-data dokku-cloudinit.sh \
|
||||||
@@ -178,8 +178,20 @@ debconf_selections: |
|
|||||||
# set the domain name of the new Dokku server
|
# set the domain name of the new Dokku server
|
||||||
dokku dokku/hostname string $YOUR_FULL_QUALIFIED_DOMAIN
|
dokku dokku/hostname string $YOUR_FULL_QUALIFIED_DOMAIN
|
||||||
# this copies over the public SSH key assigned to the server
|
# 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:
|
packages:
|
||||||
- dokku
|
- 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.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# RPM Package Installation Notes
|
||||||
|
|
||||||
|
> New as of 0.8.0 *(experimental)*
|
||||||
|
|
||||||
|
>**Warning:** Web installer is not available on CentOS. You will need to configure [SSH keys](/dokku/deployment/user-management/#adding-ssh-keys) and [virtual hosts](/dokku/configuration/domains/#customizing-hostnames) using dokku command line interface.
|
||||||
|
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
The [devicemapper](https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/) is the default Docker storage driver on CentOS 7 and defaults to a configuration mode known as `loop-lvm`. This mode is designed to work out-of-the-box with no additional configuration. However, production deployments should not run under `loop-lvm` mode. The preferred configuration for production deployments is [`direct-lvm`](https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#/configure-direct-lvm-mode-for-production).
|
||||||
@@ -6,12 +6,12 @@ Dokku is an extensible, open source Platform as a Service that runs on a single
|
|||||||
|
|
||||||
To start using Dokku, you'll need a system that meets the following minimum requirements:
|
To start using Dokku, you'll need a system that meets the following minimum requirements:
|
||||||
|
|
||||||
- A fresh installation of [Ubuntu 14.04 x64](http://www.ubuntu.com/download/) with the FQDN set <sup>[1]</sup>
|
- A fresh installation of [Ubuntu 16.04 x64](https://www.ubuntu.com/download), [Ubuntu 14.04 x64](https://www.ubuntu.com/download), [Debian 8.2 x64](https://www.debian.org/distrib/) or [CentOS 7 x64](https://www.centos.org/download/) *(experimental)* with the FQDN set <sup>[1]</sup>
|
||||||
- At least `1GB` of system memory <sup>[2]</sup>
|
- At least `1GB` of system memory <sup>[2]</sup>
|
||||||
|
|
||||||
You can *optionally* have a domain name pointed at the host's IP, though this is not necessary.
|
You can *optionally* have a domain name pointed at the host's IP, though this is not necessary.
|
||||||
|
|
||||||
Dokku is designed for usage on a fresh installation of Ubuntu, and should install all necessary dependencies if installing via the bootstrap method.
|
Dokku is designed for usage on a fresh VM installation, and should install all necessary dependencies if installing via the bootstrap method.
|
||||||
|
|
||||||
### Installing the latest stable version
|
### Installing the latest stable version
|
||||||
|
|
||||||
@@ -21,8 +21,8 @@ To install the latest stable version of dokku, you can run the following shell c
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# for debian systems, installs Dokku via apt-get
|
# for debian systems, installs Dokku via apt-get
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.7.2/bootstrap.sh
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.8.0/bootstrap.sh;
|
||||||
sudo DOKKU_TAG=v0.7.2 bash bootstrap.sh
|
sudo DOKKU_TAG=v0.8.0 bash bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||||
@@ -33,6 +33,8 @@ Once the installation is complete, you can open a browser to setup your SSH 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.
|
>**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.
|
||||||
|
|
||||||
|
>**Warning:** Web installer is not available on CentOS and Arch Linux. You will need to configure [SSH keys](/dokku/deployment/user-management/#adding-ssh-keys) and [virtual hosts](/dokku/configuration/domains/#customizing-hostnames) using dokku command line interface.
|
||||||
|
|
||||||
#### 3. Deploy your first application
|
#### 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.
|
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 +50,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:
|
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/)
|
- [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/)
|
- [Vagrant Installation Notes](/dokku/getting-started/install/vagrant/)
|
||||||
- [Advanced Install Customization](/dokku/getting-started/advanced-installation/)
|
- [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
|
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
|
```shell
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
dokku apps
|
dokku apps
|
||||||
dokku ps:stop <app> # repeat to shut down each running app
|
dokku ps:stop APP # repeat to shut down each running app
|
||||||
sudo apt-get install -qq -y dokku herokuish
|
sudo apt-get install -qq -y dokku herokuish sshcommand plugn
|
||||||
dokku ps:rebuildall # rebuilds all applications
|
dokku ps:rebuildall # rebuilds all applications
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ If you installed Dokku from source (less common), upgrade with:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku apps
|
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
|
cd ~/dokku
|
||||||
git pull --tags origin master
|
git pull --tags origin master
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -7,33 +7,33 @@
|
|||||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
<!-- 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="description" content="">
|
||||||
<meta name="author" 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>
|
<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="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.7.2/docs/assets/favicons/apple-touch-icon-60x60.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.7.2/docs/assets/favicons/apple-touch-icon-72x72.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.7.2/docs/assets/favicons/apple-touch-icon-76x76.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.7.2/docs/assets/favicons/apple-touch-icon-114x114.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.7.2/docs/assets/favicons/apple-touch-icon-120x120.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.7.2/docs/assets/favicons/apple-touch-icon-144x144.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.7.2/docs/assets/favicons/apple-touch-icon-152x152.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.7.2/docs/assets/favicons/apple-touch-icon-180x180.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.7.2/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/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.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.7.2/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-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="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.7.2/docs/assets/favicons/manifest.json">
|
<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.7.2/docs/assets/favicons/favicon.ico">
|
<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="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<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-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.7.2/docs/assets/favicons/browserconfig.xml">
|
<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">
|
<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://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="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
@@ -98,12 +98,12 @@
|
|||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</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>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</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>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||||
|
|||||||
+23
-103
@@ -7,29 +7,28 @@
|
|||||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
<!-- 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="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
<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>
|
<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="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.7.2/docs/assets/favicons/apple-touch-icon-60x60.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.7.2/docs/assets/favicons/apple-touch-icon-72x72.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.7.2/docs/assets/favicons/apple-touch-icon-76x76.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.7.2/docs/assets/favicons/apple-touch-icon-114x114.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.7.2/docs/assets/favicons/apple-touch-icon-120x120.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.7.2/docs/assets/favicons/apple-touch-icon-144x144.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.7.2/docs/assets/favicons/apple-touch-icon-152x152.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.7.2/docs/assets/favicons/apple-touch-icon-180x180.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.7.2/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/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.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.7.2/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-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="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.7.2/docs/assets/favicons/manifest.json">
|
<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.7.2/docs/assets/favicons/favicon.ico">
|
<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="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<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-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.7.2/docs/assets/favicons/browserconfig.xml">
|
<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">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -43,97 +42,18 @@
|
|||||||
</script>
|
</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://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="/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">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
.highlight-show-language {
|
body {
|
||||||
position: relative;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
}
|
}
|
||||||
.highlight-show-language-label {
|
.list-group-item {
|
||||||
color: black;
|
|
||||||
background-color: #CFCFCF;
|
|
||||||
display: inline-block;
|
|
||||||
position: absolute;
|
|
||||||
bottom: auto;
|
|
||||||
left: auto;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
font-size: 0.9em;
|
|
||||||
border-radius: 0 0 0 5px;
|
|
||||||
padding: 0 0.5em;
|
|
||||||
text-shadow: none;
|
|
||||||
z-index: 1;
|
|
||||||
-webkit-box-shadow: none;
|
|
||||||
-moz-box-shadow: none;
|
|
||||||
box-shadow: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-moz-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
-o-transform: none;
|
|
||||||
transform: none;
|
|
||||||
}
|
|
||||||
.highlight-output pre {
|
|
||||||
color: #fff;
|
|
||||||
background-color: #000;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.improve-slideout {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 66%;
|
|
||||||
right: 0;
|
|
||||||
-webkit-transition-duration: 0.3s;
|
|
||||||
-moz-transition-duration: 0.3s;
|
|
||||||
-o-transition-duration: 0.3s;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
background: #363637;
|
|
||||||
padding: 5px 0px 4px;
|
|
||||||
z-index: 90;
|
|
||||||
}
|
|
||||||
.improve-slideout:hover {
|
|
||||||
right: 205px;
|
|
||||||
}
|
|
||||||
.improve-slideout:hover .improve-slideout-inner {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
.improve-slideout-inner {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 66%;
|
|
||||||
right: -205px;
|
|
||||||
-webkit-transition-duration: 0.3s;
|
|
||||||
-moz-transition-duration: 0.3s;
|
|
||||||
-o-transition-duration: 0.3s;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
background: #e0e0d9;
|
|
||||||
padding: 4px 12px;
|
|
||||||
width: 205px;
|
|
||||||
}
|
|
||||||
.improve-slideout-inner h6 {
|
|
||||||
color: #363637;
|
|
||||||
font-weight: 700;
|
|
||||||
text-transform: uppercase;
|
|
||||||
margin: 0;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.git-improve {
|
.markdown-body {
|
||||||
font-size: 20px;
|
line-height: 1.5;
|
||||||
vertical-align: -2px;
|
|
||||||
padding-left: 8px;
|
|
||||||
}
|
|
||||||
.back-to-contents {
|
|
||||||
position: fixed;
|
|
||||||
bottom: calc(66% - 34px);
|
|
||||||
right: 0;
|
|
||||||
background: #363637;
|
|
||||||
padding: 5px 0px 4px;
|
|
||||||
z-index: 90;
|
|
||||||
}
|
|
||||||
.icon-improve {
|
|
||||||
color: #bdbdb5;
|
|
||||||
padding: 2px 9px 0 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -7,17 +7,9 @@ export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
|
|||||||
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source "$f"; done
|
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source "$f"; done
|
||||||
[[ $DOKKU_TRACE ]] && set -x
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$(lsb_release -si)" in
|
export DOKKU_DISTRO
|
||||||
Arch)
|
# shellcheck disable=SC1091
|
||||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="arch"}
|
DOKKU_DISTRO=$(. /etc/os-release > /dev/null 2>&1 || true ; echo "$ID")
|
||||||
;;
|
|
||||||
Debian)
|
|
||||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="debian"}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
|
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
|
||||||
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
||||||
@@ -43,10 +35,12 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|||||||
|
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
args=("$@")
|
args=("$@")
|
||||||
|
skip_arg=false
|
||||||
if [[ "${args[0]}" =~ ^--.* ]]; then
|
if [[ "${args[0]}" =~ ^--.* ]]; then
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
|
$skip_arg && skip_arg=false && continue
|
||||||
if [[ "$arg" == "--app" ]]; then
|
if [[ "$arg" == "--app" ]]; then
|
||||||
shift 2
|
shift 2 && skip_arg=true
|
||||||
elif [[ "$arg" =~ ^--.* ]]; then
|
elif [[ "$arg" =~ ^--.* ]]; then
|
||||||
shift 1
|
shift 1
|
||||||
else
|
else
|
||||||
|
|||||||
Executable
+23
@@ -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+=" rm -rf /tmp/cache ; "
|
||||||
COMMAND+=" ln -sf /cache /tmp/cache ; "
|
COMMAND+=" ln -sf /cache /tmp/cache ; "
|
||||||
COMMAND+=" fi ; "
|
COMMAND+=" fi ; "
|
||||||
COMMAND+=" $SCRIPT_CMD ;"
|
COMMAND+=" $SCRIPT_CMD || exit 1;"
|
||||||
COMMAND+=" if [[ -d '/cache' ]]; then "
|
COMMAND+=" if [[ -d '/cache' ]]; then "
|
||||||
COMMAND+=" echo removing installation cache... ; "
|
COMMAND+=" echo removing installation cache... ; "
|
||||||
COMMAND+=" rm -f /tmp/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
|
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Dokku app redeploy service
|
Description=Dokku app redeploy service
|
||||||
After=docker.target
|
Requires=docker.service
|
||||||
|
After=docker.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core standard plugin"
|
description = "dokku core standard plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -5,30 +5,11 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
|
|||||||
|
|
||||||
exec_app_json_scripts() {
|
exec_app_json_scripts() {
|
||||||
declare desc="core app.json scripts execution"
|
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"
|
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)"
|
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
||||||
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
|
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 "$@"
|
exec_app_json_scripts "$@"
|
||||||
cleanup_container_state "$@"
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
hook
|
||||||
@@ -12,7 +12,7 @@ flag_rsyslog_needs_restart=n
|
|||||||
# exits gracefully if the path already exists
|
# exits gracefully if the path already exists
|
||||||
mkdir -m 775 -p "$DOKKU_LOGS_DIR"
|
mkdir -m 775 -p "$DOKKU_LOGS_DIR"
|
||||||
case "$DOKKU_DISTRO" in
|
case "$DOKKU_DISTRO" in
|
||||||
arch|debian)
|
arch|debian|centos)
|
||||||
chgrp dokku "$DOKKU_LOGS_DIR"
|
chgrp dokku "$DOKKU_LOGS_DIR"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -23,7 +23,7 @@ esac
|
|||||||
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
|
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
|
||||||
touch "$DOKKU_EVENTS_LOGFILE"
|
touch "$DOKKU_EVENTS_LOGFILE"
|
||||||
case "$DOKKU_DISTRO" in
|
case "$DOKKU_DISTRO" in
|
||||||
arch|debian)
|
arch|debian|centos)
|
||||||
chgrp dokku "$DOKKU_EVENTS_LOGFILE"
|
chgrp dokku "$DOKKU_EVENTS_LOGFILE"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core events logging plugin"
|
description = "dokku core events logging plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core apps plugin"
|
description = "dokku core apps plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -13,11 +13,11 @@ apps_rename_cmd() {
|
|||||||
local NEW_APP="$3"
|
local NEW_APP="$3"
|
||||||
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
|
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
|
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
|
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
||||||
fi
|
fi
|
||||||
rm -rf "$OLD_CACHE_DIR"
|
rm -rf "$OLD_CACHE_DIR"
|
||||||
|
apps_create "$NEW_APP"
|
||||||
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
|
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
|
||||||
DOKKU_APPS_FORCE_DELETE=1 apps_destroy "$OLD_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"
|
[[ -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]
|
[plugin]
|
||||||
description = "dokku core build-env plugin"
|
description = "dokku core build-env plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
+34
-1
@@ -2,6 +2,39 @@
|
|||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
|
certs_info_cmd() {
|
||||||
|
# This is here because it's used in both the info and the default
|
||||||
|
declare desc="prints SSL certificate info for app"
|
||||||
|
local cmd="certs:info"
|
||||||
|
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
|
verify_app_name "$2"
|
||||||
|
local APP="$2"; local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||||
|
|
||||||
|
if [[ -n "$APP_SSL_PATH" ]]; then
|
||||||
|
dokku_log_info1 "Fetching SSL Endpoint info for $APP..."
|
||||||
|
dokku_log_info1 "Certificate details:"
|
||||||
|
dokku_log_info2 "Common Name(s): "
|
||||||
|
|
||||||
|
for domain in $(get_ssl_hostnames "$APP" | xargs); do
|
||||||
|
dokku_log_info2 " $domain"
|
||||||
|
done
|
||||||
|
|
||||||
|
dokku_log_info2 "Expires At: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Not After :" | awk -F " : " '{ print $2 }')"
|
||||||
|
dokku_log_info2 "Issuer: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Issuer:" | xargs | sed -e "s/Issuer: //g")"
|
||||||
|
dokku_log_info2 "Starts At: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Not Before:" | awk -F ": " '{ print $2 }')"
|
||||||
|
dokku_log_info2 "Subject: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -subject | sed -e "s:subject= ::g"| sed -e "s:^/::g" | sed -e "s:/:; :g")"
|
||||||
|
local SSL_VERIFY_OUTPUT="$(openssl verify -verbose -purpose sslserver "$APP_SSL_PATH/server.crt" | awk -F ':' '{ print $2 }' | tail -1 | xargs || true)"
|
||||||
|
if [[ "$SSL_VERIFY_OUTPUT" == "OK" ]]; then
|
||||||
|
local SSL_SELF_SIGNED="verified by a certificate authority."
|
||||||
|
else
|
||||||
|
local SSL_SELF_SIGNED="self signed."
|
||||||
|
fi
|
||||||
|
dokku_log_info2 "SSL certificate is $SSL_SELF_SIGNED"
|
||||||
|
else
|
||||||
|
dokku_log_info1 "$APP does not have an SSL endpoint"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
is_ssl_enabled() {
|
is_ssl_enabled() {
|
||||||
declare desc="returns 0 if ssl is enabled for given app"
|
declare desc="returns 0 if ssl is enabled for given app"
|
||||||
local APP=$1; verify_app_name "$APP"
|
local APP=$1; verify_app_name "$APP"
|
||||||
@@ -26,6 +59,6 @@ get_ssl_hostnames() {
|
|||||||
else
|
else
|
||||||
local SSL_HOSTNAMES=$SSL_HOSTNAME
|
local SSL_HOSTNAMES=$SSL_HOSTNAME
|
||||||
fi
|
fi
|
||||||
echo -e "$SSL_HOSTNAMES"
|
echo -e "$SSL_HOSTNAMES" | sort -u
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core certificate management plugin"
|
description = "dokku core certificate management plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -72,7 +72,6 @@ certs_set() {
|
|||||||
cp "$KEY_FILE" "$APP_SSL_PATH/server.key"
|
cp "$KEY_FILE" "$APP_SSL_PATH/server.key"
|
||||||
chmod 750 "$APP_SSL_PATH"
|
chmod 750 "$APP_SSL_PATH"
|
||||||
chmod 640 "$APP_SSL_PATH/server.crt" "$APP_SSL_PATH/server.key"
|
chmod 640 "$APP_SSL_PATH/server.crt" "$APP_SSL_PATH/server.key"
|
||||||
cd "$DOKKU_ROOT"
|
|
||||||
plugn trigger post-certs-update "$APP"
|
plugn trigger post-certs-update "$APP"
|
||||||
plugn trigger post-domains-update "$APP"
|
plugn trigger post-domains-update "$APP"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||||
|
|
||||||
|
certs_main_cmd() {
|
||||||
|
declare desc="an alias for certs:info"
|
||||||
|
local cmd="certs"
|
||||||
|
certs_info_cmd "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
certs_main_cmd "$@"
|
||||||
@@ -22,14 +22,15 @@ certs_generate_cmd() {
|
|||||||
|
|
||||||
mkdir -p "$APP_SSL_PATH"
|
mkdir -p "$APP_SSL_PATH"
|
||||||
dokku_log_info1 "Installing certificate and key..."
|
dokku_log_info1 "Installing certificate and key..."
|
||||||
mv -f "$CERTS_GENERATE_TMP_WORK_DIR/server.key" "$CERTS_GENERATE_TMP_WORK_DIR/server.crt" "$APP_SSL_PATH"
|
mv -f "$CERTS_GENERATE_TMP_WORK_DIR/server.crt" "$CERTS_GENERATE_TMP_WORK_DIR/server.csr" "$CERTS_GENERATE_TMP_WORK_DIR/server.key" "$APP_SSL_PATH"
|
||||||
chmod 750 "$APP_SSL_PATH"
|
chmod 750 "$APP_SSL_PATH"
|
||||||
chmod 640 "$APP_SSL_PATH/server.key" "$APP_SSL_PATH/server.crt"
|
chmod 640 "$APP_SSL_PATH/server.crt" "$APP_SSL_PATH/server.csr" "$APP_SSL_PATH/server.key"
|
||||||
|
plugn trigger post-certs-update "$APP"
|
||||||
[[ -n "$DOMAIN" ]] && (domains_add "$APP" "$DOMAIN" || plugn trigger post-domains-update "$APP")
|
[[ -n "$DOMAIN" ]] && (domains_add "$APP" "$DOMAIN" || plugn trigger post-domains-update "$APP")
|
||||||
dokku_log_info1 "The following is a certificate signing request that can be used"
|
dokku_log_info1 "The following is a certificate signing request that can be used"
|
||||||
dokku_log_info1 "to generate an 'officially' signed SSL certificate for $APP at $DOMAIN"
|
dokku_log_info1 "to generate an 'officially' signed SSL certificate for $APP at $DOMAIN"
|
||||||
dokku_log_info1 "by a CA of your choosing."
|
dokku_log_info1 "by a CA of your choosing."
|
||||||
cat server.csr
|
cat "$APP_SSL_PATH/server.csr"
|
||||||
else
|
else
|
||||||
dokku_log_info1 "$APP has an SSL endpoint already defined"
|
dokku_log_info1 "$APP has an SSL endpoint already defined"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -3,36 +3,4 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||||
|
|
||||||
certs_info_cmd() {
|
|
||||||
declare desc="prints SSL certificate info for app"
|
|
||||||
local cmd="certs:info"
|
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
|
||||||
verify_app_name "$2"
|
|
||||||
local APP="$2"; local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
|
||||||
|
|
||||||
if [[ -n "$APP_SSL_PATH" ]]; then
|
|
||||||
dokku_log_info1 "Fetching SSL Endpoint info for $APP..."
|
|
||||||
dokku_log_info1 "Certificate details:"
|
|
||||||
dokku_log_info2 "Common Name(s): "
|
|
||||||
|
|
||||||
for domain in $(get_ssl_hostnames "$APP" | xargs); do
|
|
||||||
dokku_log_info2 " $domain"
|
|
||||||
done
|
|
||||||
|
|
||||||
dokku_log_info2 "Expires At: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Not After :" | awk -F " : " '{ print $2 }')"
|
|
||||||
dokku_log_info2 "Issuer: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Issuer:" | xargs | sed -e "s/Issuer: //g")"
|
|
||||||
dokku_log_info2 "Starts At: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Not Before:" | awk -F ": " '{ print $2 }')"
|
|
||||||
dokku_log_info2 "Subject: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -subject | sed -e "s:subject= ::g"| sed -e "s:^/::g" | sed -e "s:/:; :g")"
|
|
||||||
local SSL_VERIFY_OUTPUT="$(openssl verify -verbose -purpose sslserver "$APP_SSL_PATH/server.crt" | awk -F ':' '{ print $2 }' | tail -1 | xargs || true)"
|
|
||||||
if [[ "$SSL_VERIFY_OUTPUT" == "OK" ]]; then
|
|
||||||
local SSL_SELF_SIGNED="verified by a certificate authority."
|
|
||||||
else
|
|
||||||
local SSL_SELF_SIGNED="self signed."
|
|
||||||
fi
|
|
||||||
dokku_log_info2 "SSL certificate is $SSL_SELF_SIGNED"
|
|
||||||
else
|
|
||||||
dokku_log_info1 "$APP does not have an SSL endpoint"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
certs_info_cmd "$@"
|
certs_info_cmd "$@"
|
||||||
@@ -16,7 +16,7 @@ help_content
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [[ $1 = "checks:help" ]] ; then
|
if [[ $1 = "checks:help" ]] ; then
|
||||||
echo -e 'Usage: dokku checks[:COMAND]'
|
echo -e 'Usage: dokku checks[:COMMAND]'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Manage zero-downtime settings.'
|
echo 'Manage zero-downtime settings.'
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core checks plugin"
|
description = "dokku core checks plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -251,7 +251,12 @@ parse_args() {
|
|||||||
declare desc="top-level cli arg parser"
|
declare desc="top-level cli arg parser"
|
||||||
local next_index=1; local skip=false; local args=("$@")
|
local next_index=1; local skip=false; local args=("$@")
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
$skip && skip=false && continue
|
if [[ "$skip" == "true" ]]; then
|
||||||
|
next_index=$(( next_index + 1 ))
|
||||||
|
skip=false
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
--quiet)
|
--quiet)
|
||||||
export DOKKU_QUIET_OUTPUT=1
|
export DOKKU_QUIET_OUTPUT=1
|
||||||
@@ -272,7 +277,7 @@ parse_args() {
|
|||||||
export DOKKU_APP_NAME=${args[$next_index]}; skip=true
|
export DOKKU_APP_NAME=${args[$next_index]}; skip=true
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
local next_index=$(( next_index + 1 ))
|
next_index=$(( next_index + 1 ))
|
||||||
done
|
done
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -554,6 +559,8 @@ dokku_deploy_cmd() {
|
|||||||
dokku_log_info2 "stopping $APP.$PROC_TYPE ($cid)"
|
dokku_log_info2 "stopping $APP.$PROC_TYPE ($cid)"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
docker stop $DOCKER_STOP_TIME_ARG "$cid" &> /dev/null
|
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
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -651,6 +658,7 @@ dokku_deploy_cmd() {
|
|||||||
done < "$DOKKU_SCALE_FILE"
|
done < "$DOKKU_SCALE_FILE"
|
||||||
|
|
||||||
dokku_log_info1 "Running post-deploy"
|
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"
|
plugn trigger post-deploy "$APP" "$port" "$ipaddr" "$IMAGE_TAG"
|
||||||
|
|
||||||
# kill the old container
|
# kill the old container
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core common plugin"
|
description = "dokku core common plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -150,7 +150,7 @@ config_get() {
|
|||||||
|
|
||||||
config_create "$ENV_FILE"
|
config_create "$ENV_FILE"
|
||||||
if [[ ! -s $ENV_FILE ]]; then
|
if [[ ! -s $ENV_FILE ]]; then
|
||||||
return 0
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local KEY="${*: -1}"
|
local KEY="${*: -1}"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core config plugin"
|
description = "dokku core config plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core docker-options plugin"
|
description = "dokku core docker-options plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -15,6 +15,8 @@ case "$1" in
|
|||||||
domains:enable <app>, Enable VHOST support
|
domains:enable <app>, Enable VHOST support
|
||||||
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
||||||
domains:remove-global <domain> [<domain> ...], Remove global domain names
|
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
|
help_content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ domains_add() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]];then
|
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
|
||||||
domains_enable "$APP" --no-restart
|
domains_enable "$APP" --no-restart
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -105,12 +105,34 @@ domains_remove() {
|
|||||||
plugn trigger post-domains-update "$APP" "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() {
|
domains_disable() {
|
||||||
declare desc="disable domains/VHOST support"
|
declare desc="disable domains/VHOST support"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
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"
|
disable_app_vhost "$APP"
|
||||||
else
|
else
|
||||||
dokku_log_info1 "domains (VHOST) support is already disabled for app ($APP)"
|
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 APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
local DEFAULT_VHOSTS="$(get_default_vhosts "$APP")"
|
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
|
if [[ -n "$DEFAULT_VHOSTS" ]]; then
|
||||||
echo "$DEFAULT_VHOSTS" > "$APP_VHOST_PATH"
|
echo "$DEFAULT_VHOSTS" > "$APP_VHOST_PATH"
|
||||||
fi
|
fi
|
||||||
@@ -148,7 +170,7 @@ domains_add_global() {
|
|||||||
if [[ $(egrep -w "^$DOMAIN$" "$GLOBAL_VHOST_PATH" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
|
if [[ $(egrep -w "^$DOMAIN$" "$GLOBAL_VHOST_PATH" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
|
||||||
dokku_log_info1 "Skipping: $DOMAIN already added"
|
dokku_log_info1 "Skipping: $DOMAIN already added"
|
||||||
else
|
else
|
||||||
echo "$DOMAIN" >> "$GLOBAL_VHOST_PATH"
|
sed -i -e "\$a\\$DOMAIN" "$GLOBAL_VHOST_PATH"
|
||||||
dokku_log_info1 "Added $DOMAIN"
|
dokku_log_info1 "Added $DOMAIN"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -163,3 +185,17 @@ domains_remove_global() {
|
|||||||
dokku_log_info1 "Removed $DOMAIN"
|
dokku_log_info1 "Removed $DOMAIN"
|
||||||
done
|
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]
|
[plugin]
|
||||||
description = "dokku core domains plugin"
|
description = "dokku core domains plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -12,6 +12,11 @@ domains_main_cmd() {
|
|||||||
dokku_log_info2_quiet "Global Domain Name"
|
dokku_log_info2_quiet "Global Domain Name"
|
||||||
get_global_vhosts
|
get_global_vhosts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$APP" == "--global" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "$APP" ]]; then
|
if [[ -n "$APP" ]]; then
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||||
|
|||||||
Executable
+16
@@ -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 "$@"
|
||||||
Executable
+15
@@ -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]
|
[plugin]
|
||||||
description = "dokku core enter plugin"
|
description = "dokku core enter plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
+15
-1
@@ -28,7 +28,7 @@ git_build_app_repo() {
|
|||||||
git remote add origin "$DOKKU_ROOT/$APP" &> /dev/null
|
git remote add origin "$DOKKU_ROOT/$APP" &> /dev/null
|
||||||
git fetch --depth=1 origin "refs/tags/$TMP_TAG" &> /dev/null
|
git fetch --depth=1 origin "refs/tags/$TMP_TAG" &> /dev/null
|
||||||
git reset --hard FETCH_HEAD &> /dev/null
|
git reset --hard FETCH_HEAD &> /dev/null
|
||||||
git submodule update --init --recursive &> /dev/null
|
suppress_output git submodule update --init --recursive
|
||||||
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
|
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
|
||||||
find -name .git -prune -exec rm -rf {} \; > /dev/null
|
find -name .git -prune -exec rm -rf {} \; > /dev/null
|
||||||
|
|
||||||
@@ -41,6 +41,20 @@ git_build_app_repo() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suppress_output() {
|
||||||
|
declare desc="suppress all output from a given command unless there is an error"
|
||||||
|
local TMP_COMMAND_OUTPUT
|
||||||
|
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX")
|
||||||
|
trap 'rm -rf "$TMP_COMMAND_OUTPUT" > /dev/null' RETURN INT TERM EXIT
|
||||||
|
|
||||||
|
"$@" > "$TMP_COMMAND_OUTPUT" 2>&1 || {
|
||||||
|
local exit_code="$?"
|
||||||
|
cat "$TMP_COMMAND_OUTPUT"
|
||||||
|
return "$exit_code"
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
git_hook_cmd() {
|
git_hook_cmd() {
|
||||||
declare desc="kick off receive-app trigger from git prereceive hook"
|
declare desc="kick off receive-app trigger from git prereceive hook"
|
||||||
local cmd="git-hook"
|
local cmd="git-hook"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core git plugin"
|
description = "dokku core git plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core logs plugin"
|
description = "dokku core logs plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
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"
|
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 APP="$1"; local APP_ROOT="$DOKKU_ROOT/$APP"
|
||||||
local container
|
local container
|
||||||
|
|
||||||
@@ -38,4 +38,4 @@ named_containers_post_deploy() {
|
|||||||
shopt -u nullglob
|
shopt -u nullglob
|
||||||
}
|
}
|
||||||
|
|
||||||
named_containers_post_deploy "$@"
|
named_containers_core_post_deploy "$@"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core named containers plugin"
|
description = "dokku core named containers plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -1,26 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help nginx:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help nginx:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | nginx:help)
|
help | nginx:help)
|
||||||
help_content_func () {
|
|
||||||
declare desc="return nginx plugin help content"
|
|
||||||
cat<<help_content
|
|
||||||
nginx, Interact with Dokku's Nginx proxy
|
|
||||||
nginx:build-config <app>, (Re)builds nginx config for given app
|
|
||||||
nginx:access-logs <app> [-t], Show the nginx access logs for an application (-t follows)
|
|
||||||
nginx:error-logs <app> [-t], Show the nginx error logs for an application (-t follows)
|
|
||||||
help_content
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $1 = "nginx:help" ]] ; then
|
if [[ $1 = "nginx:help" ]] ; then
|
||||||
echo -e 'Usage: dokku nginx[:COMMAND]'
|
help_formatted
|
||||||
echo ''
|
|
||||||
echo 'Interact with Dokku'"'"'s Nginx proxy.'
|
|
||||||
echo ''
|
|
||||||
echo 'Additional commands:'
|
|
||||||
help_content_func | sort | column -c2 -t -s,
|
|
||||||
else
|
else
|
||||||
help_content_func
|
help_content_func
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||||
|
|
||||||
nginx_post_deploy() {
|
nginx_core_post_deploy() {
|
||||||
declare desc="nginx-vhosts post-deploy plugin trigger"
|
declare desc="nginx-vhosts core-post-deploy plugin trigger"
|
||||||
local trigger="nginx_post_deploy"
|
local trigger="nginx_core_post_deploy"
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/IP.web.1" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT.web.1" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/IP.web.1" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT.web.1" ]]; then
|
||||||
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
|
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
|
||||||
@@ -21,5 +21,5 @@ nginx_post_deploy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$(get_app_proxy_type "$1")" == "nginx" ]]; then
|
if [[ "$(get_app_proxy_type "$1")" == "nginx" ]]; then
|
||||||
nginx_post_deploy "$@"
|
nginx_core_post_deploy "$@"
|
||||||
fi
|
fi
|
||||||
@@ -6,6 +6,25 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||||
|
|
||||||
|
help_formatted (){
|
||||||
|
echo -e 'Usage: dokku nginx[:COMMAND]'
|
||||||
|
echo ''
|
||||||
|
echo 'Interact with Dokku'"'"'s Nginx proxy.'
|
||||||
|
echo ''
|
||||||
|
echo 'Additional commands:'
|
||||||
|
help_content_func | sort | column -c2 -t -s,
|
||||||
|
}
|
||||||
|
|
||||||
|
help_content_func () {
|
||||||
|
declare desc="return nginx plugin help content"
|
||||||
|
cat<<help_content
|
||||||
|
nginx, Interact with Dokku's Nginx proxy
|
||||||
|
nginx:build-config <app>, (Re)builds nginx config for given app
|
||||||
|
nginx:access-logs <app> [-t], Show the nginx access logs for an application (-t follows)
|
||||||
|
nginx:error-logs <app> [-t], Show the nginx error logs for an application (-t follows)
|
||||||
|
help_content
|
||||||
|
}
|
||||||
|
|
||||||
validate_nginx() {
|
validate_nginx() {
|
||||||
declare desc="validate entire nginx config"
|
declare desc="validate entire nginx config"
|
||||||
set +e
|
set +e
|
||||||
@@ -39,9 +58,9 @@ restart_nginx() {
|
|||||||
sudo /sbin/service nginx reload > /dev/null
|
sudo /sbin/service nginx reload > /dev/null
|
||||||
;;
|
;;
|
||||||
|
|
||||||
arch)
|
arch|centos)
|
||||||
sudo /usr/bin/systemctl reload nginx
|
sudo /usr/bin/systemctl reload nginx
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +167,7 @@ get_custom_nginx_template() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
is_spdy_enabled() {
|
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 NGINX_VERSION="$1"
|
||||||
local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
|
local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
|
||||||
local HAS_SUPPORT=true
|
local HAS_SUPPORT=true
|
||||||
@@ -174,6 +193,33 @@ is_spdy_enabled() {
|
|||||||
echo $HAS_SUPPORT
|
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() {
|
nginx_build_config() {
|
||||||
declare desc="build nginx config to proxy app containers using sigil"
|
declare desc="build nginx config to proxy app containers using sigil"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"; verify_app_name "$APP"
|
||||||
@@ -245,11 +291,19 @@ nginx_build_config() {
|
|||||||
else
|
else
|
||||||
local SSL_VHOSTS=$(< "$DOKKU_ROOT/HOSTNAME")
|
local SSL_VHOSTS=$(< "$DOKKU_ROOT/HOSTNAME")
|
||||||
fi
|
fi
|
||||||
local SSL_SERVER_NAME=$(echo "$SSL_VHOSTS" | xargs)
|
local SSL_SERVER_NAME
|
||||||
|
local host
|
||||||
|
for host in $SSL_VHOSTS; do
|
||||||
|
# SSL_SERVER_NAME should only contain items not in NOSSL_SERVER_NAME
|
||||||
|
if [[ ! $NOSSL_SERVER_NAME =~ (^|[[:space:]])$host($|[[:space:]]) ]]; then
|
||||||
|
SSL_SERVER_NAME="${host}${SSL_SERVER_NAME:+ $SSL_SERVER_NAME}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local NGINX_VERSION="$(nginx -v 2>&1 | cut -d'/' -f 2)"
|
local NGINX_VERSION="$(nginx -v 2>&1 | cut -d'/' -f 2)"
|
||||||
local SPDY_SUPPORTED="$(is_spdy_enabled "$NGINX_VERSION")"
|
local SPDY_SUPPORTED="$(is_spdy_enabled "$NGINX_VERSION")"
|
||||||
|
local HTTP2_SUPPORTED="$(is_http2_enabled "$NGINX_VERSION")"
|
||||||
|
|
||||||
eval "$(config_export app "$APP")"
|
eval "$(config_export app "$APP")"
|
||||||
local SIGIL_PARAMS=(-f $NGINX_TEMPLATE APP="$APP" DOKKU_ROOT="$DOKKU_ROOT"
|
local SIGIL_PARAMS=(-f $NGINX_TEMPLATE APP="$APP" DOKKU_ROOT="$DOKKU_ROOT"
|
||||||
@@ -257,6 +311,7 @@ nginx_build_config() {
|
|||||||
DOKKU_APP_LISTENERS="$DOKKU_APP_LISTENERS"
|
DOKKU_APP_LISTENERS="$DOKKU_APP_LISTENERS"
|
||||||
PASSED_LISTEN_IP_PORT="$PASSED_LISTEN_IP_PORT"
|
PASSED_LISTEN_IP_PORT="$PASSED_LISTEN_IP_PORT"
|
||||||
SPDY_SUPPORTED="$SPDY_SUPPORTED"
|
SPDY_SUPPORTED="$SPDY_SUPPORTED"
|
||||||
|
HTTP2_SUPPORTED="$HTTP2_SUPPORTED"
|
||||||
DOKKU_APP_LISTEN_PORT="$DOKKU_APP_LISTEN_PORT" DOKKU_APP_LISTEN_IP="$DOKKU_APP_LISTEN_IP"
|
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"
|
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"
|
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)
|
arch)
|
||||||
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload nginx, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
|
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
|
esac
|
||||||
|
|
||||||
chmod 0440 /etc/sudoers.d/dokku-nginx
|
chmod 0440 /etc/sudoers.d/dokku-nginx
|
||||||
@@ -66,10 +71,8 @@ case "$DOKKU_DISTRO" in
|
|||||||
"$NGINX_INIT" nginx start || "$NGINX_INIT" nginx reload
|
"$NGINX_INIT" nginx start || "$NGINX_INIT" nginx reload
|
||||||
;;
|
;;
|
||||||
|
|
||||||
arch)
|
arch|centos)
|
||||||
NGINX_INIT="/usr/bin/systemctl"
|
NGINX_INIT="/usr/bin/systemctl"
|
||||||
"$NGINX_INIT" start nginx || "$NGINX_INIT" reload nginx
|
"$NGINX_INIT" start nginx || "$NGINX_INIT" reload nginx
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core nginx-vhosts plugin"
|
description = "dokku core nginx-vhosts plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||||
|
|
||||||
|
nginx_main_cmd() {
|
||||||
|
declare desc="display nginx plugin help content"
|
||||||
|
local cmd="nginx"
|
||||||
|
help_formatted
|
||||||
|
}
|
||||||
|
|
||||||
|
nginx_main_cmd "$@"
|
||||||
@@ -38,8 +38,8 @@ server {
|
|||||||
}
|
}
|
||||||
{{ else if eq $scheme "https"}}
|
{{ else if eq $scheme "https"}}
|
||||||
server {
|
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 if eq $.HTTP2_SUPPORTED "true" }}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 }};
|
||||||
{{ if $.SSL_SERVER_NAME }}server_name {{ $.SSL_SERVER_NAME }}; {{ end }}
|
{{ if $.SSL_SERVER_NAME }}server_name {{ $.SSL_SERVER_NAME }}; {{ end }}
|
||||||
{{ if $.NOSSL_SERVER_NAME }}server_name {{ $.NOSSL_SERVER_NAME }}; {{ end }}
|
{{ if $.NOSSL_SERVER_NAME }}server_name {{ $.NOSSL_SERVER_NAME }}; {{ end }}
|
||||||
access_log /var/log/nginx/{{ $.APP }}-access.log;
|
access_log /var/log/nginx/{{ $.APP }}-access.log;
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ uninstall_plugin() {
|
|||||||
local PLUGIN="$1"
|
local PLUGIN="$1"
|
||||||
[[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot uninstall a core plugin"
|
[[ -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"
|
[[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed"
|
||||||
|
plugn trigger uninstall "$PLUGIN"
|
||||||
plugn uninstall "$PLUGIN"
|
plugn uninstall "$PLUGIN"
|
||||||
dokku_log_info1_quiet "Plugin $PLUGIN uninstalled"
|
dokku_log_info1_quiet "Plugin $PLUGIN uninstalled"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core plugin plugin"
|
description = "dokku core plugin plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core proxy plugin"
|
description = "dokku core proxy plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -6,13 +6,14 @@ source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
|||||||
proxy_main_cmd() {
|
proxy_main_cmd() {
|
||||||
declare desc="displays app proxy implementation via command line"
|
declare desc="displays app proxy implementation via command line"
|
||||||
local cmd="proxy"
|
local cmd="proxy"
|
||||||
local ALL_APPS=$(dokku_apps)
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
if [[ -n "$2" ]]; then
|
local APPS=$(dokku_apps)
|
||||||
local APP="$2"
|
if [[ -n "$1" ]]; then
|
||||||
|
local APPS="$1"
|
||||||
fi
|
fi
|
||||||
local APPS=${APP:="$ALL_APPS"}
|
|
||||||
|
|
||||||
dokku_col_log_info1_quiet "App Name" "Proxy Type"
|
dokku_col_log_info1_quiet "App Name" "Proxy Type"
|
||||||
|
local app
|
||||||
for app in $APPS; do
|
for app in $APPS; do
|
||||||
verify_app_name "$app"
|
verify_app_name "$app"
|
||||||
dokku_col_log_msg "$app" "$(get_app_proxy_type "$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/config/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||||
|
|
||||||
ps_post_deploy() {
|
ps_core_post_deploy() {
|
||||||
declare desc="ps post-deploy plugin trigger"
|
declare desc="ps core-post-deploy plugin trigger"
|
||||||
local trigger="ps_post_deploy"
|
local trigger="ps_core_post_deploy"
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
|
|
||||||
remove_procfile "$APP"
|
remove_procfile "$APP"
|
||||||
config_set --no-restart "$APP" DOKKU_APP_RESTORE=1
|
config_set --no-restart "$APP" DOKKU_APP_RESTORE=1
|
||||||
}
|
}
|
||||||
|
|
||||||
ps_post_deploy "$@"
|
ps_core_post_deploy "$@"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core ps plugin"
|
description = "dokku core ps plugin"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
@@ -7,11 +7,20 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
|||||||
ps_restore_cmd() {
|
ps_restore_cmd() {
|
||||||
declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line"
|
declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line"
|
||||||
local cmd="ps:restore"
|
local cmd="ps:restore"
|
||||||
|
|
||||||
|
if which parallel > /dev/null 2>&1; then
|
||||||
|
dokku_apps | parallel dokku ps:start
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
for app in $(dokku_apps); do
|
for app in $(dokku_apps); do
|
||||||
local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true)
|
local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true)
|
||||||
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
|
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
|
||||||
echo "Restoring app $app ..."
|
echo "Restoring app $app ..."
|
||||||
ps_start "$app"
|
if ps_start "$app"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
dokku_log_warn "dokku ps:restore ${app} failed"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ case "$1" in
|
|||||||
help_content_func () {
|
help_content_func () {
|
||||||
declare desc="return repo plugin help content"
|
declare desc="return repo plugin help content"
|
||||||
cat<<help_content
|
cat<<help_content
|
||||||
repo:gc <app>, Runs 'git gc --agressive' against the application's repo
|
repo:gc <app>, Runs 'git gc --aggressive' against the application's repo
|
||||||
repo:purge-cache <app>, Deletes the contents of the build cache stored in the repository
|
repo:purge-cache <app>, Deletes the contents of the build cache stored in the repository
|
||||||
help_content
|
help_content
|
||||||
}
|
}
|
||||||
|
|||||||
Loaded 100 of 121 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user