Compare commits
138 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8653f97b7 | ||
|
|
a5e6739e16 | ||
|
|
dd7d1d2f8d | ||
|
|
2a747138af | ||
|
|
32027da467 | ||
|
|
3dd583213c | ||
|
|
91f4de2f68 | ||
|
|
4b8acf5c34 | ||
|
|
53e272ab22 | ||
|
|
6decb6f19a | ||
|
|
ce3b8c3d5c | ||
|
|
b86fb133b2 | ||
|
|
6d68ddfcb9 | ||
|
|
827354d3d1 | ||
|
|
81ab56d7ee | ||
|
|
58a7e535dd | ||
|
|
721b464de9 | ||
|
|
accfc3b793 | ||
|
|
80b20ec4c1 | ||
|
|
a355b8019a | ||
|
|
1494e07c34 | ||
|
|
c9cf213afb | ||
|
|
291e052ece | ||
|
|
72deeec81f | ||
|
|
5e6630f042 | ||
|
|
b44aa8b8ea | ||
|
|
ad2d219691 | ||
|
|
986400c8e2 | ||
|
|
48ee225dbe | ||
|
|
9f395318b3 | ||
|
|
3f0051a04f | ||
|
|
8841f91767 | ||
|
|
afc2d13b40 | ||
|
|
45395743fe | ||
|
|
1d1458862b | ||
|
|
92c81cc05d | ||
|
|
60bed60fa9 | ||
|
|
baec410580 | ||
|
|
77e51a39fa | ||
|
|
907f2d6344 | ||
|
|
0a9997ee3a | ||
|
|
ed60adfdc8 | ||
|
|
1406283b63 | ||
|
|
e34d8431da | ||
|
|
09a5c292cd | ||
|
|
9f9ebc99ec | ||
|
|
35ed98ae71 | ||
|
|
8f70e25e12 | ||
|
|
605bbb165a | ||
|
|
54703c9216 | ||
|
|
daf03a6389 | ||
|
|
e67324cac9 | ||
|
|
8ab1abd3b4 | ||
|
|
23731f6561 | ||
|
|
9fe3f49cb4 | ||
|
|
750a31013f | ||
|
|
814385eda9 | ||
|
|
438261b1f9 | ||
|
|
2044496750 | ||
|
|
798793f7f8 | ||
|
|
e799709391 | ||
|
|
2326195eea | ||
|
|
40564464f9 | ||
|
|
54c987ea16 | ||
|
|
a513047e5a | ||
|
|
1c17e43bb7 | ||
|
|
431dc6c1a0 | ||
|
|
8bb559c965 | ||
|
|
50863a9b76 | ||
|
|
a1860bae14 | ||
|
|
fa8267ca09 | ||
|
|
9dae004651 | ||
|
|
f9e163c63a | ||
|
|
e561f87b17 | ||
|
|
78621481a6 | ||
|
|
92de37b23a | ||
|
|
360c587086 | ||
|
|
844b86840a | ||
|
|
24c47e17f8 | ||
|
|
8c6e4c6483 | ||
|
|
34b5234e2f | ||
|
|
b05a2b6da2 | ||
|
|
9ed22eafea | ||
|
|
498bdd0491 | ||
|
|
92ac9cc729 | ||
|
|
9c68cd53fc | ||
|
|
3b3fc5d5c1 | ||
|
|
b4e95fe0d5 | ||
|
|
7bd4d32cb3 | ||
|
|
903d7ce614 | ||
|
|
12f3c12070 | ||
|
|
cb281e17e6 | ||
|
|
06b565f3e5 | ||
|
|
798725bb54 | ||
|
|
a3ef91f2ae | ||
|
|
cd28fe69a5 | ||
|
|
f1ead08549 | ||
|
|
6e3fddb544 | ||
|
|
dd2bbc7722 | ||
|
|
a9ce738f68 | ||
|
|
0e219b05e9 | ||
|
|
ea9cf024d5 | ||
|
|
0d1952592e | ||
|
|
43e7ee06fb | ||
|
|
692bfa7cde | ||
|
|
dbcfb7ee9f | ||
|
|
5f80cd3c20 | ||
|
|
eecee94e70 | ||
|
|
f55dc640ec | ||
|
|
a4ac67a1e0 | ||
|
|
14838de344 | ||
|
|
6b6b1c2aa4 | ||
|
|
8662f4550f | ||
|
|
78dba3be3c | ||
|
|
76911a7dc8 | ||
|
|
68de421630 | ||
|
|
ccbe0b0877 | ||
|
|
6a7d2e5252 | ||
|
|
f83a03a3dc | ||
|
|
44fcea0ffa | ||
|
|
c02059c965 | ||
|
|
92d2895d99 | ||
|
|
2b93c76b1d | ||
|
|
8cbaf1e004 | ||
|
|
b4c4d5d70f | ||
|
|
a00d9de400 | ||
|
|
a36ebd130d | ||
|
|
5b1763aa4a | ||
|
|
53c8f61ffc | ||
|
|
b806154e90 | ||
|
|
1be6ace7b5 | ||
|
|
9d9530b01d | ||
|
|
c4838b4af9 | ||
|
|
5ca3ca5189 | ||
|
|
3457844687 | ||
|
|
346e8284c8 | ||
|
|
180a5e79c9 | ||
|
|
377166d822 |
@@ -7,6 +7,7 @@ build
|
||||
docs
|
||||
tests
|
||||
!build/dokku.deb
|
||||
!tests/dhparam.pem
|
||||
!contrib/dokku-installer.py
|
||||
!contrib/dokku-update
|
||||
!contrib/bash-completion
|
||||
|
||||
20
Dockerfile
20
Dockerfile
@@ -10,22 +10,25 @@ ARG DOKKU_SKIP_KEY_FILE=true
|
||||
ARG DOKKU_VHOST_ENABLE=false
|
||||
ARG DOKKU_WEB_CONFIG=false
|
||||
|
||||
COPY ./build/dokku.deb /tmp/dokku.deb
|
||||
|
||||
RUN addgroup --gid $DOKKU_GID dokku \
|
||||
&& adduser --uid $DOKKU_UID --gid $DOKKU_GID --disabled-password --gecos "" "dokku"
|
||||
|
||||
COPY ./tests/dhparam.pem /tmp/dhparam.pem
|
||||
COPY ./build/dokku.deb /tmp/dokku.deb
|
||||
RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \
|
||||
&& echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \
|
||||
&& echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \
|
||||
&& echo "dokku dokku/web_config boolean $DOKKU_WEB_CONFIG" | debconf-set-selections \
|
||||
&& curl -sSL https://packagecloud.io/dokku/dokku/gpgkey | apt-key add - \
|
||||
&& echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ bionic main" | tee /etc/apt/sources.list.d/dokku.list \
|
||||
&& mkdir -p /etc/nginx/ \
|
||||
&& cp /tmp/dhparam.pem /etc/nginx/dhparam.pem \
|
||||
&& apt-get update -qq \
|
||||
&& apt-get install --no-install-recommends --only-upgrade -y -qq openssl openssh-server \
|
||||
&& apt --no-install-recommends -qq -y install rsync /tmp/dokku.deb \
|
||||
&& apt-get purge -y -q syslog-ng-core \
|
||||
&& apt-get autoremove -y -q \
|
||||
&& apt-get upgrade -qq -y \
|
||||
&& apt-get install --no-install-recommends --only-upgrade -qq -y openssl openssh-server \
|
||||
&& apt install --no-install-recommends -qq -y rsync /tmp/dokku.deb \
|
||||
&& apt-get purge -qq -y syslog-ng-core \
|
||||
&& apt-get autoremove -qq -y \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
WORKDIR /tmp
|
||||
@@ -47,6 +50,7 @@ RUN \
|
||||
&& ln -sf /mnt/dokku/var/lib/dokku/config /var/lib/dokku/config \
|
||||
&& ln -sf /mnt/dokku/var/lib/dokku/data /var/lib/dokku/data \
|
||||
&& mv /etc/my_init.d/00_regen_ssh_host_keys.sh /etc/my_init.d/15_regen_ssh_host_keys \
|
||||
&& rm /etc/nginx/sites-enabled/default /usr/share/nginx/html/index.html /etc/my_init.d/10_syslog-ng.init \
|
||||
&& rm -f /etc/nginx/sites-enabled/default /usr/share/nginx/html/index.html /etc/my_init.d/10_syslog-ng.init \
|
||||
&& rm -f /usr/local/openresty/nginx/conf/sites-enabled/default /usr/share/openresty/html/index.html \
|
||||
&& sed -i '/imklog/d' /etc/rsyslog.conf \
|
||||
&& rm /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/* /var/log/nginx/*
|
||||
&& rm -f /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/* /var/log/nginx/* /var/log/openresty/*
|
||||
|
||||
165
HISTORY.md
165
HISTORY.md
@@ -1,5 +1,170 @@
|
||||
# History
|
||||
|
||||
## 0.19.7
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Documentation
|
||||
|
||||
- #3765: @znz Fix typo in desc of is_tls13_available
|
||||
|
||||
### Other
|
||||
|
||||
- #3739: @safeforge dokku run do not supports interactive mode.
|
||||
- #3762: @dependabot-preview[bot] chore(deps): bump handlebars from 4.4.5 to 4.5.1 in /tests/apps/.websocket.disabled
|
||||
|
||||
## 0.19.6
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.6/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.6 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Other
|
||||
|
||||
- #3761: @pithyless Fix type-errors in dokku-installer.py
|
||||
- #3759: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 163 to 164 in /tests/apps/php
|
||||
- #3758: @dependabot-preview[bot] chore(deps): bump jetty-servlet from 9.4.21.v20190926 to 9.4.22.v20191022 in /tests/apps/java
|
||||
|
||||
## 0.19.5
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.5/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.5 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #3756: @jayjun Redirect missing key_file warning to stderr
|
||||
|
||||
## 0.19.4
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.4/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.4 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #3755: @dean1012 Warn if key_file is missing on install but do not exit
|
||||
|
||||
## 0.19.3
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.3 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #3753: @josegonzalez Always use python3 for the installer
|
||||
|
||||
### Other
|
||||
|
||||
- #3743: @dependabot-preview[bot] chore(deps): [security] bump express from 3.1.2 to 4.17.1 in /tests/apps/.websocket.disabled
|
||||
- #3744: @dependabot-preview[bot] chore(deps): [security] bump handlebars from 1.0.12 to 4.4.5 in /tests/apps/.websocket.disabled
|
||||
- #3750: @dependabot-preview[bot] chore(deps): [security] bump express from 2.5.11 to 4.17.1 in /tests/apps/dockerfile-procfile-bad
|
||||
- #3745: @dependabot-preview[bot] chore(deps): [security] bump express from 3.3.8 to 4.17.1 in /tests/apps/gitsubmodules
|
||||
- #3742: @dependabot-preview[bot] chore(deps): [security] bump express from 2.5.11 to 4.17.1 in /tests/apps/nodejs-express-noprocfile
|
||||
- #3729: @dependabot-preview[bot] chore(deps): bump monolog/monolog from 1.12.0 to 1.25.1 in /tests/apps/php
|
||||
- #3732: @dependabot-preview[bot] chore(deps): bump silex/silex from 1.2.3 to 2.2.4 in /tests/apps/php
|
||||
- #3728: @dependabot-preview[bot] chore(deps): bump jetty-servlet from 7.6.0.v20120127 to 9.4.21.v20190926 in /tests/apps/java
|
||||
- #3730: @dependabot-preview[bot] chore(deps): bump werkzeug from 0.15.6 to 0.16.0 in /tests/apps/python-flask
|
||||
- #3737: @dependabot-preview[bot] chore(deps): bump express3-handlebars from 0.2.3 to 0.5.2 in /tests/apps/.websocket.disabled
|
||||
- #3734: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 59 to 163 in /tests/apps/php
|
||||
- #3735: @dependabot-preview[bot] chore(deps): [security] bump symfony/http-kernel from 2.6.4 to 2.8.51 in /tests/apps/php
|
||||
- #3723: @dependabot-preview[bot] chore(deps): bump sass-globbing from 1.1.1 to 1.1.5 in /tests/apps/multi
|
||||
- #3731: @dependabot-preview[bot] chore(deps): bump jinja2 from 2.10.1 to 2.10.3 in /tests/apps/python-flask
|
||||
- #3736: @dependabot-preview[bot] chore(deps): bump socket.io from 0.9.19 to 2.3.0 in /tests/apps/.websocket.disabled
|
||||
- #3726: @dependabot-preview[bot] chore(deps): bump google.golang.org/grpc from 1.23.0 to 1.24.0 in /tests/apps/gogrpc
|
||||
- #3727: @dependabot-preview[bot] chore(deps): bump maven-dependency-plugin from 2.4 to 3.1.1 in /tests/apps/java
|
||||
- #3733: @dependabot-preview[bot] chore(deps): [security] bump symfony/http-foundation from 2.6.4 to 2.8.50 in /tests/apps/php
|
||||
- #3720: @dependabot-preview[bot] chore(deps): bump compass from 1.0.1 to 1.0.3 in /tests/apps/multi
|
||||
- #3721: @dependabot-preview[bot] chore(deps): bump sinatra from 1.4.4 to 1.4.8 in /tests/apps/ruby
|
||||
- #3719: @dependabot-preview[bot] chore(deps): bump thin from 1.6.1 to 1.7.2 in /tests/apps/ruby
|
||||
|
||||
## 0.19.2
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.2 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #3718: @josegonzalez Detect correct python binary to use
|
||||
|
||||
## 0.19.1
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.1/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.1 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #3713: @josegonzalez Require nginx 1.13+ in order to enable tls1.3
|
||||
|
||||
## 0.19.0
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.0/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.0 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #3688: @josegonzalez Correct shfmt issues
|
||||
- #3684: @josegonzalez Do not push betafish releases to docker hub
|
||||
- #3681: @josegonzalez Proper openresty support
|
||||
|
||||
### New Features
|
||||
|
||||
- #3687: @josegonzalez Add scheduler-post-run trigger
|
||||
- #3702: @josegonzalez Cleanup build and destroy logging output
|
||||
- #3693: @josegonzalez Remove ssh-keys user-auth trigger in favor of direct check in dokku binary
|
||||
- #3691: @josegonzalez Silence trigger logging
|
||||
- #3685: @josegonzalez Allow passing labels to one-off dokku containers
|
||||
- #3680: @josegonzalez Follow updated intermediate recommendations from the Mozilla SSL Config Generator
|
||||
- #3677: @josegonzalez Improve package build process
|
||||
- #3679: @josegonzalez Allow keeping the git directory during builds
|
||||
- #3577: @josegonzalez Use new-style docker management commands
|
||||
- #3678: @josegonzalez Add container-type to run and deploy containers
|
||||
- #3671: @josegonzalez Allow overriding checks doc url
|
||||
- #3662: @leshik Improve nginx ciphers compatibility
|
||||
- #3668: @josegonzalez Release latest docker image on release
|
||||
- #3659: @fzerorubigd Add support for grpc/grpcs port forwarding
|
||||
- #3690: @josegonzalez Add support for python3
|
||||
|
||||
### Documentation
|
||||
|
||||
- #3701: @limenet Docs / Getting Started: use HTTPS instead of SSH for clone
|
||||
- #3699: @robhudson Add `dokku cleanup` to help output
|
||||
- #3669: @josegonzalez Fix reference to CHECKS file location
|
||||
|
||||
### Tests
|
||||
|
||||
- #3670: @josegonzalez Upgrade all python test deps
|
||||
|
||||
## 0.18.5
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
@@ -91,13 +91,16 @@ A fresh VM running any of the following operating systems:
|
||||
- CentOS 7 x64 *(experimental)*
|
||||
- Arch Linux x64 *(experimental)*
|
||||
|
||||
An SSH keypair that can be used for application deployment. If this exists before installation, it will be automatically imported into dokku.
|
||||
Otherwise, you will need to import the keypair manually after installation using `dokku ssh-keys:add`.
|
||||
|
||||
## Installation
|
||||
|
||||
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.18.5/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.18.5 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.19.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||
|
||||
37
common.mk
37
common.mk
@@ -1,4 +1,41 @@
|
||||
GO_ARGS ?= -a
|
||||
GO_REPO_ROOT := /go/src/github.com/dokku/dokku
|
||||
BUILD_IMAGE := golang:1.12
|
||||
|
||||
.PHONY: build-in-docker build clean src-clean
|
||||
|
||||
build: $(BUILD)
|
||||
|
||||
build-in-docker: clean
|
||||
mkdir -p /tmp/dokku-go-build-cache
|
||||
docker run --rm \
|
||||
-v $$PWD/../..:$(GO_REPO_ROOT) \
|
||||
-v /tmp/dokku-go-build-cache:/root/.cache/go-build \
|
||||
-e PLUGIN_NAME=$(PLUGIN_NAME) \
|
||||
-w $(GO_REPO_ROOT)/plugins/$(PLUGIN_NAME) \
|
||||
$(BUILD_IMAGE) \
|
||||
bash -c "GO_ARGS='$(GO_ARGS)' make -j4 build" || exit $$?
|
||||
|
||||
clean:
|
||||
rm -rf commands subcommands triggers
|
||||
find . -xtype l -delete
|
||||
|
||||
commands: **/**/commands.go
|
||||
go build $(GO_ARGS) -o commands src/commands/commands.go
|
||||
|
||||
subcommands:
|
||||
go build $(GO_ARGS) -o subcommands/subcommands src/subcommands/subcommands.go
|
||||
$(MAKE) $(SUBCOMMANDS)
|
||||
|
||||
subcommands/%:
|
||||
ln -sf subcommands $@
|
||||
|
||||
src-clean:
|
||||
rm -rf .gitignore src vendor Makefile *.go glide.*
|
||||
|
||||
triggers:
|
||||
go build $(GO_ARGS) -o triggers src/triggers/triggers.go
|
||||
$(MAKE) $(TRIGGERS)
|
||||
|
||||
triggers/%:
|
||||
ln -sf triggers $(shell echo $@ | cut -d '/' -f2)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# bash completion for dd -*- shell-script -*-
|
||||
# bash completion for dokku -*- shell-script -*-
|
||||
|
||||
_dokku_complete_verify() {
|
||||
declare desc="shows bash completion"
|
||||
|
||||
@@ -42,7 +42,7 @@ def main():
|
||||
download_urls['downloads/' + version['filename']] = version['download_url']
|
||||
|
||||
for filename, download_url in download_urls.items():
|
||||
print "downloading", filename
|
||||
print("downloading {0}".format(filename))
|
||||
download_file(filename, download_url)
|
||||
upload_file(filename)
|
||||
|
||||
|
||||
@@ -1,23 +1,44 @@
|
||||
#!/usr/bin/env python2.7
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import cgi
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
try:
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
except ImportError:
|
||||
import http.server as SimpleHTTPServer
|
||||
import socketserver as SocketServer
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.18.5'
|
||||
VERSION = 'v0.19.7'
|
||||
|
||||
def bytes_to_string(b):
|
||||
if type(b) == bytes:
|
||||
encoding = sys.stdout.encoding
|
||||
if encoding is None:
|
||||
encoding = 'utf-8'
|
||||
b = b.decode(encoding)
|
||||
b = b.strip()
|
||||
return b
|
||||
|
||||
|
||||
def string_to_bytes(s):
|
||||
if type(s) == str:
|
||||
encoding = sys.stdout.encoding
|
||||
if encoding is None:
|
||||
encoding = 'utf-8'
|
||||
s = s.encode(encoding)
|
||||
return s
|
||||
|
||||
|
||||
hostname = ''
|
||||
try:
|
||||
command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'"
|
||||
hostname = subprocess.check_output(command, shell=True)
|
||||
if ':' in hostname:
|
||||
hostname = ''
|
||||
hostname = bytes_to_string(subprocess.check_output(command, shell=True))
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
@@ -33,26 +54,37 @@ admin_keys = []
|
||||
if os.path.isfile(key_file):
|
||||
try:
|
||||
command = "cat {0}".format(key_file)
|
||||
admin_keys = subprocess.check_output(command, shell=True).strip().split("\n")
|
||||
admin_keys = bytes_to_string(subprocess.check_output(command, shell=True)).strip().split("\n")
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
ufw_display = 'block'
|
||||
try:
|
||||
command = "sudo ufw status"
|
||||
ufw_output = subprocess.check_output(command, shell=True).strip()
|
||||
ufw_output = bytes_to_string(subprocess.check_output(command, shell=True).strip())
|
||||
if "inactive" in ufw_output:
|
||||
ufw_display = 'none'
|
||||
except subprocess.CalledProcessError:
|
||||
ufw_display = 'none'
|
||||
|
||||
|
||||
nginx_dir = '/etc/nginx'
|
||||
nginx_init = '/etc/init.d/nginx'
|
||||
try:
|
||||
command = "test -x /usr/bin/openresty"
|
||||
subprocess.check_output(command, shell=True)
|
||||
nginx_dir = '/usr/local/openresty/nginx/conf'
|
||||
nginx_init = '/etc/init.d/openresty'
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
|
||||
def check_boot():
|
||||
if 'onboot' not in sys.argv:
|
||||
return
|
||||
init_dir = os.getenv('INIT_DIR', '/etc/init')
|
||||
systemd_dir = os.getenv('SYSTEMD_DIR', '/etc/systemd/system')
|
||||
nginx_dir = os.getenv('NGINX_DIR', '/etc/nginx/conf.d')
|
||||
nginx_conf_dir = os.getenv('NGINX_CONF_DIR', '{0}/conf.d'.format(nginx_dir))
|
||||
|
||||
if os.path.exists(init_dir):
|
||||
with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f:
|
||||
@@ -69,8 +101,8 @@ def check_boot():
|
||||
f.write("[Install]\n")
|
||||
f.write("WantedBy=multi-user.target\n")
|
||||
f.write("WantedBy=graphical.target\n")
|
||||
if os.path.exists(nginx_dir):
|
||||
with open('{0}/dokku-installer.conf'.format(nginx_dir), 'w') as f:
|
||||
if os.path.exists(nginx_conf_dir):
|
||||
with open('{0}/dokku-installer.conf'.format(nginx_conf_dir), 'w') as f:
|
||||
f.write("upstream dokku-installer { server 127.0.0.1:2000; }\n")
|
||||
f.write("server {\n")
|
||||
f.write(" listen 80;\n")
|
||||
@@ -79,11 +111,18 @@ def check_boot():
|
||||
f.write(" }\n")
|
||||
f.write("}\n")
|
||||
|
||||
subprocess.call('rm -f /etc/nginx/sites-enabled/*', shell=True)
|
||||
subprocess.call('rm -f {0}/sites-enabled/*'.format(nginx_dir), shell=True)
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
def write_content(self, content):
|
||||
try:
|
||||
self.wfile.write(content)
|
||||
except TypeError:
|
||||
self.wfile.write(string_to_bytes(content))
|
||||
|
||||
|
||||
def do_GET(self):
|
||||
content = PAGE.replace('{VERSION}', VERSION)
|
||||
content = content.replace('{UFW_DISPLAY}', ufw_display)
|
||||
@@ -92,7 +131,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
|
||||
self.send_response(200)
|
||||
self.end_headers()
|
||||
self.wfile.write(content)
|
||||
self.write_content(content)
|
||||
|
||||
def do_POST(self):
|
||||
if self.path not in ['/setup', '/setup/']:
|
||||
@@ -133,7 +172,10 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
user = user + str(index)
|
||||
command = ['sshcommand', 'acl-add', 'dokku', user]
|
||||
proc = subprocess.Popen(command, stdin=subprocess.PIPE)
|
||||
proc.stdin.write(key)
|
||||
try:
|
||||
proc.stdin.write(key)
|
||||
except TypeError:
|
||||
proc.stdin.write(string_to_bytes(key))
|
||||
proc.stdin.close()
|
||||
proc.wait()
|
||||
|
||||
@@ -146,9 +188,11 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
if 'selfdestruct' in sys.argv:
|
||||
DeleteInstallerThread()
|
||||
|
||||
content = json.dumps({'status': 'ok'})
|
||||
|
||||
self.send_response(200)
|
||||
self.end_headers()
|
||||
self.wfile.write(json.dumps({'status': 'ok'}))
|
||||
self.write_content(content)
|
||||
|
||||
def web_admin_user_exists(self):
|
||||
return self.user_exists('web-admin(\d+)')
|
||||
@@ -163,11 +207,11 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
max_num = 0
|
||||
exists = False
|
||||
for line in proc.stdout:
|
||||
m = pattern.search(line)
|
||||
m = pattern.search(bytes_to_string(line))
|
||||
if m:
|
||||
# User of the form `user` or `user#` exists
|
||||
exists = True
|
||||
max_num = max(max_num, m.group(1))
|
||||
max_num = max(max_num, int(m.group(1)))
|
||||
if exists:
|
||||
return max_num
|
||||
else:
|
||||
@@ -203,7 +247,7 @@ class DeleteInstallerThread(object):
|
||||
thread.start()
|
||||
|
||||
def run(self):
|
||||
command = "rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start"
|
||||
command = "rm {0}/conf.d/dokku-installer.conf && {1} stop && {1} start".format(nginx_dir, nginx_init)
|
||||
try:
|
||||
subprocess.call(command, shell=True)
|
||||
except:
|
||||
@@ -221,7 +265,7 @@ def main():
|
||||
|
||||
port = int(os.getenv('PORT', 2000))
|
||||
httpd = SocketServer.TCPServer(("", port), GetHandler)
|
||||
print "Listening on 0.0.0.0:{0}, CTRL+C to stop".format(port)
|
||||
print("Listening on 0.0.0.0:{0}, CTRL+C to stop".format(port))
|
||||
httpd.serve_forever()
|
||||
|
||||
|
||||
|
||||
@@ -323,7 +323,6 @@ fn-build-docker-image() {
|
||||
declare desc="Builds the dokku docker image and tags it with the given version"
|
||||
declare VERSION="$1"
|
||||
docker build -t "dokku/dokku:$VERSION" .
|
||||
docker push "dokku/dokku:$VERSION"
|
||||
}
|
||||
|
||||
main() {
|
||||
@@ -365,10 +364,18 @@ main() {
|
||||
fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
|
||||
cp -f "build/dokku_${NEXT_VERSION}_amd64.deb" build/dokku.deb
|
||||
|
||||
if [[ "$RELEASE" != "build" ]]; then
|
||||
if [[ "$RELEASE" == "build" ]]; then
|
||||
fn-build-docker-image "latest" || log-fail "Error building docker image"
|
||||
else
|
||||
fn-publish-package "$IS_RELEASE" "deb" "build/dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
|
||||
fn-publish-package "$IS_RELEASE" "rpm" "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
|
||||
fn-build-docker-image "$NEXT_VERSION" || log-fail "Error building docker image"
|
||||
|
||||
if [[ "$IS_RELEASE" == "true" ]]; then
|
||||
docker tag "dokku/dokku:$NEXT_VERSION" "dokku/dokku:latest"
|
||||
docker push "dokku/dokku:$NEXT_VERSION"
|
||||
docker push "dokku/dokku:latest"
|
||||
fi
|
||||
fn-repo-push-tags "$IS_RELEASE"
|
||||
fi
|
||||
|
||||
|
||||
6
debian/control
vendored
6
debian/control
vendored
@@ -1,11 +1,11 @@
|
||||
Package: dokku
|
||||
Version: 0.18.5
|
||||
Version: 0.19.7
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: locales, git, curl, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.7.1) | docker-engine (>= 1.7.1) | docker-io (>= 1.7.1) | docker.io (>= 1.7.1) | docker-ce | docker-ee, net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog, dos2unix
|
||||
Depends: locales, git, curl, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.13.0) | docker-engine (>= 1.13.0) | docker-io (>= 1.13.0) | docker.io (>= 1.13.0) | docker-ce (>= 1.13.0) | docker-ee (>= 1.13.0), net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
|
||||
Recommends: herokuish (>= 0.3.4), parallel, dokku-update
|
||||
Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python2.7, debconf
|
||||
Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf
|
||||
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
Description: Docker-powered PaaS that helps build and manage the lifecycle of applications
|
||||
Dokku is an extensible, open source Platform as a Service
|
||||
|
||||
7
debian/lintian-overrides
vendored
7
debian/lintian-overrides
vendored
@@ -1,5 +1,5 @@
|
||||
dokku: command-with-path-in-maintainer-script postinst:16 /usr/bin/sshcommand
|
||||
dokku: maintainer-script-calls-systemctl postinst:87
|
||||
dokku: command-with-path-in-maintainer-script postinst:22 /usr/bin/sshcommand
|
||||
dokku: maintainer-script-calls-systemctl postinst:98
|
||||
dokku: changelog-file-missing-in-native-package
|
||||
dokku: statically-linked-binary
|
||||
dokku: unstripped-binary-or-object
|
||||
@@ -10,3 +10,6 @@ dokku: hardening-no-relro
|
||||
|
||||
# Built golang binaries link to libc
|
||||
dokku: missing-dependency-on-libc
|
||||
|
||||
# Temporary python dependency until #2247 is resolved
|
||||
dokku: python-script-but-no-python-dep usr/share/dokku/contrib/dokku-installer.py
|
||||
|
||||
11
debian/postinst
vendored
11
debian/postinst
vendored
@@ -89,7 +89,16 @@ setup-sshcommand() {
|
||||
}
|
||||
|
||||
setup-dokku-installer() {
|
||||
if [[ -f /etc/nginx/conf.d/dokku-installer.conf ]]; then
|
||||
NGINX_ROOT="/etc/nginx"
|
||||
[[ -x /usr/bin/openresty ]] && NGINX_ROOT="/usr/local/openresty/nginx/conf"
|
||||
|
||||
if command -v "python3" &>/dev/null; then
|
||||
sed -i '1 s/^.*$/#!\/usr\/bin\/env python3/' /usr/share/dokku/contrib/dokku-installer.py
|
||||
elif command -v "python2.7" &>/dev/null; then
|
||||
sed -i '1 s/^.*$/#!\/usr\/bin\/env python2.7/' /usr/share/dokku/contrib/dokku-installer.py
|
||||
fi
|
||||
|
||||
if [[ -f "$NGINX_ROOT/conf.d/dokku-installer.conf" ]]; then
|
||||
echo "Setting up dokku-installer"
|
||||
/usr/share/dokku/contrib/dokku-installer.py onboot
|
||||
|
||||
|
||||
2
debian/postrm
vendored
2
debian/postrm
vendored
@@ -28,6 +28,8 @@ main() {
|
||||
fi
|
||||
|
||||
if [[ "$1" == "purge" ]]; then
|
||||
rm -f /usr/local/openresty/nginx/conf/conf.d/dokku.conf
|
||||
rm -f /usr/local/openresty/nginx/conf/conf.d/dokku-installer.conf
|
||||
rm -f /etc/nginx/conf.d/dokku.conf
|
||||
rm -f /etc/nginx/conf.d/dokku-installer.conf
|
||||
rm -f ${DOKKU_ROOT}/.dokkurc ${DOKKU_ROOT}/dokkurc ${DOKKU_ROOT}/tls
|
||||
|
||||
79
debian/preinst
vendored
79
debian/preinst
vendored
@@ -7,51 +7,62 @@ if [[ -e /usr/share/debconf/confmodule ]]; then
|
||||
. /usr/share/debconf/confmodule
|
||||
fi
|
||||
|
||||
setup_dokku_installer() {
|
||||
NGINX_BASE_PATH="$1"
|
||||
NGINX_INIT_NAME="$2"
|
||||
|
||||
NGINX_CONF="${NGINX_BASE_PATH}/conf.d/dokku-installer.conf"
|
||||
|
||||
rm -f $NGINX_CONF
|
||||
touch $NGINX_CONF
|
||||
|
||||
{
|
||||
echo 'upstream dokku-installer { server 127.0.0.1:2000; }'
|
||||
echo 'server {'
|
||||
echo ' listen 80;'
|
||||
echo ' location / {'
|
||||
echo ' proxy_pass http://dokku-installer;'
|
||||
echo ' }'
|
||||
echo '}'
|
||||
} >>$NGINX_CONF
|
||||
|
||||
rm -f $NGINX_BASE_PATH/sites-enabled/*
|
||||
DOKKU_DISTRO="$(
|
||||
. /etc/os-release >/dev/null 2>&1 || true
|
||||
echo "$ID"
|
||||
)"
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian)
|
||||
/usr/sbin/invoke-rc.d "$NGINX_INIT_NAME" reload || /usr/sbin/invoke-rc.d "$NGINX_INIT_NAME" start
|
||||
;;
|
||||
ubuntu)
|
||||
if [[ -x /usr/bin/sv ]]; then
|
||||
/usr/bin/sv reload "$NGINX_INIT_NAME" || /usr/bin/sv start "$NGINX_INIT_NAME"
|
||||
else
|
||||
"/etc/init.d/$NGINX_INIT_NAME" reload || "/etc/init.d/$NGINX_INIT_NAME" start
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
db_get "dokku/web_config"
|
||||
if [ "$RET" = "true" ]; then
|
||||
NGINX_CONF="/etc/nginx/conf.d/dokku-installer.conf"
|
||||
|
||||
rm -f $NGINX_CONF
|
||||
touch $NGINX_CONF
|
||||
|
||||
{
|
||||
echo 'upstream dokku-installer { server 127.0.0.1:2000; }'
|
||||
echo 'server {'
|
||||
echo ' listen 80;'
|
||||
echo ' location / {'
|
||||
echo ' proxy_pass http://dokku-installer;'
|
||||
echo ' }'
|
||||
echo '}'
|
||||
} >>$NGINX_CONF
|
||||
|
||||
rm -f /etc/nginx/sites-enabled/*
|
||||
DOKKU_DISTRO="$(
|
||||
. /etc/os-release >/dev/null 2>&1 || true
|
||||
echo "$ID"
|
||||
)"
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian)
|
||||
NGINX_INIT="/usr/sbin/invoke-rc.d"
|
||||
"$NGINX_INIT" nginx reload || "$NGINX_INIT" nginx start
|
||||
;;
|
||||
ubuntu)
|
||||
NGINX_INIT="/etc/init.d/nginx"
|
||||
"$NGINX_INIT" reload || "$NGINX_INIT" start
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
if [[ -x /usr/bin/openresty ]]; then
|
||||
setup_dokku_installer "/usr/local/openresty/nginx/conf" "openresty"
|
||||
else
|
||||
setup_dokku_installer "/etc/nginx" "nginx"
|
||||
fi
|
||||
fi
|
||||
|
||||
db_get "dokku/skip_key_file"
|
||||
if [ -z "${DEBCONF_RECONFIGURE}" ] && [ "$RET" != "true" ]; then
|
||||
db_get "dokku/key_file"
|
||||
if [ ! -f "$RET" ]; then
|
||||
echo "Error: keyfile '$RET' not found."
|
||||
echo " you can enter a new keyfile path when you restart the installation."
|
||||
echo "Error: keyfile '$RET' not found." >&2
|
||||
echo " To deploy, you will need to generate a keypair and add with 'dokku ssh-keys:add'." >&2
|
||||
db_reset "dokku/key_file"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -13,6 +13,8 @@ log-fail() {
|
||||
}
|
||||
|
||||
main() {
|
||||
local NGINX_ROOT
|
||||
|
||||
if [[ ! -d /mnt/dokku ]]; then
|
||||
log-info "Creating missing /mnt/dokku"
|
||||
mkdir -p /mnt/dokku
|
||||
@@ -49,14 +51,23 @@ main() {
|
||||
echo "export DOCKER_BIN=/usr/local/bin/docker" >"/home/dokku/.dokkurc/DOCKER_BIN"
|
||||
fi
|
||||
|
||||
if [[ ! -f /mnt/dokku/etc/nginx/dhparam.pem ]]; then
|
||||
mkdir -p /mnt/dokku/etc/nginx
|
||||
openssl dhparam -out /mnt/dokku/etc/nginx/dhparam.pem 2048
|
||||
NGINX_ROOT="/etc/nginx"
|
||||
if [[ -x /usr/bin/openresty ]]; then
|
||||
NGINX_ROOT="/usr/local/openresty/nginx/conf"
|
||||
rm -rf /etc/runit/runsvdir/default/nginx
|
||||
else
|
||||
rm -rf /etc/runit/runsvdir/default/openresty
|
||||
fi
|
||||
|
||||
cp -f /mnt/dokku/etc/nginx/dhparam.pem /etc/nginx/dhparam.pem
|
||||
chown root:root /etc/nginx/dhparam.pem
|
||||
chown root:root /etc/nginx/conf.d
|
||||
if [[ ! -f "/mnt/dokku${NGINX_ROOT}/dhparam.pem" ]]; then
|
||||
mkdir -p "/mnt/dokku${NGINX_ROOT}"
|
||||
openssl dhparam -out "/mnt/dokku${NGINX_ROOT}/dhparam.pem" 2048
|
||||
fi
|
||||
|
||||
mkdir -p "${NGINX_ROOT}/conf.d"
|
||||
cp -f "/mnt/dokku${NGINX_ROOT}/dhparam.pem" "${NGINX_ROOT}/dhparam.pem"
|
||||
chown root:root "${NGINX_ROOT}/dhparam.pem"
|
||||
chown root:root "${NGINX_ROOT}/conf.d"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
7
docker/etc/runit/runsvdir/default/openresty/run
Executable file
7
docker/etc/runit/runsvdir/default/openresty/run
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
exec >>/var/log/services/openresty
|
||||
exec 2>&1
|
||||
|
||||
echo "Running openresty"
|
||||
exec /usr/bin/openresty -c /usr/local/openresty/nginx/conf/nginx.conf -g "daemon off;"
|
||||
30
docker/usr/local/openresty/nginx/conf/nginx.conf
Normal file
30
docker/usr/local/openresty/nginx/conf/nginx.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/openresty.pid;
|
||||
include /usr/local/openresty/nginx/conf/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
}
|
||||
|
||||
http {
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
include /usr/local/openresty/nginx/conf/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
access_log /var/log/openresty/access.log;
|
||||
error_log /var/log/openresty/error.log;
|
||||
|
||||
gzip on;
|
||||
|
||||
include /usr/local/openresty/nginx/conf/conf.d/*.conf;
|
||||
include /usr/local/openresty/nginx/conf/sites-enabled/*;
|
||||
}
|
||||
@@ -32,35 +32,35 @@ dokku plugin:list
|
||||
|
||||
```
|
||||
plugn: dev
|
||||
00_dokku-standard 0.18.5 enabled dokku core standard plugin
|
||||
20_events 0.18.5 enabled dokku core events logging plugin
|
||||
app-json 0.18.5 enabled dokku core app-json plugin
|
||||
apps 0.18.5 enabled dokku core apps plugin
|
||||
build-env 0.18.5 enabled dokku core build-env plugin
|
||||
buildpacks 0.18.5 enabled dokku core buildpacks plugin
|
||||
certs 0.18.5 enabled dokku core certificate management plugin
|
||||
checks 0.18.5 enabled dokku core checks plugin
|
||||
common 0.18.5 enabled dokku core common plugin
|
||||
config 0.18.5 enabled dokku core config plugin
|
||||
docker-options 0.18.5 enabled dokku core docker-options plugin
|
||||
domains 0.18.5 enabled dokku core domains plugin
|
||||
enter 0.18.5 enabled dokku core enter plugin
|
||||
git 0.18.5 enabled dokku core git plugin
|
||||
logs 0.18.5 enabled dokku core logs plugin
|
||||
network 0.18.5 enabled dokku core network plugin
|
||||
nginx-vhosts 0.18.5 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.18.5 enabled dokku core plugin plugin
|
||||
proxy 0.18.5 enabled dokku core proxy plugin
|
||||
ps 0.18.5 enabled dokku core ps plugin
|
||||
repo 0.18.5 enabled dokku core repo plugin
|
||||
resource 0.18.5 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.18.5 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.18.5 enabled dokku core shell plugin
|
||||
ssh-keys 0.18.5 enabled dokku core ssh-keys plugin
|
||||
storage 0.18.5 enabled dokku core storage plugin
|
||||
tags 0.18.5 enabled dokku core tags plugin
|
||||
tar 0.18.5 enabled dokku core tar plugin
|
||||
trace 0.18.5 enabled dokku core trace plugin
|
||||
00_dokku-standard 0.19.7 enabled dokku core standard plugin
|
||||
20_events 0.19.7 enabled dokku core events logging plugin
|
||||
app-json 0.19.7 enabled dokku core app-json plugin
|
||||
apps 0.19.7 enabled dokku core apps plugin
|
||||
build-env 0.19.7 enabled dokku core build-env plugin
|
||||
buildpacks 0.19.7 enabled dokku core buildpacks plugin
|
||||
certs 0.19.7 enabled dokku core certificate management plugin
|
||||
checks 0.19.7 enabled dokku core checks plugin
|
||||
common 0.19.7 enabled dokku core common plugin
|
||||
config 0.19.7 enabled dokku core config plugin
|
||||
docker-options 0.19.7 enabled dokku core docker-options plugin
|
||||
domains 0.19.7 enabled dokku core domains plugin
|
||||
enter 0.19.7 enabled dokku core enter plugin
|
||||
git 0.19.7 enabled dokku core git plugin
|
||||
logs 0.19.7 enabled dokku core logs plugin
|
||||
network 0.19.7 enabled dokku core network plugin
|
||||
nginx-vhosts 0.19.7 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.19.7 enabled dokku core plugin plugin
|
||||
proxy 0.19.7 enabled dokku core proxy plugin
|
||||
ps 0.19.7 enabled dokku core ps plugin
|
||||
repo 0.19.7 enabled dokku core repo plugin
|
||||
resource 0.19.7 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.19.7 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.19.7 enabled dokku core shell plugin
|
||||
ssh-keys 0.19.7 enabled dokku core ssh-keys plugin
|
||||
storage 0.19.7 enabled dokku core storage plugin
|
||||
tags 0.19.7 enabled dokku core tags plugin
|
||||
tar 0.19.7 enabled dokku core tar plugin
|
||||
trace 0.19.7 enabled dokku core trace 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.
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
|
||||
@@ -2,37 +2,37 @@
|
||||
"name": "Dokku",
|
||||
"icons": [
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.18.5\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.19.7\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.18.5\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.19.7\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.18.5\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.19.7\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.18.5\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.19.7\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.18.5\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.19.7\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.18.5\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.19.7\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
|
||||
@@ -39,13 +39,13 @@ h1 {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
.header .navbar-brand a {
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/dokku.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/dokku.png);
|
||||
text-indent: 40px;
|
||||
}
|
||||
.blurb {
|
||||
color: #424242;
|
||||
background-color: #ededed;
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/gplaypattern.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/gplaypattern.png);
|
||||
padding: 45px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"0.15.5",
|
||||
"0.16.4",
|
||||
"0.17.9",
|
||||
"0.18.5"
|
||||
"0.18.5",
|
||||
"0.19.7"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ The following list config variables have special meaning and can be set in a var
|
||||
| `DOKKU_EVENTS_LOGFILE` | `$DOKKU_LOGS_DIR/events.log` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Where the events log file is written to. |
|
||||
| `DOKKU_APP_NAME` | none | `--app APP` flag | Name of application to work on. Respected by core plugins. |
|
||||
| `DOKKU_APPS_FORCE_DELETE` | none | `--force` flag | Whether to force delete an application. Also used by other plugins for destructive actions. |
|
||||
| `DOKKU_CHECKS_URL` | `http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Url displayed during deployment when no CHECKS file exists. |
|
||||
| `DOKKU_DETACH_CONTAINER` | none | `--detach` flag | Whether to detach a container started via `dokku run`. |
|
||||
| `DOKKU_QUIET_OUTPUT` | none | `--quiet` flag | Silences certain header output for `dokku` commands. |
|
||||
| `DOKKU_RM_CONTAINER` | none | `dokku config:set` <br /> `--rm-container` flag <br /> `--rm` flag | Whether to keep `dokku run` containers around or not. |
|
||||
|
||||
@@ -9,7 +9,7 @@ Once you have configured Dokku with at least one user, you can deploy applicatio
|
||||
```shell
|
||||
# from your local machine
|
||||
# SSH access to github must be enabled on this host
|
||||
git clone git@github.com:heroku/ruby-getting-started.git
|
||||
git clone https://github.com/heroku/ruby-getting-started
|
||||
```
|
||||
|
||||
### Create the app
|
||||
|
||||
@@ -76,3 +76,28 @@ This behavior can be disabled entirely on a per-app basis by setting the `rev-en
|
||||
# override for a specific app
|
||||
dokku git:set node-js-app rev-env-var ""
|
||||
```
|
||||
|
||||
### Keeping the `.git` directory
|
||||
|
||||
By default, Dokku will remove the contents of the `.git` before triggering a build for a given app. This is generally a safe default as shipping the entire source code history of your app in the deployed image artifact is unnecessary as it increases bloat and potentially can leak information if there are any security issues with your app code.
|
||||
|
||||
To enable the `.git` directory, run the `git:set` command as follows:
|
||||
|
||||
```shell
|
||||
# on the Dokku host
|
||||
|
||||
# keep the .git directory during builds
|
||||
dokku git:set node-js-app keep-git-dir true
|
||||
```
|
||||
|
||||
The default behavior is to delete this directory and it's contents. To revert to the default behavior, the `keep-git-dir` value can be set to either an empty string or `false`.
|
||||
|
||||
```shell
|
||||
# on the Dokku host
|
||||
|
||||
# delete the .git directory during builds (default)
|
||||
dokku git:set node-js-app keep-git-dir false
|
||||
|
||||
# delete the .git directory during builds (default)
|
||||
dokku git:set node-js-app keep-git-dir ""
|
||||
```
|
||||
|
||||
@@ -92,7 +92,6 @@ dokku tags:deploy node-js-app v1
|
||||
-----> Running post-deploy
|
||||
-----> Configuring node-js-app.dokku.me...
|
||||
-----> Creating http nginx.conf
|
||||
-----> Running nginx-pre-reload
|
||||
Reloading nginx
|
||||
-----> Shutting down old containers in 60 seconds
|
||||
=====> 025eec3fa3b442fded90933d58d8ed8422901f0449f5ea0c23d00515af5d3137
|
||||
|
||||
@@ -46,6 +46,12 @@ dokku --rm-container run node-js-app ls -lah
|
||||
dokku --rm run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Containers may have specific labels attached. In order to avoid issues with dokku internals, do not use any labels beginning with either `com.dokku` or `org.label-schema`.
|
||||
|
||||
```shell
|
||||
dokku --label=com.example.test-label=value run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Finally, you may wish to run a container in "detached" mode via the `--detach` Dokku flag. Running a process in detached mode will immediately return a `CONTAINER_ID`. It is up to the user to then further manage this container in whatever manner they see fit, as Dokku will *not* automatically terminate the container.
|
||||
|
||||
```shell
|
||||
|
||||
@@ -123,7 +123,7 @@ To specify checks, add a `CHECKS` file to the root of your project directory. Th
|
||||
- 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.
|
||||
> For Dockerfile and Docker Image based deploys, the file *must* be in the `WORKDIR` directory of the built image. `/app` is used by default as the root container directory for buildpack-based deploys.
|
||||
|
||||
### Check instructions
|
||||
|
||||
@@ -327,7 +327,6 @@ curl: (7) Failed to connect to 172.17.0.155 port 5000: Connection refused
|
||||
-----> Running post-deploy
|
||||
-----> Configuring myapp.dokku.me...
|
||||
-----> Creating http nginx.conf
|
||||
-----> Running nginx-pre-reload
|
||||
Reloading nginx
|
||||
-----> Shutting down old container in 60 seconds
|
||||
=====> Application deployed:
|
||||
|
||||
@@ -159,7 +159,7 @@ Certain systems may require a wrapper function around the `docker` binary for pr
|
||||
|
||||
```shell
|
||||
# good
|
||||
"$DOCKER_BIN" run -d $IMAGE /bin/bash -e -c "$COMMAND"
|
||||
"$DOCKER_BIN" container run -d $IMAGE /bin/bash -e -c "$COMMAND"
|
||||
|
||||
# bad
|
||||
docker run -d $IMAGE /bin/bash -e -c "$COMMAND"
|
||||
@@ -175,16 +175,16 @@ Note that where possible, a label `com.dokku.app-name=$APP` - where `$APP` is th
|
||||
|
||||
```shell
|
||||
# `docker build` example
|
||||
"$DOCKER_BIN" build "--label=com.dokku.app-name=${APP}" $DOKKU_GLOBAL_BUILD_ARGS ...
|
||||
"$DOCKER_BIN" image build "--label=com.dokku.app-name=${APP}" $DOKKU_GLOBAL_BUILD_ARGS ...
|
||||
|
||||
# `docker commit` example
|
||||
# Note that the arguments must be set as a local array
|
||||
# as arrays cannot be exported in shell
|
||||
local DOKKU_COMMIT_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL $DOKKU_CONTAINER_LABEL=")
|
||||
"$DOCKER_BIN" commit --change "LABEL com.dokku.app-name=$APP" "${DOKKU_COMMIT_ARGS[@]}" ...
|
||||
"$DOCKER_BIN" container commit --change "LABEL com.dokku.app-name=$APP" "${DOKKU_COMMIT_ARGS[@]}" ...
|
||||
|
||||
# `docker run` example
|
||||
"$DOCKER_BIN" run "--label=com.dokku.app-name=${APP}" $DOKKU_GLOBAL_RUN_ARGS ...
|
||||
"$DOCKER_BIN" container run "--label=com.dokku.app-name=${APP}" $DOKKU_GLOBAL_RUN_ARGS ...
|
||||
```
|
||||
|
||||
## Copy files from the built image using `copy_from_image`
|
||||
|
||||
@@ -143,7 +143,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
APP="$1"; CONTAINERID="$2"; PROC_TYPE="$3"; PORT="$4" ; IP="$5"
|
||||
APP="$1"; CONTAINER_ID="$2"; PROC_TYPE="$3"; PORT="$4" ; IP="$5"
|
||||
|
||||
eval "$(config_export app $APP)"
|
||||
DOKKU_DISABLE_DEPLOY="${DOKKU_DISABLE_DEPLOY:-false}"
|
||||
@@ -1512,6 +1512,25 @@ DOKKU_SCHEDULER="$1"; APP="$2"; IMAGE_TAG="$3";
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `scheduler-post-run`
|
||||
|
||||
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||
> between minor releases until the 1.0 release.
|
||||
|
||||
- Description: Allows you to run scheduler commands after a `dokku run` invocation is called
|
||||
- Invoked by: `dokku run`
|
||||
- Arguments: `$DOKKU_SCHEDULER $APP $CONTAINER_ID`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
DOKKU_SCHEDULER="$1"; APP="$2"; CONTAINER_ID="$3";
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `scheduler-retire`
|
||||
|
||||
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||
|
||||
@@ -29,7 +29,7 @@ The workflow looks like this:
|
||||
```shell
|
||||
# having dokku-arch in ../dokku-arch
|
||||
vagrant up build-arch
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.18.5-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.19.7-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
cd ../dokku-arch
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m 'Update to dokku 0.9.9'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Pull the dokku/dokku image:
|
||||
|
||||
```shell
|
||||
docker pull dokku/dokku:0.18.5
|
||||
docker pull dokku/dokku:0.19.7
|
||||
```
|
||||
|
||||
Next, run the image.
|
||||
@@ -17,7 +17,7 @@ docker run \
|
||||
--publish 8443:443 \
|
||||
--volume /var/lib/dokku:/mnt/dokku \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
dokku/dokku:0.18.5
|
||||
dokku/dokku:0.19.7
|
||||
```
|
||||
|
||||
Dokku is run with the following options:
|
||||
|
||||
@@ -21,8 +21,8 @@ To install the latest stable version of Dokku, you can run the following shell c
|
||||
|
||||
```shell
|
||||
# for debian systems, installs Dokku via apt-get
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.18.5/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.18.5 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.7/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.19.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||
|
||||
@@ -10,30 +10,30 @@
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<style>
|
||||
.sponsors {
|
||||
@@ -127,12 +127,12 @@
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.18.5/bootstrap.sh</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.19.7/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.18.5 bash bootstrap.sh</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.19.7 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||
|
||||
@@ -65,7 +65,6 @@ dokku proxy:ports-add node-js-app http:8080:5000
|
||||
DOKKU_PROXY_PORT_MAP: http:80:5000 http:8080:5000
|
||||
-----> Configuring node-js-app.dokku.me...(using built-in template)
|
||||
-----> Creating http nginx.conf
|
||||
-----> Running nginx-pre-reload
|
||||
Reloading nginx
|
||||
```
|
||||
|
||||
@@ -100,7 +99,6 @@ dokku proxy:ports-set node-js-app http:8080:5000
|
||||
DOKKU_PROXY_PORT_MAP: http:80:5000 http:8080:5000
|
||||
-----> Configuring node-js-app.dokku.me...(using built-in template)
|
||||
-----> Creating http nginx.conf
|
||||
-----> Running nginx-pre-reload
|
||||
Reloading nginx
|
||||
```
|
||||
|
||||
@@ -126,7 +124,7 @@ For buildpack deployments, your application *must* respect the `PORT` environmen
|
||||
|
||||
> Changed as of 0.5.0
|
||||
|
||||
Dokku's default proxy implementation - nginx - only supports HTTP request proxying. At this time, we do not support proxying plain TCP or UDP ports. UDP ports can be exposed by disabling the nginx proxy with `dokku proxy:disable myapp`. If you would like to investigate alternative proxy methods, please refer to our [proxy management documentation](/docs/advanced-usage/proxy-management.md).
|
||||
Dokku's default proxy implementation - nginx - supports HTTP and GRPC request proxying. At this time, we do not support proxying plain TCP or UDP ports. UDP ports can be exposed by disabling the nginx proxy with `dokku proxy:disable myapp`. If you would like to investigate alternative proxy methods, please refer to our [proxy management documentation](/docs/advanced-usage/proxy-management.md).
|
||||
|
||||
#### Applications using EXPOSE
|
||||
|
||||
|
||||
@@ -69,7 +69,8 @@ The proxy port scheme is as follows:
|
||||
|
||||
- `SCHEME:HOST_PORT:CONTAINER_PORT`
|
||||
|
||||
The scheme metadata can be used by proxy implementations in order to properly handle proxying of requests. For example, the built-in `nginx-vhosts` proxy implementation supports both the `http` and `https` schemes.
|
||||
The scheme metadata can be used by proxy implementations in order to properly handle proxying of requests. For example, the built-in `nginx-vhosts` proxy implementation supports the `http`, `https`, `grpc` and `grpcs` schemes.
|
||||
For the `grpc` and `grpcs` see [nginx blog post on grpc](https://www.nginx.com/blog/nginx-1-13-10-grpc/).
|
||||
|
||||
Developers of proxy implementations are encouraged to use whatever schemes make the most sense, and ignore configurations which they do not support. For instance, a `udp` proxy implementation can safely ignore `http` and `https` port mappings.
|
||||
|
||||
|
||||
@@ -9,26 +9,26 @@
|
||||
<meta name="author" content="">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<script>
|
||||
@@ -42,7 +42,7 @@
|
||||
</script>
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.18.5/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.7/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<style>
|
||||
|
||||
4
dokku
4
dokku
@@ -87,13 +87,13 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
|
||||
fi
|
||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||
|
||||
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ ! $1 == "ssh-keys:add" ]]; then
|
||||
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]]; then
|
||||
export SSH_USER=$(id -un)
|
||||
sudo -u dokku -E -H "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]]; then
|
||||
if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]] || [[ $1 == "ssh-keys:remove" ]]; then
|
||||
if [[ $(id -un) != "root" ]]; then
|
||||
dokku_log_fail "This command must be run as root"
|
||||
else
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " help help:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
[[ " help help:help cleanup:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
case "$1" in
|
||||
help | run:help | trace:help | url:help | urls:help | version:help)
|
||||
help | cleanup:help | run:help | trace:help | url:help | urls:help | version:help)
|
||||
[[ $(echo "$1" | sed '/.*:help/!d') ]] && help_topic="${1%\:help}"
|
||||
help_content_func() {
|
||||
declare desc="return standard plugin help content"
|
||||
cat <<help_content
|
||||
cleanup [<app>], Cleans up exited/dead Docker containers and removes dangling images
|
||||
run [--env KEY=VALUE] <app> <cmd>, Run a command in a new container using the current application image
|
||||
url <app>, Show the first URL for an application (compatibility)
|
||||
urls <app>, Show all URLs for an application
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -14,10 +14,10 @@ dokku_report_cmd() {
|
||||
dokku_log_info1 "docker version: "
|
||||
"$DOCKER_BIN" version | sed "s/^/ /"
|
||||
dokku_log_info1 "docker daemon info: "
|
||||
"$DOCKER_BIN" -D info | sed "s/^/ /"
|
||||
"$DOCKER_BIN" -D system info | sed "s/^/ /"
|
||||
dokku_log_info1 "sigil version: $(sigil -v)"
|
||||
dokku_log_info1 "herokuish version: "
|
||||
"$DOCKER_BIN" run $DOKKU_GLOBAL_RUN_ARGS --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
|
||||
"$DOCKER_BIN" container run $DOKKU_GLOBAL_RUN_ARGS --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
|
||||
dokku_log_info1 "dokku version: $(dokku version)"
|
||||
dokku_log_info1 "dokku plugins: "
|
||||
dokku plugin:list | sed "s/^/ /"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -17,7 +17,7 @@ get_phase_script() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
get_json_value "scripts.dokku.${PHASE_SCRIPT_KEY}" <"$APP_JSON_FILE"
|
||||
get_json_value ".scripts.dokku.${PHASE_SCRIPT_KEY}" <"$APP_JSON_FILE"
|
||||
}
|
||||
|
||||
get_release_cmd() {
|
||||
@@ -98,8 +98,8 @@ execute_script() {
|
||||
DOKKU_APP_SHELL="$(config_get "$APP" DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")"
|
||||
[[ -z "$DOKKU_APP_SHELL" ]] && DOKKU_APP_SHELL="/bin/bash"
|
||||
|
||||
id=$("$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -e DOKKU_TRACE="$DOKKU_TRACE" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_HOST_DIR:/cache" "${ARG_ARRAY[@]}" "$IMAGE" "$DOKKU_APP_SHELL" -c "$COMMAND")
|
||||
if test "$("$DOCKER_BIN" wait "$id")" -ne 0; then
|
||||
id=$("$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --env DOKKU_TRACE="$DOKKU_TRACE" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_HOST_DIR:/cache" "${ARG_ARRAY[@]}" "$IMAGE" "$DOKKU_APP_SHELL" -c "$COMMAND")
|
||||
if test "$("$DOCKER_BIN" container wait "$id")" -ne 0; then
|
||||
dokku_container_log_verbose_quiet "$id"
|
||||
dokku_log_fail "execution of '$SCRIPT_CMD' failed!"
|
||||
fi
|
||||
@@ -121,5 +121,5 @@ execute_script() {
|
||||
local DOCKER_COMMIT_ARGS="$DOCKER_COMMIT_ENTRYPOINT_CHANGE_ARG $DOCKER_COMMIT_CMD_CHANGE_ARG"
|
||||
fi
|
||||
|
||||
eval "$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "${DOCKER_COMMIT_ARGS[@]}" "$id" "$IMAGE" >/dev/null
|
||||
eval "$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "${DOCKER_COMMIT_ARGS[@]}" "$id" "$IMAGE" >/dev/null
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core app-json plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -34,7 +34,7 @@ apps_destroy() {
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Destroying $APP (including all add-ons)"
|
||||
dokku_log_info1 "Destroying $APP (including all add-ons)"
|
||||
plugn trigger pre-delete "$APP" "$IMAGE_TAG"
|
||||
|
||||
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core apps plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -16,7 +16,7 @@ app_post_delete() {
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
"$DOCKER_BIN" rmi $("$DOCKER_BIN" images -q "$IMAGE_REPO" | xargs) &>/dev/null || true
|
||||
"$DOCKER_BIN" image rm $("$DOCKER_BIN" image list --quiet "$IMAGE_REPO" | xargs) &>/dev/null || true
|
||||
}
|
||||
|
||||
app_post_delete "$@"
|
||||
|
||||
@@ -46,7 +46,7 @@ apps_clone_cmd() {
|
||||
plugn trigger post-app-clone-setup "$OLD_APP" "$NEW_APP"
|
||||
|
||||
if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then
|
||||
"$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
||||
"$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --rm --volume "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
||||
fi
|
||||
rm -rf "$NEW_CACHE_DIR"
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ apps_rename_cmd() {
|
||||
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$OLD_APP"
|
||||
|
||||
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" >/dev/null 2>&1; then
|
||||
"$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
||||
"$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --rm --volume "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
||||
fi
|
||||
rm -rf "$OLD_CACHE_DIR"
|
||||
apps_create "$NEW_APP"
|
||||
|
||||
@@ -37,7 +37,7 @@ trigger-builder-build-builder-dockerfile() {
|
||||
declare -a ARG_ARRAY
|
||||
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
||||
|
||||
"$DOCKER_BIN" build "${DOCKER_BUILD_LABEL_ARGS[@]}" $DOKKU_GLOBAL_BUILD_ARGS "${ARG_ARRAY[@]}" "${DOKKU_DOCKER_BUILD_OPTS[@]}" -t $IMAGE .
|
||||
"$DOCKER_BIN" image build "${DOCKER_BUILD_LABEL_ARGS[@]}" $DOKKU_GLOBAL_BUILD_ARGS "${ARG_ARRAY[@]}" "${DOKKU_DOCKER_BUILD_OPTS[@]}" -t $IMAGE .
|
||||
|
||||
plugn trigger post-build-dockerfile "$APP"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-dockerfile plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -28,13 +28,13 @@ trigger-builder-build-builder-herokuish() {
|
||||
NEW_DOKKU_IMAGE=$(plugn trigger builder-dokku-image "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR" "$DOKKU_IMAGE")
|
||||
[[ -n "$NEW_DOKKU_IMAGE" ]] && DOKKU_IMAGE="$NEW_DOKKU_IMAGE"
|
||||
|
||||
CID=$(tar -c . | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$DOKKU_IMAGE" /bin/bash -c "mkdir -p /app && tar -xC /app")
|
||||
if test "$("$DOCKER_BIN" wait "$CID")" -ne 0; then
|
||||
CID=$(tar -c . | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$DOKKU_IMAGE" /bin/bash -c "mkdir -p /app && tar -xC /app")
|
||||
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
|
||||
dokku_log_warn "Failure extracting app code"
|
||||
return 1
|
||||
fi
|
||||
|
||||
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
[[ -d $DOKKU_APP_CACHE_DIR ]] || mkdir -p "$DOKKU_APP_CACHE_DIR"
|
||||
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
|
||||
|
||||
@@ -45,14 +45,14 @@ trigger-builder-build-builder-herokuish() {
|
||||
declare -a ARG_ARRAY
|
||||
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
||||
# shellcheck disable=SC2086
|
||||
CID=$("$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -d -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
|
||||
"$DOCKER_BIN" attach "$CID"
|
||||
if test "$("$DOCKER_BIN" wait "$CID")" -ne 0; then
|
||||
CID=$("$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -d -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
|
||||
"$DOCKER_BIN" container attach "$CID"
|
||||
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
|
||||
dokku_log_warn "Failure during app build"
|
||||
return 1
|
||||
fi
|
||||
|
||||
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
|
||||
plugn trigger post-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
|
||||
}
|
||||
|
||||
@@ -19,22 +19,22 @@ trigger-builder-release-builder-herokuish() {
|
||||
|
||||
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
|
||||
if [[ -n $(config_export global) ]]; then
|
||||
CID=$(config_export global | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
|
||||
if test "$("$DOCKER_BIN" wait "$CID")" -ne 0; then
|
||||
CID=$(config_export global | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
|
||||
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
|
||||
dokku_log_warn "Failure injecting global environment variables"
|
||||
return 1
|
||||
fi
|
||||
|
||||
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
fi
|
||||
if [[ -n $(config_export app "$APP") ]]; then
|
||||
CID=$(config_export app "$APP" | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
|
||||
if test "$("$DOCKER_BIN" wait "$CID")" -ne 0; then
|
||||
CID=$(config_export app "$APP" | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
|
||||
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
|
||||
dokku_log_warn "Failure injecting app environment variables"
|
||||
return 1
|
||||
fi
|
||||
|
||||
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
fi
|
||||
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-herokuish plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -22,22 +22,22 @@ trigger-pre-build-buildpack-builder-herokuish() {
|
||||
dokku_log_info1 "Adding BUILD_ENV to build environment..."
|
||||
# create build env files for use in buildpacks like this:
|
||||
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
|
||||
CID=$(config_bundle --merged "$APP" | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env")
|
||||
if test "$("$DOCKER_BIN" wait "$CID")" -ne 0; then
|
||||
CID=$(config_bundle --merged "$APP" | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env")
|
||||
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
|
||||
dokku_log_warn "Failure injecting BUILD_ENV into build environment"
|
||||
return 1
|
||||
fi
|
||||
|
||||
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
|
||||
# create build env for 'old style' buildpacks and dokku plugins
|
||||
CID=$(config_export app "$APP" --format envfile --merged | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env")
|
||||
if test "$("$DOCKER_BIN" wait "$CID")" -ne 0; then
|
||||
CID=$(config_export app "$APP" --format envfile --merged | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env")
|
||||
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
|
||||
dokku_log_warn "Failure injecting old-style BUILD_ENV"
|
||||
return 1
|
||||
fi
|
||||
|
||||
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
|
||||
}
|
||||
|
||||
trigger-pre-build-buildpack-builder-herokuish "$@"
|
||||
|
||||
1
plugins/buildpacks/.gitignore
vendored
1
plugins/buildpacks/.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
/commands
|
||||
/subcommands/*
|
||||
/triggers/*
|
||||
/triggers
|
||||
/install
|
||||
/post-delete
|
||||
/post-extract
|
||||
|
||||
@@ -1,37 +1,6 @@
|
||||
include ../../common.mk
|
||||
|
||||
GO_ARGS ?= -a
|
||||
|
||||
SUBCOMMANDS = subcommands/add subcommands/clear subcommands/list subcommands/remove subcommands/report subcommands/set
|
||||
TRIGGERS = triggers/install triggers/post-delete triggers/post-extract triggers/report
|
||||
build-in-docker: clean
|
||||
docker run --rm \
|
||||
-v $$PWD/../..:$(GO_REPO_ROOT) \
|
||||
-w $(GO_REPO_ROOT)/plugins/buildpacks \
|
||||
$(BUILD_IMAGE) \
|
||||
bash -c "GO_ARGS='$(GO_ARGS)' make -j4 build" || exit $$?
|
||||
BUILD = commands subcommands triggers
|
||||
PLUGIN_NAME = buildpacks
|
||||
|
||||
build: commands subcommands triggers
|
||||
$(MAKE) triggers-copy
|
||||
|
||||
commands: **/**/commands.go
|
||||
go build $(GO_ARGS) -o commands src/commands/commands.go
|
||||
|
||||
subcommands: $(SUBCOMMANDS)
|
||||
|
||||
subcommands/%: src/subcommands/*/%.go
|
||||
go build $(GO_ARGS) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf commands subcommands triggers install post-delete post-extract report
|
||||
|
||||
src-clean:
|
||||
rm -rf .gitignore src triggers vendor Makefile *.go glide.*
|
||||
|
||||
triggers: $(TRIGGERS)
|
||||
|
||||
triggers/%: src/triggers/*/%.go
|
||||
go build $(GO_ARGS) -o $@ $<
|
||||
|
||||
triggers-copy:
|
||||
cp triggers/* .
|
||||
include ../../common.mk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core buildpacks plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("buildpacks:add", flag.ExitOnError)
|
||||
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
|
||||
args.Parse(os.Args[2:])
|
||||
err := buildpacks.CommandAdd(args.Args(), *index)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("buildpacks:clear", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
err := buildpacks.CommandClear(args.Args())
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("buildpacks:list", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
buildpacks.CommandList(args.Args())
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("buildpacks:remove", flag.ExitOnError)
|
||||
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
|
||||
args.Parse(os.Args[2:])
|
||||
err := buildpacks.CommandRemove(args.Args(), *index)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// displays a buildpacks report for one or more apps
|
||||
func main() {
|
||||
flag.Parse()
|
||||
appName := flag.Arg(1)
|
||||
infoFlag := flag.Arg(2)
|
||||
|
||||
if strings.HasPrefix(appName, "--") {
|
||||
infoFlag = appName
|
||||
appName = ""
|
||||
}
|
||||
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, appName := range apps {
|
||||
buildpacks.ReportSingleApp(appName, infoFlag)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
buildpacks.ReportSingleApp(appName, infoFlag)
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("buildpacks:set", flag.ExitOnError)
|
||||
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
|
||||
args.Parse(os.Args[2:])
|
||||
err := buildpacks.CommandSet(args.Args(), *index)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
55
plugins/buildpacks/src/subcommands/subcommands.go
Normal file
55
plugins/buildpacks/src/subcommands/subcommands.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
func main() {
|
||||
parts := strings.Split(os.Args[0], "/")
|
||||
subcommand := parts[len(parts)-1]
|
||||
|
||||
var err error
|
||||
switch subcommand {
|
||||
case "add":
|
||||
args := flag.NewFlagSet("buildpacks:add", flag.ExitOnError)
|
||||
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
|
||||
args.Parse(os.Args[2:])
|
||||
err = buildpacks.CommandAdd(args.Args(), *index)
|
||||
case "clear":
|
||||
args := flag.NewFlagSet("buildpacks:clear", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
err = buildpacks.CommandClear(args.Args())
|
||||
case "list":
|
||||
args := flag.NewFlagSet("buildpacks:list", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
buildpacks.CommandList(args.Args())
|
||||
case "remove":
|
||||
args := flag.NewFlagSet("buildpacks:remove", flag.ExitOnError)
|
||||
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
|
||||
args.Parse(os.Args[2:])
|
||||
err = buildpacks.CommandRemove(args.Args(), *index)
|
||||
case "report":
|
||||
flag.Parse()
|
||||
appName := flag.Arg(1)
|
||||
infoFlag := flag.Arg(2)
|
||||
buildpacks.CommandReport(appName, infoFlag)
|
||||
case "set":
|
||||
args := flag.NewFlagSet("buildpacks:set", flag.ExitOnError)
|
||||
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
|
||||
args.Parse(os.Args[2:])
|
||||
err = buildpacks.CommandSet(args.Args(), *index)
|
||||
default:
|
||||
common.LogFail(fmt.Sprintf("Invalid plugin subcommand call: %s", subcommand))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// runs the install step for the buildpacks plugin
|
||||
func main() {
|
||||
if err := common.PropertySetup("buildpacks"); err != nil {
|
||||
common.LogFail(fmt.Sprintf("Unable to install the buildpacks plugin: %s", err.Error()))
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// destroys the buildpacks property for a given app container
|
||||
func main() {
|
||||
flag.Parse()
|
||||
appName := flag.Arg(0)
|
||||
|
||||
err := common.PropertyDestroy("buildpacks", appName)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
)
|
||||
|
||||
// displays a buildpacks report for one or more apps
|
||||
func main() {
|
||||
flag.Parse()
|
||||
appName := flag.Arg(0)
|
||||
|
||||
buildpacks.ReportSingleApp(appName, "")
|
||||
}
|
||||
35
plugins/buildpacks/src/triggers/triggers.go
Normal file
35
plugins/buildpacks/src/triggers/triggers.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// main entrypoint to all triggers
|
||||
func main() {
|
||||
parts := strings.Split(os.Args[0], "/")
|
||||
trigger := parts[len(parts)-1]
|
||||
flag.Parse()
|
||||
|
||||
switch trigger {
|
||||
case "install":
|
||||
buildpacks.TriggerInstall()
|
||||
case "post-delete":
|
||||
appName := flag.Arg(0)
|
||||
buildpacks.TriggerPostDelete(appName)
|
||||
case "post-extract":
|
||||
appName := flag.Arg(0)
|
||||
sourceWorkDir := flag.Arg(1)
|
||||
buildpacks.TriggerPostExtract(appName, sourceWorkDir)
|
||||
case "report":
|
||||
appName := flag.Arg(0)
|
||||
buildpacks.ReportSingleApp(appName, "")
|
||||
default:
|
||||
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package buildpacks
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
@@ -115,6 +116,27 @@ func CommandRemove(args []string, index int) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// CommandReport displays a buildpacks report for one or more apps
|
||||
func CommandReport(appName string, infoFlag string) {
|
||||
if strings.HasPrefix(appName, "--") {
|
||||
infoFlag = appName
|
||||
appName = ""
|
||||
}
|
||||
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, appName := range apps {
|
||||
ReportSingleApp(appName, infoFlag)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
ReportSingleApp(appName, infoFlag)
|
||||
}
|
||||
|
||||
// CommandSet implements buildpacks:set
|
||||
func CommandSet(args []string, index int) (err error) {
|
||||
var appName string
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package main
|
||||
package buildpacks
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
@@ -10,12 +9,23 @@ import (
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// writes a .buildpacks file into the app
|
||||
func main() {
|
||||
flag.Parse()
|
||||
appName := flag.Arg(0)
|
||||
tmpWorkDir := flag.Arg(1)
|
||||
// TriggerInstall runs the install step for the buildpacks plugin
|
||||
func TriggerInstall() {
|
||||
if err := common.PropertySetup("buildpacks"); err != nil {
|
||||
common.LogFail(fmt.Sprintf("Unable to install the buildpacks plugin: %s", err.Error()))
|
||||
}
|
||||
}
|
||||
|
||||
// TriggerPostDelete destroys the buildpacks property for a given app container
|
||||
func TriggerPostDelete(appName string) {
|
||||
err := common.PropertyDestroy("buildpacks", appName)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// TriggerPostExtract writes a .buildpacks file into the app
|
||||
func TriggerPostExtract(appName string, sourceWorkDir string) {
|
||||
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
|
||||
if err != nil {
|
||||
return
|
||||
@@ -25,7 +35,7 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
buildpacksPath := path.Join(tmpWorkDir, ".buildpacks")
|
||||
buildpacksPath := path.Join(sourceWorkDir, ".buildpacks")
|
||||
file, err := os.OpenFile(buildpacksPath, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0600)
|
||||
if err != nil {
|
||||
common.LogFail(fmt.Sprintf("Error writing .buildpacks file: %s", err.Error()))
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core certificate management plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core checks plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -325,7 +325,7 @@ func VerifyAppName(appName string) (err error) {
|
||||
|
||||
// VerifyImage returns true if docker image exists in local repo
|
||||
func VerifyImage(image string) bool {
|
||||
imageCmd := NewShellCmd(strings.Join([]string{DockerBin(), "inspect", image}, " "))
|
||||
imageCmd := NewShellCmd(strings.Join([]string{DockerBin(), "image", "inspect", image}, " "))
|
||||
imageCmd.ShowOutput = false
|
||||
return imageCmd.Execute()
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ dokku_container_log_verbose_quiet() {
|
||||
OIFS=$IFS
|
||||
IFS=$'\n'
|
||||
local line
|
||||
for line in $("$DOCKER_BIN" logs "$CID" 2>&1); do
|
||||
for line in $("$DOCKER_BIN" container logs "$CID" 2>&1); do
|
||||
dokku_log_verbose_quiet "$line"
|
||||
done
|
||||
IFS=$OIFS
|
||||
@@ -203,7 +203,7 @@ verify_app_name() {
|
||||
verify_image() {
|
||||
declare desc="verify image existence"
|
||||
local IMAGE="$1"
|
||||
if "$DOCKER_BIN" inspect "$IMAGE" &>/dev/null; then
|
||||
if "$DOCKER_BIN" image inspect "$IMAGE" &>/dev/null; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@@ -286,7 +286,7 @@ get_running_image_tag() {
|
||||
verify_app_name "$APP"
|
||||
|
||||
local CIDS=($(get_app_container_ids "$APP"))
|
||||
local RUNNING_IMAGE_TAG=$("$DOCKER_BIN" inspect -f '{{ .Config.Image }}' "${CIDS[0]}" 2>/dev/null | awk -F: '{ print $2 }' || echo '')
|
||||
local RUNNING_IMAGE_TAG=$("$DOCKER_BIN" container inspect --format '{{ .Config.Image }}' "${CIDS[0]}" 2>/dev/null | awk -F: '{ print $2 }' || echo '')
|
||||
echo "$RUNNING_IMAGE_TAG"
|
||||
}
|
||||
|
||||
@@ -300,13 +300,13 @@ is_image_herokuish_based() {
|
||||
fi
|
||||
|
||||
# due to how the build process works, all herokuish images have the Environment variable USER=herokuishuser
|
||||
USER_VALUE="$("$DOCKER_BIN" inspect -f '{{range .Config.Env}}{{if eq . "USER=herokuishuser" }}{{println .}}{{end}}{{end}}' "$IMAGE")"
|
||||
USER_VALUE="$("$DOCKER_BIN" image inspect --format '{{range .Config.Env}}{{if eq . "USER=herokuishuser" }}{{println .}}{{end}}{{end}}' "$IMAGE")"
|
||||
[[ "$USER_VALUE" == "" ]] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
get_docker_version() {
|
||||
CLIENT_VERSION_STRING="$("$DOCKER_BIN" version -f="{{ .Client.Version }}")"
|
||||
CLIENT_VERSION_STRING="$("$DOCKER_BIN" version --format "{{ .Client.Version }}")"
|
||||
echo "$CLIENT_VERSION_STRING"
|
||||
}
|
||||
|
||||
@@ -336,6 +336,8 @@ parse_args() {
|
||||
local next_index=1
|
||||
local skip=false
|
||||
local args=("$@")
|
||||
local flags
|
||||
|
||||
for arg in "$@"; do
|
||||
if [[ "$skip" == "true" ]]; then
|
||||
next_index=$((next_index + 1))
|
||||
@@ -364,8 +366,22 @@ parse_args() {
|
||||
skip=true
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$skip" == "true" ]]; then
|
||||
flags="${flags} ${arg}"
|
||||
elif [[ "$arg" == "--app" ]]; then
|
||||
flags="${flags} ${arg}=${args[$next_index]}"
|
||||
elif [[ "$arg" =~ ^--.* ]]; then
|
||||
flags="${flags} ${arg}"
|
||||
fi
|
||||
|
||||
next_index=$((next_index + 1))
|
||||
done
|
||||
|
||||
if [[ -z "$DOKKU_GLOBAL_FLAGS" ]]; then
|
||||
export DOKKU_GLOBAL_FLAGS="$(echo -e "${flags}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -382,7 +398,7 @@ copy_from_image() {
|
||||
if is_image_herokuish_based "$IMAGE"; then
|
||||
WORKDIR="/app"
|
||||
else
|
||||
WORKDIR="$("$DOCKER_BIN" inspect -f '{{.Config.WorkingDir}}' "$IMAGE")"
|
||||
WORKDIR="$("$DOCKER_BIN" image inspect --format '{{.Config.WorkingDir}}' "$IMAGE")"
|
||||
fi
|
||||
|
||||
if [[ -n "$WORKDIR" ]]; then
|
||||
@@ -393,9 +409,9 @@ copy_from_image() {
|
||||
TMP_FILE_COMMAND_OUTPUT=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
|
||||
trap "rm -rf '$TMP_FILE_COMMAND_OUTPUT' >/dev/null 2>&1 || true" RETURN
|
||||
|
||||
local CID=$("$DOCKER_BIN" create "${DOCKER_CREATE_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS "$IMAGE")
|
||||
"$DOCKER_BIN" cp "$CID:$SRC_FILE" "$TMP_FILE_COMMAND_OUTPUT" 2>/dev/null || true
|
||||
"$DOCKER_BIN" rm -f "$CID" &>/dev/null
|
||||
local CID=$("$DOCKER_BIN" container create "${DOCKER_CREATE_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS "$IMAGE")
|
||||
"$DOCKER_BIN" container cp "$CID:$SRC_FILE" "$TMP_FILE_COMMAND_OUTPUT" 2>/dev/null || true
|
||||
"$DOCKER_BIN" container rm --force "$CID" &>/dev/null
|
||||
|
||||
# docker cp exits with status 1 when run as non-root user when it tries to chown the file
|
||||
# after successfully copying the file. Thus, we suppress stderr.
|
||||
@@ -492,7 +508,7 @@ is_container_running() {
|
||||
local CONTAINER_STATUS
|
||||
|
||||
dokku_log_warn "Deprecated: common#is_container_status"
|
||||
CONTAINER_STATUS=$("$DOCKER_BIN" inspect -f '{{.State.Running}}' "$CID" || true)
|
||||
CONTAINER_STATUS=$("$DOCKER_BIN" container inspect --format '{{.State.Running}}' "$CID" || true)
|
||||
|
||||
if [[ "$CONTAINER_STATUS" == "true" ]]; then
|
||||
return 0
|
||||
@@ -505,7 +521,7 @@ is_container_status() {
|
||||
declare desc="return 0 if given docker container id is in given state"
|
||||
local CID=$1
|
||||
local TEMPLATE="{{.State.$2}}"
|
||||
local CONTAINER_STATUS=$("$DOCKER_BIN" inspect -f "$TEMPLATE" "$CID" 2>/dev/null || true)
|
||||
local CONTAINER_STATUS=$("$DOCKER_BIN" container inspect --format "$TEMPLATE" "$CID" 2>/dev/null || true)
|
||||
|
||||
if [[ "$CONTAINER_STATUS" == "true" ]]; then
|
||||
return 0
|
||||
@@ -522,7 +538,7 @@ is_app_running() {
|
||||
dokku_log_warn "Deprecated: ps#fn-is-app-running"
|
||||
verify_app_name "$APP"
|
||||
|
||||
local APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids "$APP")
|
||||
local APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids "$APP" 2>/dev/null)
|
||||
|
||||
if [[ -n "$APP_RUNNING_CONTAINER_IDS" ]]; then
|
||||
return 0
|
||||
@@ -641,30 +657,30 @@ docker_cleanup() {
|
||||
if [[ -n "$APP" ]]; then
|
||||
# delete all non-running containers
|
||||
# shellcheck disable=SC2046
|
||||
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=exited" -f "label=$DOKKU_CONTAINER_LABEL" -f "label=com.dokku.app-name=$APP" -q) &>/dev/null || true
|
||||
"$DOCKER_BIN" container rm $("$DOCKER_BIN" container list --all --filter "status=exited" --filter "label=$DOKKU_CONTAINER_LABEL" --filter "label=com.dokku.app-name=$APP" --quiet) &>/dev/null || true
|
||||
|
||||
# delete all dead containers
|
||||
# shellcheck disable=SC2046
|
||||
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=dead" -f "label=$DOKKU_CONTAINER_LABEL" -f "label=com.dokku.app-name=$APP" -q) &>/dev/null || true
|
||||
"$DOCKER_BIN" container rm $("$DOCKER_BIN" container list --all --filter "status=dead" --filter "label=$DOKKU_CONTAINER_LABEL" --filter "label=com.dokku.app-name=$APP" --quiet) &>/dev/null || true
|
||||
|
||||
# delete danging images
|
||||
# shellcheck disable=SC2046
|
||||
"$DOCKER_BIN" rmi $("$DOCKER_BIN" images -f 'dangling=true' -f "label=com.dokku.app-name=$APP" -q) &>/dev/null || true
|
||||
"$DOCKER_BIN" image rm $("$DOCKER_BIN" image list --filter 'dangling=true' --filter "label=com.dokku.app-name=$APP" --quiet) &>/dev/null || true
|
||||
|
||||
# delete unused images
|
||||
"$DOCKER_BIN" image prune --all --filter "label=com.dokku.app-name=$APP" --force &>/dev/null || true
|
||||
else
|
||||
# delete all non-running containers
|
||||
# shellcheck disable=SC2046
|
||||
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=exited" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
|
||||
"$DOCKER_BIN" container rm $("$DOCKER_BIN" container list --all --filter "status=exited" --filter "label=$DOKKU_CONTAINER_LABEL" --quiet) &>/dev/null || true
|
||||
|
||||
# delete all dead containers
|
||||
# shellcheck disable=SC2046
|
||||
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=dead" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
|
||||
"$DOCKER_BIN" container rm $("$DOCKER_BIN" container list --all --filter "status=dead" --filter "label=$DOKKU_CONTAINER_LABEL" --quiet) &>/dev/null || true
|
||||
|
||||
# delete danging images
|
||||
# shellcheck disable=SC2046
|
||||
"$DOCKER_BIN" rmi $("$DOCKER_BIN" images -f 'dangling=true' -q) &>/dev/null || true
|
||||
"$DOCKER_BIN" image rm $("$DOCKER_BIN" image list --filter 'dangling=true' --quiet) &>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -747,7 +763,7 @@ get_exposed_ports_from_image() {
|
||||
local IMAGE="$1"
|
||||
verify_image "$IMAGE"
|
||||
# shellcheck disable=SC2016
|
||||
local DOCKER_IMAGE_EXPOSED_PORTS="$("$DOCKER_BIN" inspect -f '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE")"
|
||||
local DOCKER_IMAGE_EXPOSED_PORTS="$("$DOCKER_BIN" image inspect --format '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE")"
|
||||
echo "$DOCKER_IMAGE_EXPOSED_PORTS"
|
||||
}
|
||||
|
||||
@@ -755,7 +771,7 @@ get_entrypoint_from_image() {
|
||||
declare desc="return .Config.Entrypoint from passed image name"
|
||||
local IMAGE="$1"
|
||||
verify_image "$IMAGE"
|
||||
local DOCKER_IMAGE_ENTRYPOINT="$("$DOCKER_BIN" inspect --format '{{range .Config.Entrypoint}}{{.}} {{end}}' "$IMAGE")"
|
||||
local DOCKER_IMAGE_ENTRYPOINT="$("$DOCKER_BIN" image inspect --format '{{range .Config.Entrypoint}}{{.}} {{end}}' "$IMAGE")"
|
||||
echo "ENTRYPOINT $DOCKER_IMAGE_ENTRYPOINT"
|
||||
}
|
||||
|
||||
@@ -763,7 +779,7 @@ get_cmd_from_image() {
|
||||
declare desc="return .Config.Cmd from passed image name"
|
||||
local IMAGE="$1"
|
||||
verify_image "$IMAGE"
|
||||
local DOCKER_IMAGE_CMD="$("$DOCKER_BIN" inspect --format '{{range .Config.Cmd}}{{.}} {{end}}' "$IMAGE")"
|
||||
local DOCKER_IMAGE_CMD="$("$DOCKER_BIN" image inspect --format '{{range .Config.Cmd}}{{.}} {{end}}' "$IMAGE")"
|
||||
DOCKER_IMAGE_CMD="${DOCKER_IMAGE_CMD/\/bin\/sh -c/}"
|
||||
echo "CMD $DOCKER_IMAGE_CMD"
|
||||
}
|
||||
@@ -801,7 +817,7 @@ get_container_ports() {
|
||||
local cid
|
||||
|
||||
for cid in $APP_CIDS; do
|
||||
local container_ports="$("$DOCKER_BIN" port "$cid" | awk '{ print $3 "->" $1}' | awk -F ":" '{ print $2 }')"
|
||||
local container_ports="$("$DOCKER_BIN" container port "$cid" | awk '{ print $3 "->" $1}' | awk -F ":" '{ print $2 }')"
|
||||
done
|
||||
|
||||
echo "$container_ports"
|
||||
@@ -907,24 +923,10 @@ internal_get_app_urls() {
|
||||
get_json_value() {
|
||||
declare desc="return value of provided json key from a json stream on stdin"
|
||||
# JSON_NODE should be expresses as either a top-level object that has no children
|
||||
# or in the format of json.node.path
|
||||
# or in the format of .json.node.path
|
||||
local JSON_NODE="$1"
|
||||
local JSON_NODE=${JSON_NODE//\./\"][\"}
|
||||
local JSON_NODE="[\"${JSON_NODE}\"]"
|
||||
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj'"${JSON_NODE}"').strip("\"")'
|
||||
}
|
||||
|
||||
get_json_keys() {
|
||||
declare desc="return space-separated list of json keys from json provided on stdin"
|
||||
# JSON_NODE should be expressed as json.node.path and is expected to have children
|
||||
local JSON_NODE="$1"
|
||||
local JSON_NODE=${JSON_NODE//\./\"][\"}
|
||||
local JSON_NODE="[\"${JSON_NODE}\"]"
|
||||
if [[ "$JSON_NODE" == "[\"\"]" ]]; then
|
||||
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj.keys())'
|
||||
else
|
||||
cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj'"${JSON_NODE}"'.keys())'
|
||||
fi
|
||||
cat | jq -r "${JSON_NODE} | select (.!=null)" 2>/dev/null
|
||||
}
|
||||
|
||||
strip_inline_comments() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core common plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
2
plugins/config/.gitignore
vendored
2
plugins/config/.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
/commands
|
||||
/subcommands/*
|
||||
/triggers/*
|
||||
/triggers
|
||||
|
||||
@@ -1,28 +1,5 @@
|
||||
include ../../common.mk
|
||||
|
||||
GO_ARGS ?= -a
|
||||
|
||||
SUBCOMMANDS = subcommands/export subcommands/get subcommands/set subcommands/unset subcommands/keys subcommands/bundle
|
||||
BUILD = commands subcommands
|
||||
PLUGIN_NAME = config
|
||||
|
||||
build-in-docker: clean
|
||||
docker run --rm \
|
||||
-v $$PWD/../..:$(GO_REPO_ROOT) \
|
||||
-w $(GO_REPO_ROOT)/plugins/config \
|
||||
$(BUILD_IMAGE) \
|
||||
bash -c "GO_ARGS='$(GO_ARGS)' make -j4 build" || exit $$?
|
||||
|
||||
build: commands subcommands
|
||||
|
||||
commands: **/**/commands.go
|
||||
go build $(GO_ARGS) -o commands src/commands/commands.go
|
||||
|
||||
subcommands: $(SUBCOMMANDS)
|
||||
|
||||
subcommands/%: src/subcommands/*/%.go
|
||||
go build $(GO_ARGS) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf commands subcommands
|
||||
|
||||
src-clean:
|
||||
rm -rf .gitignore src triggers vendor Makefile *.go glide.*
|
||||
include ../../common.mk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core config plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("config:bundle", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandBundle(args.Args(), *global, *merged)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
//clear all entries from the given environment
|
||||
func main() {
|
||||
args := flag.NewFlagSet("config:clear", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
noRestart := args.Bool("no-restart", false, "--no-restart: no restart")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandClear(args.Args(), *global, *noRestart)
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
// print the environment to stdout
|
||||
func main() {
|
||||
const defaultPrefix = "export "
|
||||
const defaultSeparator = "\n"
|
||||
args := flag.NewFlagSet("config:export", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | shell | pretty | json | json-list ] which format to export as)")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandExport(args.Args(), *global, *merged, *format)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
// get the given entries from the specified environment
|
||||
func main() {
|
||||
args := flag.NewFlagSet("config:get", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
quoted := args.Bool("quoted", false, "--quoted: get the value quoted")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandGet(args.Args(), *global, *quoted)
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("config:keys", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandKeys(args.Args(), *global, *merged)
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
// set the given entries to the specified environment
|
||||
func main() {
|
||||
args := flag.NewFlagSet("config:set", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
encoded := args.Bool("encoded", false, "--encoded: interpret VALUEs as base64")
|
||||
noRestart := args.Bool("no-restart", false, "--no-restart: no restart")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandSet(args.Args(), *global, *noRestart, *encoded)
|
||||
}
|
||||
67
plugins/config/src/subcommands/subcommands.go
Normal file
67
plugins/config/src/subcommands/subcommands.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
func main() {
|
||||
parts := strings.Split(os.Args[0], "/")
|
||||
subcommand := parts[len(parts)-1]
|
||||
|
||||
switch subcommand {
|
||||
case "bundle":
|
||||
args := flag.NewFlagSet("config:bundle", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandBundle(args.Args(), *global, *merged)
|
||||
case "clear":
|
||||
args := flag.NewFlagSet("config:clear", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
noRestart := args.Bool("no-restart", false, "--no-restart: no restart")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandClear(args.Args(), *global, *noRestart)
|
||||
case "export":
|
||||
args := flag.NewFlagSet("config:export", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | shell | pretty | json | json-list ] which format to export as)")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandExport(args.Args(), *global, *merged, *format)
|
||||
case "get":
|
||||
args := flag.NewFlagSet("config:get", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
quoted := args.Bool("quoted", false, "--quoted: get the value quoted")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandGet(args.Args(), *global, *quoted)
|
||||
case "keys":
|
||||
args := flag.NewFlagSet("config:keys", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandKeys(args.Args(), *global, *merged)
|
||||
case "set":
|
||||
args := flag.NewFlagSet("config:set", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
encoded := args.Bool("encoded", false, "--encoded: interpret VALUEs as base64")
|
||||
noRestart := args.Bool("no-restart", false, "--no-restart: no restart")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandSet(args.Args(), *global, *noRestart, *encoded)
|
||||
case "unset":
|
||||
args := flag.NewFlagSet("config:unset", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
noRestart := args.Bool("no-restart", false, "--no-restart: no restart")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandUnset(args.Args(), *global, *noRestart)
|
||||
default:
|
||||
common.LogFail(fmt.Sprintf("Invalid plugin subcommand call: %s", subcommand))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
//unset the given entries from the given environment
|
||||
func main() {
|
||||
args := flag.NewFlagSet("config:unset", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: use the global environment")
|
||||
noRestart := args.Bool("no-restart", false, "--no-restart: no restart")
|
||||
args.Parse(os.Args[2:])
|
||||
config.CommandUnset(args.Args(), *global, *noRestart)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core docker-options plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core domains plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core enter plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -60,7 +60,7 @@ enter_default_cmd() {
|
||||
has_tty && local DOKKU_RUN_OPTS+=" -i -t"
|
||||
is_image_herokuish_based "$IMAGE" && local EXEC_CMD="/exec"
|
||||
# shellcheck disable=SC2086
|
||||
"$DOCKER_BIN" exec $DOKKU_RUN_OPTS $ID $EXEC_CMD "${@:-$DOKKU_APP_SHELL}"
|
||||
"$DOCKER_BIN" container exec $DOKKU_RUN_OPTS $ID $EXEC_CMD "${@:-$DOKKU_APP_SHELL}"
|
||||
}
|
||||
|
||||
enter_default_cmd "$@"
|
||||
|
||||
@@ -67,7 +67,10 @@ git_build_app_repo() {
|
||||
fi
|
||||
|
||||
suppress_output env -u GIT_QUARANTINE_PATH git submodule update --init --recursive
|
||||
find . -name .git -prune -exec rm -rf {} \; >/dev/null
|
||||
local DOKKU_KEEP_GIT_DIR="$(fn-plugin-property-get "git" "$APP" "keep-git-dir" "")"
|
||||
if [[ "$DOKKU_KEEP_GIT_DIR" != "true" ]]; then
|
||||
find . -name .git -prune -exec rm -rf {} \; >/dev/null
|
||||
fi
|
||||
|
||||
if use_git_worktree; then
|
||||
pushd "$DOKKU_ROOT/$APP" >/dev/null
|
||||
@@ -238,7 +241,8 @@ fn-git-create-hook() {
|
||||
|
||||
cat >"$PRERECEIVE_HOOK" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
set -e; set -o pipefail;
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
cat | DOKKU_ROOT="$DOKKU_ROOT" dokku git-hook $APP
|
||||
EOF
|
||||
|
||||
@@ -35,9 +35,10 @@ cmd-git-report-single() {
|
||||
fi
|
||||
verify_app_name "$APP"
|
||||
local flag_map=(
|
||||
"--git-rev-env-var: $(fn-plugin-property-get "git" "$APP" "rev-env-var" "GIT_REV")"
|
||||
"--git-deploy-branch: $(fn-plugin-property-get "git" "$APP" "deploy-branch" "master")"
|
||||
"--git-global-deploy-branch: $(fn-plugin-property-get "git" "--global" "deploy-branch" "master")"
|
||||
"--git-keep-git-dir: $(fn-plugin-property-get "git" "$APP" "keep-git-dir" "false")"
|
||||
"--git-rev-env-var: $(fn-plugin-property-get "git" "$APP" "rev-env-var" "GIT_REV")"
|
||||
)
|
||||
|
||||
if [[ -z "$INFO_FLAG" ]]; then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core git plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -19,12 +19,12 @@ git-set-cmd() {
|
||||
local cmd="git:set" argv=("$@")
|
||||
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||
declare APP="$1" KEY="$2" VALUE="$3"
|
||||
local VALID_KEYS=("deploy-branch" "rev-env-var")
|
||||
local VALID_KEYS=("deploy-branch" "keep-git-dir" "rev-env-var")
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
|
||||
|
||||
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
|
||||
dokku_log_fail "Invalid key specified, valid keys include: deploy-branch, rev-env-var"
|
||||
dokku_log_fail "Invalid key specified, valid keys include: deploy-branch, keep-git-dir, rev-env-var"
|
||||
fi
|
||||
|
||||
if [[ -n "$VALUE" ]]; then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core logs plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
1
plugins/network/.gitignore
vendored
1
plugins/network/.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
/commands
|
||||
/subcommands/*
|
||||
/triggers/*
|
||||
/triggers
|
||||
/network-*
|
||||
/install
|
||||
/post-app-clone-setup
|
||||
|
||||
@@ -1,37 +1,6 @@
|
||||
include ../../common.mk
|
||||
|
||||
GO_ARGS ?= -a
|
||||
|
||||
SUBCOMMANDS = subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set
|
||||
TRIGGERS = triggers/install triggers/network-build-config triggers/network-compute-ports triggers/network-config-exists triggers/network-get-ipaddr triggers/network-get-listeners triggers/network-get-port triggers/network-get-property triggers/network-write-ipaddr triggers/network-write-port triggers/post-app-clone-setup triggers/post-create triggers/post-delete triggers/report
|
||||
build-in-docker: clean
|
||||
docker run --rm \
|
||||
-v $$PWD/../..:$(GO_REPO_ROOT) \
|
||||
-w $(GO_REPO_ROOT)/plugins/network \
|
||||
$(BUILD_IMAGE) \
|
||||
bash -c "GO_ARGS='$(GO_ARGS)' make -j4 build" || exit $$?
|
||||
BUILD = commands subcommands triggers
|
||||
PLUGIN_NAME = network
|
||||
|
||||
build: commands subcommands triggers
|
||||
$(MAKE) triggers-copy
|
||||
|
||||
commands: **/**/commands.go
|
||||
go build $(GO_ARGS) -o commands src/commands/commands.go
|
||||
|
||||
subcommands: $(SUBCOMMANDS)
|
||||
|
||||
subcommands/%: src/subcommands/*/%.go
|
||||
go build $(GO_ARGS) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf commands subcommands triggers network-* install post-app-clone-setup post-create post-delete report
|
||||
|
||||
src-clean:
|
||||
rm -rf .gitignore src triggers vendor Makefile *.go glide.*
|
||||
|
||||
triggers: $(TRIGGERS)
|
||||
|
||||
triggers/%: src/triggers/*/%.go
|
||||
go build $(GO_ARGS) -o $@ $<
|
||||
|
||||
triggers-copy:
|
||||
cp triggers/* .
|
||||
include ../../common.mk
|
||||
|
||||
@@ -132,7 +132,7 @@ func GetContainerPort(appName, processType string, isHerokuishContainer bool, co
|
||||
break
|
||||
}
|
||||
}
|
||||
cmd := sh.Command(common.DockerBin(), "port", containerID, port)
|
||||
cmd := sh.Command(common.DockerBin(), "container", "port", containerID, port)
|
||||
cmd.Stderr = ioutil.Discard
|
||||
b, err := cmd.Output()
|
||||
if err == nil {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core network plugin"
|
||||
version = "0.18.5"
|
||||
version = "0.19.7"
|
||||
[plugin.config]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user