Compare commits

...

72 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
431dc6c1a0 Release 0.19.2
# History

## 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
2019-10-18 12:30:02 -04:00
Jose Diaz-Gonzalez
8bb559c965 Merge pull request #3718 from dokku/3714-python-support
Detect correct python binary to use
2019-10-18 12:29:28 -04:00
Jose Diaz-Gonzalez
50863a9b76 fix: detect correct python binary to use
Ideally python usage goes away - the dokku-installer should become a mandatory cli command, and the plugin is rewritten in golang - but for now, we need to use the correct binary when running dokku.

Closes #3714
2019-10-17 14:24:47 -04:00
Jose Diaz-Gonzalez
a1860bae14 Release 0.19.1
# History

## 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
2019-10-14 20:12:50 -04:00
Jose Diaz-Gonzalez
fa8267ca09 Merge pull request #3713 from dokku/3711-tls13-support
Require nginx 1.13+ in order to enable tls1.3
2019-10-14 20:11:56 -04:00
Jose Diaz-Gonzalez
9dae004651 fix: require nginx 1.13+ in order to enable tls1.3
Closes #3711
2019-10-14 11:47:43 -04:00
Jose Diaz-Gonzalez
f9e163c63a fix: correct minor issue in history.md 2019-10-14 11:40:41 -04:00
Jose Diaz-Gonzalez
e561f87b17 fix: correct tag release 2019-10-14 11:40:27 -04:00
Jose Diaz-Gonzalez
78621481a6 Release 0.19.0
# History

## 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

### 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

### Other

- #3690: @
2019-10-14 05:50:49 -04:00
Jose Diaz-Gonzalez
92de37b23a Merge pull request #3687 from dokku/scheduler-post-run
Add scheduler-post-run trigger
2019-10-14 05:49:36 -04:00
Jose Diaz-Gonzalez
360c587086 feat: add scheduler-post-run trigger
After a `dokku run` container is created and started, this plugin trigger will allow developers to run auxiliary commands in response to that container.
2019-10-14 04:55:07 -04:00
Jose Diaz-Gonzalez
844b86840a Merge branch 'upcoming' of github.com:dokku/dokku into upcoming 2019-10-07 18:55:29 -05:00
Jose Diaz-Gonzalez
24c47e17f8 Merge pull request #3702 from dokku/better-output
Cleanup build and destroy logging output
2019-10-03 11:57:50 -04:00
Jose Diaz-Gonzalez
8c6e4c6483 Merge pull request #3701 from limenet/patch-1
Docs / Getting Started: use HTTPS instead of SSH for clone
2019-10-02 13:05:28 -04:00
Linus Metzler
34b5234e2f Use HTTPS instead of SSH for clone
If the user has not yet added their public key to GitHub, using SSH for clone results in an error message due to permission denied.
2019-10-02 11:03:41 +02:00
Jose Diaz-Gonzalez
b05a2b6da2 Merge pull request #3699 from robhudson/add-cleanup-help
Add `dokku cleanup` to help output
2019-09-28 20:59:33 -04:00
Rob Hudson
9ed22eafea Add dokku cleanup to help output
Fixes #3698
2019-09-27 12:50:16 -07:00
Jose Diaz-Gonzalez
498bdd0491 chore: cleanup build and destroy logging output 2019-09-20 12:31:19 -04:00
Jose Diaz-Gonzalez
92ac9cc729 Merge pull request #3693 from dokku/faster-calls
Remove ssh-keys user-auth trigger in favor of direct check in dokku binary
2019-09-20 12:28:51 -04:00
Jose Diaz-Gonzalez
9c68cd53fc refactor: remove ssh-keys user-auth trigger in favor of direct check in dokku binary 2019-09-20 01:25:42 -04:00
Jose Diaz-Gonzalez
3b3fc5d5c1 Merge pull request #3690 from dokku/3689-python-3
Add support for python3
2019-09-20 00:34:57 -04:00
Jose Diaz-Gonzalez
b4e95fe0d5 feat: add support for python3
- Use jq where possible
- Drop unused function (no usage across entire codebase nor in any github repository

Closes #3689
2019-09-19 23:33:43 -04:00
Jose Diaz-Gonzalez
7bd4d32cb3 Merge pull request #3691 from dokku/silence-trigger-logging
Silence trigger logging
2019-09-17 23:50:00 -04:00
Jose Diaz-Gonzalez
903d7ce614 chore: silence trigger logging
Logging that a trigger is about to be performed is a bit... extra. If folks want to know that a trigger is running, they can check the event logs.
2019-09-17 23:47:30 -04:00
Jose Diaz-Gonzalez
12f3c12070 Merge pull request #3688 from dokku/shfmt
Correct shfmt issues
2019-09-17 04:07:59 -04:00
Jose Diaz-Gonzalez
cb281e17e6 fix: correct shfmt issues 2019-09-17 02:22:41 -04:00
Jose Diaz-Gonzalez
06b565f3e5 Merge pull request #3685 from dokku/docker-run-labels
Allow passing labels to one-off dokku containers
2019-09-17 00:27:07 -04:00
Jose Diaz-Gonzalez
798725bb54 feat: allow passing labels to one-off dokku containers
This feature is allows users to add extra label metadata to one-off containers. As this can interfere with Dokku internals if they shadow labels used by plugins, care should be taken to avoid the `com.dokku` or `org.label-schema` namespace.

Also proper name run containers so they don't get random names from docker...
2019-09-16 23:10:14 -04:00
Jose Diaz-Gonzalez
a3ef91f2ae Merge pull request #3684 from dokku/no-betafish-push
Do not push betafish releases to docker hub
2019-09-16 21:48:57 -04:00
Jose Diaz-Gonzalez
cd28fe69a5 fix: do not push betafish releases to docker hub 2019-09-16 21:48:31 -04:00
Jose Diaz-Gonzalez
f1ead08549 Merge pull request #3681 from dokku/3675-openresty-support
Proper openresty support
2019-09-16 03:55:20 -04:00
Jose Diaz-Gonzalez
6e3fddb544 feat: add proper openresty support
This change allows supporting the openresty package as installed on Ubuntu 18.04 from the official openresty package repository, while also returning general nginx support.

Closes #3675
2019-09-16 03:05:35 -04:00
Jose Diaz-Gonzalez
dd2bbc7722 fix: allow test dhparam.pem to be copied into docker image 2019-09-16 03:04:42 -04:00
Jose Diaz-Gonzalez
a9ce738f68 feat: add openresty and runit support to packaging
Our docker image uses runit instead of init/systemd, hence the added sv support on Ubuntu operating systems.
2019-09-16 03:03:20 -04:00
Jose Diaz-Gonzalez
0e219b05e9 fest: handle both openresty and nginx in docker image builds 2019-09-16 03:02:01 -04:00
Jose Diaz-Gonzalez
ea9cf024d5 feat: always upgrade packages before further installation 2019-09-16 03:01:46 -04:00
Jose Diaz-Gonzalez
0d1952592e chore: standardize arguments to apt 2019-09-16 03:01:34 -04:00
Jose Diaz-Gonzalez
43e7ee06fb feat: rework layer to slightly speed up builds 2019-09-16 03:00:34 -04:00
Jose Diaz-Gonzalez
692bfa7cde feat: speed up docker image build by copying tmp dhparam file into place 2019-09-16 03:00:11 -04:00
Jose Diaz-Gonzalez
dbcfb7ee9f Merge pull request #3680 from dokku/updated-ssl-config
Follow updated intermediate recommendations from the Mozilla SSL Config Generator
2019-09-15 23:14:05 -04:00
Jose Diaz-Gonzalez
5f80cd3c20 feat: follow updated intermediate recommendations from the Mozilla SSL Config Generator 2019-09-15 22:24:37 -04:00
Jose Diaz-Gonzalez
eecee94e70 Merge pull request #3677 from dokku/package-improvements
Improve package build process
2019-09-15 21:10:28 -04:00
Jose Diaz-Gonzalez
f55dc640ec Merge pull request #3679 from dokku/keep-git-dir
Allow keeping the git directory during builds
2019-09-15 20:29:47 -04:00
Jose Diaz-Gonzalez
a4ac67a1e0 fix: drop unused import 2019-09-15 19:43:34 -04:00
Jose Diaz-Gonzalez
14838de344 feat: allow keeping the git directory during builds
It may be desirable to keep the contents of the git directory for the build process. Certain build tools can extract extra information from the .git directory, and some workflows may require that the shipped artifact has the entire source code available locally for later usage.
2019-09-15 19:15:35 -04:00
Jose Diaz-Gonzalez
6b6b1c2aa4 fix: drop pre-delete link 2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
8662f4550f fix: Should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) 2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
78dba3be3c fix: correct comments on go functions 2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
76911a7dc8 fix: drop executable perm on trace/plugin.toml 2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
68de421630 fix: correct lintian overrides 2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
ccbe0b0877 fix: correct bash-completion comment 2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
6a7d2e5252 refactor: decrease compile time for golang plugins
This change refactors the compiled golang plugins into 3 distinct binaries:

- commands: already existing
- subcommands/subcommands: entrypoint into all subcommands
- triggers: entrypoint into all triggers

It then further symlinks triggers and subcommands to the built binaries. This results in both a much faster build process as well as smaller package size.
2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
f83a03a3dc Merge pull request #3577 from dokku/management-commands
Use new-style docker management commands
2019-09-15 19:14:53 -04:00
Jose Diaz-Gonzalez
44fcea0ffa refactor: use new-style docker management commands
This PR uses the new syntax for commands introduced in Docker 1.13, making it a bit easier to understand just what a particular command is trying to do.

This also pushes the long-form syntax for docker command flags, which are also easier to understand at a glance.
2019-09-15 18:55:53 -04:00
Jose Diaz-Gonzalez
c02059c965 Merge pull request #3678 from dokku/running-containers
Add container-type to run and deploy containers
2019-09-15 18:53:02 -04:00
Jose Diaz-Gonzalez
92d2895d99 feat: add container-type to run and deploy containers 2019-09-15 17:17:56 -04:00
Jose Diaz-Gonzalez
2b93c76b1d Merge pull request #3671 from dokku/doc-url-override
Allow overriding checks doc url
2019-09-11 21:02:33 -04:00
Jose Diaz-Gonzalez
8cbaf1e004 feat: allow overriding checks doc url 2019-09-09 17:47:12 -04:00
Jose Diaz-Gonzalez
b4c4d5d70f Merge pull request #3662 from leshik/improve-nginx-ciphers-compatibility
Improve nginx ciphers compatibility
2019-09-06 23:53:36 -04:00
Jose Diaz-Gonzalez
a00d9de400 Merge pull request #3670 from dokku/update-python-test-reqs
Upgrade all python test deps
2019-09-06 22:25:35 -04:00
Jose Diaz-Gonzalez
a36ebd130d fix: upgrade all python test deps 2019-09-06 21:26:32 -04:00
Jose Diaz-Gonzalez
5b1763aa4a Merge pull request #3669 from dokku/3664-checks-workdir
Fix reference to CHECKS file location
2019-09-06 21:21:57 -04:00
Jose Diaz-Gonzalez
53c8f61ffc docs: fix reference to CHECKS file location
Closes #3664
2019-09-06 21:21:25 -04:00
Jose Diaz-Gonzalez
b806154e90 Merge pull request #3668 from dokku/release-latest-image
feat: release latest docker image on release
2019-09-06 21:07:15 -04:00
Jose Diaz-Gonzalez
1be6ace7b5 feat: release latest docker image on release
Also, always build a docker image for local testing.
2019-09-06 21:06:33 -04:00
Jose Diaz-Gonzalez
9d9530b01d Merge pull request #3659 from fzerorubigd/master
nginx-vhost: add support for grpc/grpcs port forward
2019-08-27 18:30:52 -04:00
fzerorubigd
c4838b4af9 add test for grpc on a port other than 80
fix docs a bout supporting only HTTP
remove extra spaces
2019-08-24 10:58:34 +02:00
Forud
5ca3ca5189 nginx-vhosts: add a note in the proxy management docs about grpc
[ci skip]
2019-08-23 15:34:34 +02:00
Forud
3457844687 nginx-vhost: add test for grpcs 2019-08-23 14:30:36 +02:00
fzerorubigd
346e8284c8 nginx-vhost: adding some test for the grpc 2019-08-23 10:00:12 +02:00
Alexey Zagarin
180a5e79c9 Improve nginx ciphers compatibility
Closes #3661.
2019-08-23 14:00:10 +07:00
fzerorubigd
377166d822 nginx-vhost: add support for grpc/grpcs port forward 2019-08-22 21:57:21 +02:00
196 changed files with 2261 additions and 1617 deletions

View File

@@ -7,6 +7,7 @@ build
docs
tests
!build/dokku.deb
!tests/dhparam.pem
!contrib/dokku-installer.py
!contrib/dokku-update
!contrib/bash-completion

View File

@@ -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/*

View File

@@ -1,5 +1,74 @@
# History
## 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:

View File

@@ -96,8 +96,8 @@ A fresh VM running any of the following operating systems:
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.2/bootstrap.sh
sudo DOKKU_TAG=v0.19.2 bash bootstrap.sh
```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.

View File

@@ -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)

View File

@@ -1,4 +1,4 @@
# bash completion for dd -*- shell-script -*-
# bash completion for dokku -*- shell-script -*-
_dokku_complete_verify() {
declare desc="shows bash completion"

View File

@@ -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)

View File

@@ -1,16 +1,20 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python
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.2'
hostname = ''
try:
@@ -47,12 +51,23 @@ 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).strip()
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:
@@ -79,7 +94,7 @@ 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)
@@ -203,7 +218,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 +236,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()

View File

@@ -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
View File

@@ -1,11 +1,11 @@
Package: dokku
Version: 0.18.5
Version: 0.19.2
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, python | python2.7 | 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

View File

@@ -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
View File

@@ -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
View File

@@ -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

74
debian/preinst vendored
View File

@@ -7,41 +7,53 @@ 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"

View File

@@ -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 "$@"

View 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;"

View 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/*;
}

View File

@@ -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.2 enabled dokku core standard plugin
20_events 0.19.2 enabled dokku core events logging plugin
app-json 0.19.2 enabled dokku core app-json plugin
apps 0.19.2 enabled dokku core apps plugin
build-env 0.19.2 enabled dokku core build-env plugin
buildpacks 0.19.2 enabled dokku core buildpacks plugin
certs 0.19.2 enabled dokku core certificate management plugin
checks 0.19.2 enabled dokku core checks plugin
common 0.19.2 enabled dokku core common plugin
config 0.19.2 enabled dokku core config plugin
docker-options 0.19.2 enabled dokku core docker-options plugin
domains 0.19.2 enabled dokku core domains plugin
enter 0.19.2 enabled dokku core enter plugin
git 0.19.2 enabled dokku core git plugin
logs 0.19.2 enabled dokku core logs plugin
network 0.19.2 enabled dokku core network plugin
nginx-vhosts 0.19.2 enabled dokku core nginx-vhosts plugin
plugin 0.19.2 enabled dokku core plugin plugin
proxy 0.19.2 enabled dokku core proxy plugin
ps 0.19.2 enabled dokku core ps plugin
repo 0.19.2 enabled dokku core repo plugin
resource 0.19.2 enabled dokku core resource plugin
scheduler-docker-local 0.19.2 enabled dokku core scheduler-docker-local plugin
shell 0.19.2 enabled dokku core shell plugin
ssh-keys 0.19.2 enabled dokku core ssh-keys plugin
storage 0.19.2 enabled dokku core storage plugin
tags 0.19.2 enabled dokku core tags plugin
tar 0.19.2 enabled dokku core tar plugin
trace 0.19.2 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.

View File

@@ -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.2/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>

View File

@@ -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.2\/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.2\/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.2\/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.2\/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.2\/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.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"

View File

@@ -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.2/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.2/docs/assets/gplaypattern.png);
padding: 45px 0;
text-align: center;
}

View File

@@ -15,6 +15,7 @@
"0.15.5",
"0.16.4",
"0.17.9",
"0.18.5"
"0.18.5",
"0.19.2"
]
}

View File

@@ -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. |

View File

@@ -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

View File

@@ -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 ""
```

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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`

View File

@@ -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

View File

@@ -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.2-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'

View File

@@ -3,7 +3,7 @@
Pull the dokku/dokku image:
```shell
docker pull dokku/dokku:0.18.5
docker pull dokku/dokku:0.19.2
```
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.2
```
Dokku is run with the following options:

View File

@@ -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.2/bootstrap.sh;
sudo DOKKU_TAG=v0.19.2 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.

View File

@@ -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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/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.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/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.2/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/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.2/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.2/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.2 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>

View File

@@ -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

View File

@@ -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.

View File

@@ -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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/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.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/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.2/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.19.2/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.2/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
View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core standard plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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/^/ /"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core events logging plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core app-json plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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")

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core apps plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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 "$@"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-dockerfile plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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"
}

View File

@@ -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"
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-herokuish plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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 "$@"

View File

@@ -1,6 +1,7 @@
/commands
/subcommands/*
/triggers/*
/triggers
/install
/post-delete
/post-extract

View File

@@ -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

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core buildpacks plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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())
}
}

View File

@@ -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())
}
}

View File

@@ -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())
}

View File

@@ -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())
}
}

View File

@@ -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)
}

View File

@@ -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())
}
}

View 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())
}
}

View File

@@ -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()))
}
}

View File

@@ -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())
}
}

View File

@@ -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, "")
}

View 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))
}
}

View File

@@ -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

View File

@@ -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()))

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core certificate management plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core checks plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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()
}

View File

@@ -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() {

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core common plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -1,2 +1,4 @@
/commands
/subcommands/*
/triggers/*
/triggers

View File

@@ -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

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core config plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View 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))
}
}

View File

@@ -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)
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core docker-options plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core domains plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core enter plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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 "$@"

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core git plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -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

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core logs plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

View File

@@ -1,6 +1,7 @@
/commands
/subcommands/*
/triggers/*
/triggers
/network-*
/install
/post-app-clone-setup

View File

@@ -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

View File

@@ -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 {

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core network plugin"
version = "0.18.5"
version = "0.19.2"
[plugin.config]

Some files were not shown because too many files have changed in this diff Show More