Compare commits

...

100 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
283ff056da Release 0.17.7
# History

## 0.17.7

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.7/bootstrap.sh
sudo DOKKU_TAG=v0.17.7 bash bootstrap.sh
```

### New Features

- #3586: @josegonzalez ps plugin parallel usage cleanup

### Documentation

- #3584: @josegonzalez Fix no-install-recommends documentation

### Other

- #3579: @znz Update plugin list
2019-06-10 16:06:24 -04:00
Jose Diaz-Gonzalez
9bcd81c8bd Merge pull request #3586 from dokku/parallel-cleanup
ps plugin parallel usage cleanup
2019-06-10 14:10:29 -04:00
Jose Diaz-Gonzalez
0ebb400d91 feat: allow users to specify custom parallel arguments 2019-06-10 13:07:23 -04:00
Jose Diaz-Gonzalez
fc5544ac70 refactor: use a single method for running the ps:*all commands
This reduces the duplication at the cost of slightly more complexity.
2019-06-10 13:05:57 -04:00
Jose Diaz-Gonzalez
4a7f13c3d8 Merge pull request #3584 from dokku/josegonzalez-patch-1
Fix no-install-recommends documentation
2019-06-09 17:03:22 +02:00
Jose Diaz-Gonzalez
737e4a5bf4 docs: fix no-install-recommends documentation
[ci skip]
2019-06-09 11:02:46 -04:00
Jose Diaz-Gonzalez
d047db108b Merge pull request #3579 from znz/update-plugin-list
Update plugin list
2019-06-04 10:05:20 -05:00
Kazuhiro NISHIYAMA
73f5fde99d Update output of plugin:list 2019-06-04 07:48:57 +09:00
Kazuhiro NISHIYAMA
a17ed7981e Use plugin:list instead of deprecated plugin 2019-06-04 07:48:45 +09:00
Jose Diaz-Gonzalez
8a5504574d Release 0.17.6
# History

## 0.17.6

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.6/bootstrap.sh
sudo DOKKU_TAG=v0.17.6 bash bootstrap.sh
```

### New Features

- #3578: @josegonzalez Allow omitting resource args by setting DOKKU_OMIT_RESOURCE_ARGS
2019-05-30 17:40:21 -04:00
Jose Diaz-Gonzalez
8ac35766f3 Merge pull request #3578 from dokku/allow-omit-resource-args
Allow omitting resource args by setting DOKKU_OMIT_RESOURCE_ARGS
2019-05-30 17:00:02 -04:00
Jose Diaz-Gonzalez
5fd5e235d8 feat: allow omitting resource args by setting DOKKU_OMIT_RESOURCE_ARGS
This is useful for one-off containers that should have full-access to server resources.
2019-05-30 13:24:11 -04:00
Jose Diaz-Gonzalez
8d526b964b Release 0.17.5
# History

## 0.17.5

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.5/bootstrap.sh
sudo DOKKU_TAG=v0.17.5 bash bootstrap.sh
```

### New Features

- #3576: @josegonzalez Allow setting DOCKER_BIN path for docker execution
2019-05-29 01:28:50 -04:00
Jose Diaz-Gonzalez
084906d684 Merge pull request #3576 from dokku/docker-bin
Allow setting DOCKER_BIN path for docker execution
2019-05-29 01:27:18 -04:00
Jose Diaz-Gonzalez
79d4f4578d fix: use correct method for executing dokku within tests 2019-05-29 00:46:56 -04:00
Jose Diaz-Gonzalez
785d9b4937 feat: allow setting DOCKER_BIN path for docker execution
This change allows operators to specify a DOCKER_BIN environment variable. This will specify a binary to run when executing docker, which is useful in cases where the 'docker' command being run must be modified in a way that would otherwise be invasive to Dokku, but minimalistic if done within a wrapper.
2019-05-29 00:46:19 -04:00
Jose Diaz-Gonzalez
0e03c82139 Release 0.17.4
# History

## 0.17.4

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.4/bootstrap.sh
sudo DOKKU_TAG=v0.17.4 bash bootstrap.sh
```

### New Features

- #3575: @josegonzalez Add a way to cleanup apps for specific schedulers
2019-05-28 17:22:06 -04:00
Jose Diaz-Gonzalez
84e33f2c57 Merge pull request #3575 from dokku/scheduler-post-delete
Add a way to cleanup apps for specific schedulers
2019-05-28 17:21:36 -04:00
Jose Diaz-Gonzalez
a6408c0c56 feat: add a way to cleanup apps for specific schedulers
The post-delete hook will delete config, and thus scheduler-post-delete is the best place to actually delete resources where some local config may be necessary in order to reference resources.
2019-05-28 17:21:10 -04:00
Jose Diaz-Gonzalez
915ef6a8d5 Release 0.17.3
# History

## 0.17.3

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.3/bootstrap.sh
sudo DOKKU_TAG=v0.17.3 bash bootstrap.sh
```

### Bug Fixes

- #3570: @znz Fix typos in trace help

### New Features

- #3574: @josegonzalez Add support for pulling app status from scheduler plugins
- #3571: @znz Simplify hostname_regex
2019-05-28 14:55:13 -04:00
Jose Diaz-Gonzalez
684f9fd175 Merge pull request #3574 from dokku/scheduler-app-status
Add support for pulling app status from scheduler plugins
2019-05-28 14:54:04 -04:00
Jose Diaz-Gonzalez
e276ebbc27 feat: add support for pulling app status from scheduler plugins
Previously, this was impossible to do if using an alternative scheduler.
2019-05-28 14:53:42 -04:00
Jose Diaz-Gonzalez
0988e62418 Merge pull request #3571 from znz/simplify-hostname_regex
Simplify hostname_regex
2019-05-24 18:01:14 -04:00
Jose Diaz-Gonzalez
bbc8c8a533 Merge pull request #3570 from znz/fix-typos
Fix typos in trace help
2019-05-23 11:51:31 -04:00
Kazuhiro NISHIYAMA
082e9458e5 Simplify hostname_regex
`[a-z0-9\.\*-]+` includes `\.` and `[a-z0-9\*-]+`.
So I think `^([a-z0-9\.\*-]+\.)*[a-z0-9\*-]+$` means last char is `[a-z0-9\*-]`
and other optional chars are `[a-z0-9\.\*-]*`.
2019-05-23 23:23:10 +09:00
Kazuhiro NISHIYAMA
0a17358352 Fix typos in trace help 2019-05-23 23:20:16 +09:00
Jose Diaz-Gonzalez
3a2bdd83f8 Release 0.17.2
# History

## 0.17.2

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.2/bootstrap.sh
sudo DOKKU_TAG=v0.17.2 bash bootstrap.sh
```

### Bug Fixes

- #3568: @josegonzalez Correct issue with clearing global domains
2019-05-23 07:02:38 -04:00
Jose Diaz-Gonzalez
625424de68 Merge pull request #3568 from dokku/fix-global-clearing
Correct issue with clearing global domains
2019-05-23 06:56:07 -04:00
Jose Diaz-Gonzalez
0d71293fca Delete FUNDING.yml 2019-05-23 06:40:45 -04:00
Jose Diaz-Gonzalez
b6128dc54e Create FUNDING.yml 2019-05-23 06:26:04 -04:00
Jose Diaz-Gonzalez
919ba7ed93 fix: correct issue with clearing global domains
Also update tests
2019-05-23 06:18:22 -04:00
Jose Diaz-Gonzalez
f80788147c Release 0.17.1
# History

## 0.17.1

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.1/bootstrap.sh
sudo DOKKU_TAG=v0.17.1 bash bootstrap.sh
```

### Bug Fixes

- #3567: @josegonzalez Ignore SC2064
2019-05-21 14:42:45 -04:00
Jose Diaz-Gonzalez
eb7deedd65 Merge pull request #3567 from dokku/SC2064-shellcheck
Ignore SC2064
2019-05-21 10:51:23 -07:00
Jose Diaz-Gonzalez
eb8347bcc1 fix: ignore SC2064
Late expansion was causing issues with variables not actually making it into the trap call, resulting in poor cleaning up temp files.
2019-05-21 11:02:24 -04:00
Jose Diaz-Gonzalez
48752a762c Release 0.17.0
# History

## 0.17.0

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.0/bootstrap.sh
sudo DOKKU_TAG=v0.17.0 bash bootstrap.sh
```

### Bug Fixes

- #3565: @josegonzalez Properly cleanup temp files
- #3563: @josegonzalez Properly split strings in sanitized ps:inspect
- #3560: @josegonzalez Resource setting fixes
- #3556: @josegonzalez Add missing domains:clear-global command
- #3554: @znz Switch from rawgit to jsdelivr in manifest.json too

### New Features

- #3566: @josegonzalez Allow users to specify wildcard domains
- #3564: @josegonzalez Add config:clear command
- #3477: @alexquick Allow specifying environment variables for dokku run
- #3540: @josegonzalez Do not append the global domain for matching subdomains
- #3559: @josegonzalez Add trace:on and trace:off
- #3561: @josegonzalez feat: disable scaling if app contains DOKKU_SCALE file
- #3558: @josegonzalez Add nginx:show-conf command
- #3549: @josegonzalez Add message indicating that the user is looking at default limits/reservations

### Documentation

- #3557: @josegonzalez Standardize on node-js-app in examples
- #3548: @josegonzalez Remove outdated global resource setting

### Other

- #3562: @josegonzalez Proxy ports manipulation updates
2019-05-20 22:23:13 -07:00
Jose Diaz-Gonzalez
42a405355f Merge pull request #3566 from dokku/3075-wildcard-domains
Allow users to specify wildcard domains
2019-05-20 22:22:44 -07:00
Jose Diaz-Gonzalez
b921aed073 feat: allow users to specify wildcard domains
Closes #3075
2019-05-20 21:03:55 -07:00
Jose Diaz-Gonzalez
73b8c3df55 Merge pull request #3565 from dokku/3473-tmp-cleanup
Properly cleanup temp files
2019-05-20 20:54:32 -07:00
Jose Diaz-Gonzalez
1b92f4a97e chore: standardize how temporary files are named 2019-05-20 18:01:17 -07:00
Jose Diaz-Gonzalez
c8a491ed7f fix: only use the RETURN signal for the suppress file removal
Closes #3473
2019-05-20 18:01:03 -07:00
Jose Diaz-Gonzalez
da4361583b fix: reverse quotes for variable expansion
Without reversing quotes, the variables are sometimes improperly expanded, resulting in files not being removed.
2019-05-20 17:56:50 -07:00
Jose Diaz-Gonzalez
0087296bd3 Merge pull request #3563 from dokku/3551-ps-inspect
Properly split strings in sanitized ps:inspect
2019-05-20 15:06:26 -07:00
Jose Diaz-Gonzalez
6221b7bf4a Merge pull request #3564 from dokku/3537-config-clear
Add config:clear command
2019-05-20 14:34:22 -07:00
Jose Diaz-Gonzalez
f977edabb2 feat: add config:clear command
Closes #3537
2019-05-20 13:26:21 -07:00
Jose Diaz-Gonzalez
980ffab600 fix: properly split strings in sanitized ps:inspect
Closes #3551
2019-05-20 12:58:41 -07:00
Jose Diaz-Gonzalez
a34d36c5d2 Merge pull request #3477 from alexquick/feature-run-env
Allow specifying environment variables for dokku run
2019-05-20 12:30:47 -07:00
Jose Diaz-Gonzalez
b2a0b69ed5 Merge branch 'master' into feature-run-env 2019-05-19 23:20:34 -07:00
Jose Diaz-Gonzalez
2315a127ea Merge pull request #3540 from dokku/3529-better-default-vhost
Do not append the global domain for matching subdomains
2019-05-19 23:00:17 -07:00
Jose Diaz-Gonzalez
1c1ff64c67 Merge pull request #3559 from dokku/3553-trace-mode
Add trace:on and trace:off
2019-05-19 22:59:56 -07:00
Jose Diaz-Gonzalez
9e2a129854 Merge pull request #3561 from dokku/3544-ps-can-scale
feat: disable scaling if app contains DOKKU_SCALE file
2019-05-19 22:59:08 -07:00
Jose Diaz-Gonzalez
a475af1974 Merge pull request #3562 from dokku/3550-proxy-ports-update
Proxy ports manipulation updates
2019-05-19 22:58:55 -07:00
Jose Diaz-Gonzalez
4264380e15 feat: disable scaling if app contains DOKKU_SCALE file
A DOKKU_SCALE file will always be used for managing the scale count for an app if it exists in a repository. As such, ps:scale usage should be disabled in those cases. This commit makes that more apparent.

Also document how to build a specific core plugin for testing purposes.

Closes #3544
2019-05-18 15:24:59 -07:00
Jose Diaz-Gonzalez
676aa1a05b docs: clarify proxy:ports-* commands
Closes #3550
2019-05-18 15:04:16 -07:00
Jose Diaz-Gonzalez
94c06bbdd2 fix: correct issue in proxy:ports-set invocation 2019-05-18 15:03:36 -07:00
Jose Diaz-Gonzalez
1c600b8846 Merge pull request #3560 from dokku/resource-setting-fixes
Resource setting fixes
2019-05-17 14:12:27 -04:00
Jose Diaz-Gonzalez
7dd9007607 fix: cpu limiting isn't available on CircleCI 2019-05-17 12:46:23 -04:00
Jose Diaz-Gonzalez
e71ad53b0e tests: check the cpu setting
Switch to 0.5 as its safer to run tests on a single-core VM
2019-05-17 12:03:35 -04:00
Jose Diaz-Gonzalez
a92687d3e8 fix: correct calls to fetch process-specific build and deploy args 2019-05-17 12:00:05 -04:00
Jose Diaz-Gonzalez
2aac9c71fc fix: cpu flag becomes cpus for the docker-scheduler 2019-05-17 11:59:15 -04:00
Jose Diaz-Gonzalez
ceac86b58f fix: correct issue where resource setting was overriding pre-existing values 2019-05-17 11:58:53 -04:00
Jose Diaz-Gonzalez
3fb8a576a0 fix: add trace:on and trace:off
Closes #3553
2019-05-16 18:24:59 -04:00
Jose Diaz-Gonzalez
c786b9e45e Merge pull request #3558 from dokku/3552-nginx-show-conf
Add nginx:show-conf command
2019-05-16 17:27:53 -04:00
Jose Diaz-Gonzalez
68fcd67327 feat: Add nginx:show-conf command
Closes #3552
2019-05-14 18:03:16 -04:00
Jose Diaz-Gonzalez
a54fa57136 Merge pull request #3557 from dokku/docs-sample
Standardize on node-js-app in examples
2019-05-14 17:55:37 -04:00
Jose Diaz-Gonzalez
343a6a159f docs: standardize on node-js-app in examples
[ci skip]
2019-05-14 17:55:00 -04:00
Jose Diaz-Gonzalez
dc2a680a29 Merge pull request #3549 from dokku/resource-default
Add message indicating that the user is looking at default limits/reservations
2019-05-14 12:43:58 -04:00
Jose Diaz-Gonzalez
72fce08e87 feat: add message indicating that the user is looking at default limits/reservations
Without this bit of metadata, it appears to the user that the resource limits are just that, whereas this is actually scoped to per-process-type.
2019-05-14 12:43:37 -04:00
Jose Diaz-Gonzalez
b60934629e Merge pull request #3556 from dokku/domains-clear-global
Add missing domains:clear-global command
2019-05-14 12:01:17 -04:00
Jose Diaz-Gonzalez
e59f115311 fix: add missing domains:clear-global command 2019-05-14 11:59:44 -04:00
Jose Diaz-Gonzalez
19dd92e6c7 Merge pull request #3554 from znz/rawgit-to-jsdelivr
Switch from rawgit to jsdelivr in manifest.json too
2019-05-14 10:34:36 -04:00
Kazuhiro NISHIYAMA
aab390edb6 Switch from rawgit to jsdelivr in manifest.json too
ref bb8d0324b5
2019-05-14 23:20:58 +09:00
Jose Diaz-Gonzalez
0c11068129 Merge pull request #3548 from dokku/docs-no-global-resource
Remove outdated global resource setting
2019-05-13 17:33:08 -04:00
Jose Diaz-Gonzalez
ad804f6d3f docs: remove outdated global resource setting
This was removed in c9bbddcfcb as it was more complicated for operators to figure out _exactly_ which combination of limits/reservations would apply to their applications. Unfortunately, the documentation was never updated.

We may re-add this functionality in the future, but for now, cleaning up the docs is the best option.

[ci skip]
2019-05-13 17:32:42 -04:00
Jose Diaz-Gonzalez
de43eb1e3d Release 0.16.4
# History

## 0.16.4

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.4/bootstrap.sh
sudo DOKKU_TAG=v0.16.4 bash bootstrap.sh
```

### Bug Fixes

- #3547: @josegonzalez Correct retrieval of resource values for alternative schedulers

### New Features

- #3546: @josegonzalez Add ability to trigger an arbitrary plugin hook
2019-05-13 16:39:33 -04:00
Jose Diaz-Gonzalez
5d9daa9367 Merge pull request #3546 from dokku/plugin-trigger
feat: add ability to trigger an arbitrary plugin hook
2019-05-13 16:38:59 -04:00
Jose Diaz-Gonzalez
0d9e424ede Merge pull request #3547 from dokku/fix-resource-fetching
Correct retrieval of resource values for alternative schedulers
2019-05-13 16:38:42 -04:00
Jose Diaz-Gonzalez
603dc0fad6 fix: correct retrieval of resource values for alternative schedulers 2019-05-13 16:37:57 -04:00
Jose Diaz-Gonzalez
0cf03baa78 feat: add ability to trigger an arbitrary plugin hook
This is useful in cases where the command output must be tested, but it is otherwise embedded in a specific part of the dokku core.
As the 'plugin' commands require root, this is safe to add to the core.
2019-05-13 16:17:55 -04:00
Jose Diaz-Gonzalez
ba3af25423 Release 0.16.3
# History

## 0.16.3

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.3/bootstrap.sh
sudo DOKKU_TAG=v0.16.3 bash bootstrap.sh
```

### Bug Fixes

- #3541: @josegonzalez Handle case where image is null on first deploy

### New Features

- #3543: @josegonzalez Add ability to clear global domains
- #3517: @josegonzalez SSH key updates
- #3538: @josegonzalez Silence dokku run 'errors'

### Documentation

- #3523: @MarcDiethelm Add an example how to specify a Dockerfile for deployment
- #3539: @josegonzalez Warn users when ufw is enabled
2019-05-13 13:54:35 -04:00
Jose Diaz-Gonzalez
a084c62e3f Merge pull request #3543 from dokku/domains-global-clear
Add ability to clear global domains
2019-05-13 12:45:49 -04:00
Jose Diaz-Gonzalez
b429af8ff2 feat: do not append the global domain for matching subdomains
If the subdomain is url-like, assume it is a valid url and use it for the default domain name. This allows users to specify the default domain for an app even if that is a subdomain of a global vhost.

Closes #3529
2019-05-13 12:07:52 -04:00
Jose Diaz-Gonzalez
287f383f6c feat: add ability to clear global domains 2019-05-13 12:00:26 -04:00
Jose Diaz-Gonzalez
aefb24082d Merge pull request #3517 from dokku/ssh-key-updates
SSH key updates
2019-05-13 00:56:36 -04:00
Jose Diaz-Gonzalez
dee0144c7c fix: add missing awk to get number of lines in key file 2019-05-12 19:08:55 -04:00
Jose Diaz-Gonzalez
6ca4813247 fix: invert check 2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez
a717cb99a3 fix: correct shfmt and update error message 2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez
8551dfb297 refactor: switch to temporary file for key verification 2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez
6a5bbd63a3 refactor: always use a temp file for interacting with ssh keys
Rather than have stdin open everywhere, try to coerce input into a temporary file for later use.
2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez
ca0b2937b9 refactor: fetch ssh key via argument before stdin
This allows the ssh-keys:add command to work in environments where there is no stdin/tty available, such as via server automation.
2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez
948d507909 chore: update dockerignore for upcoming install from docker
[ci skip]
2019-05-12 19:03:02 -04:00
Jose Diaz-Gonzalez
037324d850 Merge pull request #3523 from MarcDiethelm/pr/dockerfile-file-option-example
Add an example how to specify a Dockerfile for deployment
2019-05-12 18:59:09 -04:00
Jose Diaz-Gonzalez
6006303409 docs: clarify that a dockerfile is still needed
[ci skip]
2019-05-12 18:58:28 -04:00
Jose Diaz-Gonzalez
d1b1841034 Merge pull request #3541 from dokku/null-herokuish-image
Handle case where image is null on first deploy
2019-05-12 18:51:32 -04:00
Jose Diaz-Gonzalez
bc70a24e1d fix: handle case where image is null on first deploy 2019-05-12 07:37:21 -04:00
Jose Diaz-Gonzalez
acc2e84eda Merge pull request #3539 from dokku/3455-ufw-warn
Warn users when ufw is enabled
2019-05-12 07:14:15 -04:00
Jose Diaz-Gonzalez
4f23dd2dd6 docs: Warn users when ufw is enabled
Closes #3455
2019-05-12 06:09:05 -04:00
Jose Diaz-Gonzalez
3a5f68e4d1 Merge pull request #3538 from dokku/3522-silence-dokku-run
feat: silence dokku run 'errors'
2019-05-12 05:56:29 -04:00
Jose Diaz-Gonzalez
d30a948be0 feat: silence dokku run 'errors'
In certain cases, a command can be specified but found - or not - in the Procfile, resulting in unnecessary output for cron tasks.

Closes #3522
2019-05-12 05:15:53 -04:00
Alex Quick
dad5db4e9b [feature] add --env to dokku run
`dokku run [ --env KEY=VALUE | -e KEY=VALUE ] app command`

__note__ this changes the scheduler-run trigger to expect the following arguments:
scheduler_name, app_name, env_count, env_0, ..., env_n, app_arg_0, ..., app_arg_n

resolves: dokku/dokku#3291
2019-04-28 14:42:07 -04:00
Marc Diethelm
d356cef183 Adds an example how to specify a Dockerfile for deployment 2019-04-27 14:32:08 +02:00
146 changed files with 1276 additions and 650 deletions

View File

@@ -9,3 +9,5 @@ tests
!contrib/dokku-installer.py !contrib/dokku-installer.py
!contrib/dokku-update !contrib/dokku-update
!contrib/bash-completion !contrib/bash-completion
!contrib/docker
vendor

View File

@@ -1,5 +1,187 @@
# History # History
## 0.17.7
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.7/bootstrap.sh
sudo DOKKU_TAG=v0.17.7 bash bootstrap.sh
```
### New Features
- #3586: @josegonzalez ps plugin parallel usage cleanup
### Documentation
- #3584: @josegonzalez Fix no-install-recommends documentation
### Other
- #3579: @znz Update plugin list
## 0.17.6
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.6/bootstrap.sh
sudo DOKKU_TAG=v0.17.6 bash bootstrap.sh
```
### New Features
- #3578: @josegonzalez Allow omitting resource args by setting DOKKU_OMIT_RESOURCE_ARGS
## 0.17.5
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.5/bootstrap.sh
sudo DOKKU_TAG=v0.17.5 bash bootstrap.sh
```
### New Features
- #3576: @josegonzalez Allow setting DOCKER_BIN path for docker execution
## 0.17.4
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.4/bootstrap.sh
sudo DOKKU_TAG=v0.17.4 bash bootstrap.sh
```
### New Features
- #3575: @josegonzalez Add a way to cleanup apps for specific schedulers
## 0.17.3
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.3/bootstrap.sh
sudo DOKKU_TAG=v0.17.3 bash bootstrap.sh
```
### Bug Fixes
- #3570: @znz Fix typos in trace help
### New Features
- #3574: @josegonzalez Add support for pulling app status from scheduler plugins
- #3571: @znz Simplify hostname_regex
## 0.17.2
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.2/bootstrap.sh
sudo DOKKU_TAG=v0.17.2 bash bootstrap.sh
```
### Bug Fixes
- #3568: @josegonzalez Correct issue with clearing global domains
## 0.17.1
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.1/bootstrap.sh
sudo DOKKU_TAG=v0.17.1 bash bootstrap.sh
```
### Bug Fixes
- #3567: @josegonzalez Ignore SC2064
## 0.17.0
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.0/bootstrap.sh
sudo DOKKU_TAG=v0.17.0 bash bootstrap.sh
```
### Bug Fixes
- #3565: @josegonzalez Properly cleanup temp files
- #3563: @josegonzalez Properly split strings in sanitized ps:inspect
- #3560: @josegonzalez Resource setting fixes
- #3556: @josegonzalez Add missing domains:clear-global command
- #3554: @znz Switch from rawgit to jsdelivr in manifest.json too
### New Features
- #3566: @josegonzalez Allow users to specify wildcard domains
- #3564: @josegonzalez Add config:clear command
- #3477: @alexquick Allow specifying environment variables for dokku run
- #3540: @josegonzalez Do not append the global domain for matching subdomains
- #3559: @josegonzalez Add trace:on and trace:off
- #3561: @josegonzalez feat: disable scaling if app contains DOKKU_SCALE file
- #3558: @josegonzalez Add nginx:show-conf command
- #3549: @josegonzalez Add message indicating that the user is looking at default limits/reservations
### Documentation
- #3557: @josegonzalez Standardize on node-js-app in examples
- #3548: @josegonzalez Remove outdated global resource setting
### Other
- #3562: @josegonzalez Proxy ports manipulation updates
## 0.16.4
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.4/bootstrap.sh
sudo DOKKU_TAG=v0.16.4 bash bootstrap.sh
```
### Bug Fixes
- #3547: @josegonzalez Correct retrieval of resource values for alternative schedulers
### New Features
- #3546: @josegonzalez Add ability to trigger an arbitrary plugin hook
## 0.16.3
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.3/bootstrap.sh
sudo DOKKU_TAG=v0.16.3 bash bootstrap.sh
```
### Bug Fixes
- #3541: @josegonzalez Handle case where image is null on first deploy
### New Features
- #3543: @josegonzalez Add ability to clear global domains
- #3517: @josegonzalez SSH key updates
- #3538: @josegonzalez Silence dokku run 'errors'
### Documentation
- #3523: @MarcDiethelm Add an example how to specify a Dockerfile for deployment
- #3539: @josegonzalez Warn users when ufw is enabled
## 0.16.2 ## 0.16.2
Install/update via the bootstrap script: Install/update via the bootstrap script:

View File

@@ -29,9 +29,7 @@
### Additional information ### Additional information
- Container Inspect Output (if applicable): - Container Inspect Output (if applicable) via `dokku inspect APP_NAME`
- 0.13.0+: `dokku inspect APP_NAME`
- <0.13.0: `docker inspect CONTAINER_ID`: WARNING, `docker inspect` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX.
- `cat /home/dokku/<app>/nginx.conf` (if applicable): - `cat /home/dokku/<app>/nginx.conf` (if applicable):
- Link to the exact repository being deployed (if possible/applicable): - Link to the exact repository being deployed (if possible/applicable):
- If a deploy is failing or behaving unexpectedly: - If a deploy is failing or behaving unexpectedly:
@@ -40,5 +38,5 @@
- If using buildpacks, which custom buildpacks are in use - If using buildpacks, which custom buildpacks are in use
- If using a `Dockerfile`, the contents of that file - If using a `Dockerfile`, the contents of that file
- If it exists, the contents of your `Procfile`. - If it exists, the contents of your `Procfile`.
- Output of failing Dokku commands after running `dokku trace on` - Output of failing Dokku commands after running `dokku trace:on`
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX): (BEWARE: `trace:on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):

View File

@@ -98,8 +98,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`: To install the latest stable release, run the following commands as a user who has access to `sudo`:
```shell ```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.2/bootstrap.sh wget https://raw.githubusercontent.com/dokku/dokku/v0.17.7/bootstrap.sh
sudo DOKKU_TAG=v0.16.2 bash bootstrap.sh sudo DOKKU_TAG=v0.17.7 bash bootstrap.sh
``` ```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation. You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.

View File

@@ -10,7 +10,7 @@ import subprocess
import sys import sys
import threading import threading
VERSION = 'v0.16.2' VERSION = 'v0.17.7'
hostname = '' hostname = ''
try: try:
@@ -37,6 +37,15 @@ if os.path.isfile(key_file):
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
pass pass
ufw_display = 'block'
try:
command = "sudo ufw status"
ufw_output = subprocess.check_output(command, shell=True).strip()
if "inactive" in ufw_output:
ufw_display = 'none'
except subprocess.CalledProcessError:
ufw_display = 'none'
def check_boot(): def check_boot():
if 'onboot' not in sys.argv: if 'onboot' not in sys.argv:
@@ -77,6 +86,7 @@ def check_boot():
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self): def do_GET(self):
content = PAGE.replace('{VERSION}', VERSION) content = PAGE.replace('{VERSION}', VERSION)
content = content.replace('{UFW_DISPLAY}', ufw_display)
content = content.replace('{HOSTNAME}', hostname) content = content.replace('{HOSTNAME}', hostname)
content = content.replace('{AUTHORIZED_KEYS_LOCATION}', key_file) content = content.replace('{AUTHORIZED_KEYS_LOCATION}', key_file)
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys)) content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
@@ -294,6 +304,9 @@ PAGE = """
<small class="form-text text-muted">When enabled, Nginx will be run on port 80 and proxy requests to apps based on hostname.</small> <small class="form-text text-muted">When enabled, Nginx will be run on port 80 and proxy requests to apps based on hostname.</small>
<small class="form-text text-muted">When disabled, a specific port will be setup for each application on first deploy, and requests to that port will be proxied to the relevant app.</small> <small class="form-text text-muted">When disabled, a specific port will be setup for each application on first deploy, and requests to that port will be proxied to the relevant app.</small>
</div> </div>
<div class="alert alert-warning small mt-3 d-{UFW_DISPLAY}" role="alert">
<strong>Warning:</strong> UFW is active. To allow traffic to specific ports, run <code>sudo ufw allow PORT</code> for the port in question.
</div>
<div class="bd-callout bd-callout-info"> <div class="bd-callout bd-callout-info">
<h5>What will app URLs look like?</h5> <h5>What will app URLs look like?</h5>
<pre><code id="example">http://hostname:port</code></pre> <pre><code id="example">http://hostname:port</code></pre>

2
debian/control vendored
View File

@@ -1,5 +1,5 @@
Package: dokku Package: dokku
Version: 0.16.2 Version: 0.17.7
Section: web Section: web
Priority: optional Priority: optional
Architecture: amd64 Architecture: amd64

View File

@@ -8,6 +8,7 @@ plugin:enable <name> # Enable a previously disabled plugin
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]] # Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones) plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]] # Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
plugin:install-dependencies [--core] # Run install-dependencies trigger for active plugins (or only core ones) plugin:install-dependencies [--core] # Run install-dependencies trigger for active plugins (or only core ones)
plugin:list # Print active plugins plugin:list # Print active plugins
plugin:trigger <args...>. # Trigger an arbitrary plugin hook
plugin:uninstall <name> # Uninstall a plugin (third-party only) plugin:uninstall <name> # Uninstall a plugin (third-party only)
plugin:update [name [committish]] # Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins plugin:update [name [committish]] # Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
``` ```
@@ -23,39 +24,43 @@ dokku plugins-install
## Usage ## Usage
You can list all installed plugins using the `plugin` command: You can list all installed plugins using the `plugin:list` command:
```shell ```shell
dokku plugin dokku plugin:list
``` ```
``` ```
plugn: dev plugn: dev
00_dokku-standard 0.16.2 enabled dokku core standard plugin 00_dokku-standard 0.17.7 enabled dokku core standard plugin
20_events 0.16.2 enabled dokku core events logging plugin 20_events 0.17.7 enabled dokku core events logging plugin
apps 0.16.2 enabled dokku core apps plugin app-json 0.17.7 enabled dokku core app-json plugin
build-env 0.16.2 enabled dokku core build-env plugin apps 0.17.7 enabled dokku core apps plugin
certs 0.16.2 enabled dokku core certificate management plugin build-env 0.17.7 enabled dokku core build-env plugin
checks 0.16.2 enabled dokku core checks plugin buildpacks 0.17.7 enabled dokku core buildpacks plugin
common 0.16.2 enabled dokku core common plugin certs 0.17.7 enabled dokku core certificate management plugin
config 0.16.2 enabled dokku core config plugin checks 0.17.7 enabled dokku core checks plugin
docker-options 0.16.2 enabled dokku core docker-options plugin common 0.17.7 enabled dokku core common plugin
domains 0.16.2 enabled dokku core domains plugin config 0.17.7 enabled dokku core config plugin
enter 0.16.2 enabled dokku core enter plugin docker-options 0.17.7 enabled dokku core docker-options plugin
git 0.16.2 enabled dokku core git plugin domains 0.17.7 enabled dokku core domains plugin
logs 0.16.2 enabled dokku core logs plugin enter 0.17.7 enabled dokku core enter plugin
named-containers 0.16.2 enabled dokku core named containers plugin git 0.17.7 enabled dokku core git plugin
network 0.16.2 enabled dokku core network plugin logs 0.17.7 enabled dokku core logs plugin
nginx-vhosts 0.16.2 enabled dokku core nginx-vhosts plugin network 0.17.7 enabled dokku core network plugin
plugin 0.16.2 enabled dokku core plugin plugin nginx-vhosts 0.17.7 enabled dokku core nginx-vhosts plugin
proxy 0.16.2 enabled dokku core proxy plugin plugin 0.17.7 enabled dokku core plugin plugin
ps 0.16.2 enabled dokku core ps plugin proxy 0.17.7 enabled dokku core proxy plugin
repo 0.16.2 enabled dokku core repo plugin ps 0.17.7 enabled dokku core ps plugin
shell 0.16.2 enabled dokku core shell plugin repo 0.17.7 enabled dokku core repo plugin
ssh-keys 0.16.2 enabled dokku core ssh-keys plugin resource 0.17.7 enabled dokku core resource plugin
storage 0.16.2 enabled dokku core storage plugin scheduler-docker-local 0.17.7 enabled dokku core scheduler-docker-local plugin
tags 0.16.2 enabled dokku core tags plugin shell 0.17.7 enabled dokku core shell plugin
tar 0.16.2 enabled dokku core tar plugin ssh-keys 0.17.7 enabled dokku core ssh-keys plugin
storage 0.17.7 enabled dokku core storage plugin
tags 0.17.7 enabled dokku core tags plugin
tar 0.17.7 enabled dokku core tar plugin
trace 0.17.7 enabled dokku core trace plugin
``` ```
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins. 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

@@ -70,11 +70,31 @@ dokku resource:limit --cpu 100 --memory 100 --process-type worker node-js-app
#### Displaying Resource Limits #### Displaying Resource Limits
Running the `resource:limits` command without any flags will display the currently configured app reservation. Running the `resource:limit` command without any flags will display the currently configured default app limits.
```shell ```shell
dokku resource:limits node-js-app dokku resource:limit node-js-app
=====> resource limits node-js-app information ```
```
=====> resource limits node-js-app information [defaults]
cpu:
memory:
memory-swap: 100
network: 100
network-ingress:
network-egress:
```
This may also be combined with the `--process-type` flag to see app limits on a process-type level. Note that the displayed values are not merged with the defaults.
```shell
dokku resource:limit --process-type web node-js-app
```
```
=====> resource limits node-js-app information (web)
cpu: 100 cpu: 100
memory: 100 memory: 100
memory-swap: memory-swap:
@@ -83,64 +103,6 @@ dokku resource:limits node-js-app
network-egress: network-egress:
``` ```
#### Global Resource Limits
By default, Dokku does not limit any resources, though these can be specified at the server level via the `--global` flag on the `resource:limit` command.
```shell
dokku resource:limit --global --memory 200
```
```
=====> Setting default resource limits
memory: 200
```
This may also be combined with the `--process-type` flag to set global limits on a process-type level:
```shell
dokku resource:limit --global --memory 150 --process-type web node-js-app
```
```
=====> Setting default resource limits (web)
memory: 150
```
#### Displaying Global Resource Limits
Running the `resource:limit` command with only the `--global` flag will display the currently configured default limits.
```shell
dokku resource:limit --global
```
```
=====> resource limits default information
cpu:
memory: 200
memory-swap:
network:
network-ingress:
network-egress:
```
This may also be combined with the `--process-type` flag to see global limits on a process-type level:
```shell
dokku resource:limit --global --process-type web
```
```
=====> resource limits default information (web)
cpu:
memory-swap:
memory: 150
network-egress:
network-ingress:
network:
```
#### Clearing Resource Limits #### Clearing Resource Limits
In cases where the values are incorrect - or there is no desire to limit resources - resource limits may be cleared using the `resource:limit-clear` command. In cases where the values are incorrect - or there is no desire to limit resources - resource limits may be cleared using the `resource:limit-clear` command.
@@ -204,11 +166,14 @@ dokku resource:reserve --cpu 100 --memory 100 --process-type worker node-js-app
#### Displaying Resource Reservations #### Displaying Resource Reservations
Running the `resource:reserve` command without any flags will display the currently configured app reservation. Running the `resource:reserve` command without any flags will display the currently configured default app reservations.
```shell ```shell
dokku resource:reserve node-js-app dokku resource:reserve node-js-app
=====> resource reservation node-js-app information ```
```
=====> resource reservation node-js-app information [defaults]
cpu: 100 cpu: 100
memory: 100 memory: 100
memory-swap: memory-swap:
@@ -217,64 +182,22 @@ dokku resource:reserve node-js-app
network-egress: network-egress:
``` ```
#### Global Resource Reservations This may also be combined with the `--process-type` flag to see app reservations on a process-type level. Note that the displayed values are not merged with the defaults.
By default, Dokku does not reserve any resources, though these can be specified at the server level via the `--global` flag on the `resource:reserve` command.
```shell ```shell
dokku resource:reserve --global --memory 200 dokku resource:reserve --process-type web node-js-app
``` ```
``` ```
=====> Setting default resource reservation =====> resource reservation node-js-app information (web)
memory: 200 cpu: 100
``` memory: 100
This may also be combined with the `--process-type` flag to set global reservations on a process-type level:
```shell
dokku resource:reserve --global --memory 150 --process-type web node-js-app
```
```
=====> Setting default resource reservation (web)
memory: 150
```
#### Displaying Global Resource Reservations
Running the `resource:reserve` command with only the `--global` flag will display the currently configured default reservation.
```shell
dokku resource:reserve --global
```
```
=====> resource reservation default information
cpu:
memory: 200
memory-swap: memory-swap:
network: network:
network-ingress: network-ingress:
network-egress: network-egress:
``` ```
This may also be combined with the `--process-type` flag to see global reservations on a process-type level:
```shell
dokku resource:reserve --global --process-type web
```
```
=====> resource reservation default information (web)
cpu:
memory-swap:
memory: 150
network-egress:
network-ingress:
network:
```
#### Clearing Resource Reservations #### Clearing Resource Reservations
In cases where the values are incorrect - or there is no desire to reserve resources - resource reservations may be cleared using the `resource:reserve-clear` command. In cases where the values are incorrect - or there is no desire to reserve resources - resource reservations may be cleared using the `resource:reserve-clear` command.

View File

@@ -2,10 +2,10 @@
<browserconfig> <browserconfig>
<msapplication> <msapplication>
<tile> <tile>
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/mstile-70x70.png"/> <square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/mstile-150x150.png"/> <square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/mstile-310x310.png"/> <square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/mstile-310x150.png"/> <wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/mstile-310x150.png"/>
<TileColor>#da532c</TileColor> <TileColor>#da532c</TileColor>
</tile> </tile>
</msapplication> </msapplication>

View File

@@ -2,37 +2,37 @@
"name": "Dokku", "name": "Dokku",
"icons": [ "icons": [
{ {
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.16.2\/docs\/assets\/favicons\/android-chrome-36x36.png", "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.7\/docs\/assets\/favicons\/android-chrome-36x36.png",
"sizes": "36x36", "sizes": "36x36",
"type": "image\/png", "type": "image\/png",
"density": "0.75" "density": "0.75"
}, },
{ {
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.16.2\/docs\/assets\/favicons\/android-chrome-48x48.png", "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.7\/docs\/assets\/favicons\/android-chrome-48x48.png",
"sizes": "48x48", "sizes": "48x48",
"type": "image\/png", "type": "image\/png",
"density": "1.0" "density": "1.0"
}, },
{ {
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.16.2\/docs\/assets\/favicons\/android-chrome-72x72.png", "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.7\/docs\/assets\/favicons\/android-chrome-72x72.png",
"sizes": "72x72", "sizes": "72x72",
"type": "image\/png", "type": "image\/png",
"density": "1.5" "density": "1.5"
}, },
{ {
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.16.2\/docs\/assets\/favicons\/android-chrome-96x96.png", "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.7\/docs\/assets\/favicons\/android-chrome-96x96.png",
"sizes": "96x96", "sizes": "96x96",
"type": "image\/png", "type": "image\/png",
"density": "2.0" "density": "2.0"
}, },
{ {
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.16.2\/docs\/assets\/favicons\/android-chrome-144x144.png", "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.7\/docs\/assets\/favicons\/android-chrome-144x144.png",
"sizes": "144x144", "sizes": "144x144",
"type": "image\/png", "type": "image\/png",
"density": "3.0" "density": "3.0"
}, },
{ {
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.16.2\/docs\/assets\/favicons\/android-chrome-192x192.png", "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.7\/docs\/assets\/favicons\/android-chrome-192x192.png",
"sizes": "192x192", "sizes": "192x192",
"type": "image\/png", "type": "image\/png",
"density": "4.0" "density": "4.0"

View File

@@ -39,13 +39,13 @@ h1 {
font-size: 1.6em; font-size: 1.6em;
} }
.header .navbar-brand a { .header .navbar-brand a {
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/dokku.png); background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/dokku.png);
text-indent: 40px; text-indent: 40px;
} }
.blurb { .blurb {
color: #424242; color: #424242;
background-color: #ededed; background-color: #ededed;
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/gplaypattern.png); background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/gplaypattern.png);
padding: 45px 0; padding: 45px 0;
text-align: center; text-align: center;
} }

View File

@@ -13,6 +13,7 @@
"0.13.4", "0.13.4",
"0.14.6", "0.14.6",
"0.15.5", "0.15.5",
"0.16.2" "0.16.4",
"0.17.7"
] ]
} }

View File

@@ -6,6 +6,7 @@
domains:add <app> <domain> [<domain> ...] # Add domains to app domains:add <app> <domain> [<domain> ...] # Add domains to app
domains:add-global <domain> [<domain> ...] # Add global domain names domains:add-global <domain> [<domain> ...] # Add global domain names
domains:clear <app> # Clear all domains for app domains:clear <app> # Clear all domains for app
domains:clear-global # Clear global domain names
domains:disable <app> # Disable VHOST support domains:disable <app> # Disable VHOST support
domains:enable <app> # Enable VHOST support domains:enable <app> # Enable VHOST support
domains:remove <app> <domain> [<domain> ...] # Remove domains from app domains:remove <app> <domain> [<domain> ...] # Remove domains from app
@@ -27,21 +28,10 @@ scheme://subdomain.domain.tld
The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial dokku configuration. It can then be modified with `dokku domains:add-global` and `dokku domains:remove-global`. This value is used as a default TLD for all applications on a host. The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial dokku configuration. It can then be modified with `dokku domains:add-global` and `dokku domains:remove-global`. This value is used as a default TLD for all applications on a host.
If a FQDN such as `other.tld` is used as the application name, the global virtualhost will be ignored and the resulting vhost URL for that application will be `other.tld`. The exception to this rule being that if the FQDN has the same ending as the default vhost (such as `subdomain.domain.tld`), then the entire FQDN will be treated as a subdomain. The application will therefore be deployed at `subdomain.domain.tld.domain.tld`. If an FQDN such as `dokku.org` is used as the application name, the global virtualhost will be ignored and the resulting vhost URL for that application will be `dokku.org`.
You can optionally override this in a plugin by implementing the `nginx-hostname` plugin trigger. For example, you can reverse the subdomain with the following sample `nginx-hostname` plugin trigger: You can optionally override this in a plugin by implementing the `nginx-hostname` plugin trigger. If the `nginx-hostname` plugin has no output, the normal hostname algorithm will be executed. See the [plugin trigger documentation](/docs/development/plugin-triggers.md#nginx-hostname) for more information.
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"; SUBDOMAIN="$2"; VHOST="$3"
NEW_SUBDOMAIN=`echo $SUBDOMAIN | rev`
echo "$NEW_SUBDOMAIN.$VHOST"
```
If the `nginx-hostname` plugin has no output, the normal hostname algorithm will be executed.
## Disabling VHOSTS ## Disabling VHOSTS
@@ -88,17 +78,17 @@ dokku domains:report
``` ```
=====> node-js-app domains information =====> node-js-app domains information
Domains app enabled: true Domains app enabled: true
Domains app vhosts: node-js-sample.dokku.org Domains app vhosts: node-js-app.dokku.org
Domains global enabled: true Domains global enabled: true
Domains global vhosts: dokku.org Domains global vhosts: dokku.org
=====> python-sample domains information =====> python-app domains information
Domains app enabled: true Domains app enabled: true
Domains app vhosts: python-sample.dokku.org Domains app vhosts: python-app.dokku.org
Domains global enabled: true Domains global enabled: true
Domains global vhosts: dokku.org Domains global vhosts: dokku.org
=====> ruby-sample domains information =====> ruby-app domains information
Domains app enabled: true Domains app enabled: true
Domains app vhosts: ruby-sample.dokku.org Domains app vhosts: ruby-app.dokku.org
Domains global enabled: true Domains global enabled: true
Domains global vhosts: dokku.org Domains global vhosts: dokku.org
``` ```

View File

@@ -6,12 +6,13 @@ The `config` plugin provides the following commands to manage your variables:
``` ```
config (<app>|--global) Pretty-print an app or global environment config (<app>|--global) Pretty-print an app or global environment
config:bundle (<app>|--global) [--merged] Bundle environment into tarfile
config:clear (<app>|--global) Clears environment variables
config:export (<app>|--global) [--envfile] Export a global or app environment
config:get (<app>|--global) KEY Display a global or app-specific config value config:get (<app>|--global) KEY Display a global or app-specific config value
config:keys (<app>|--global) [--merged] Show keys set in environment
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...] Unset one or more config vars config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...] Unset one or more config vars
config:export (<app>|--global) [--envfile] Export a global or app environment
config:keys (<app>|--global) [--merged] Show keys set in environment
config:bundle (<app>|--global) [--merged] Bundle environment into tarfile
``` ```
> For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860). > For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860).
@@ -92,7 +93,7 @@ The following list config variables have special meaning and can be set in a var
| `DOKKU_DETACH_CONTAINER` | none | `--detach` flag | Whether to detach a container started via `dokku run`. | | `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_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. | | `DOKKU_RM_CONTAINER` | none | `dokku config:set` <br /> `--rm-container` flag <br /> `--rm` flag | Whether to keep `dokku run` containers around or not. |
| `DOKKU_TRACE` | none | `dokku trace on` <br /> `dokku trace false` <br /> `--trace` flag | Turn on very verbose debugging. | | `DOKKU_TRACE` | none | `dokku trace:on` <br /> `dokku trace:off` <br /> `--trace` flag | Turn on very verbose debugging. |
| `DOKKU_APP_PROXY_TYPE` | `nginx` | `dokku proxy:set` | | | `DOKKU_APP_PROXY_TYPE` | `nginx` | `dokku proxy:set` | |
| `DOKKU_APP_RESTORE` | `1` | `dokku config:set` <br /> `dokku ps:stop` | | | `DOKKU_APP_RESTORE` | `1` | `dokku config:set` <br /> `dokku ps:stop` | |
| `DOKKU_APP_SHELL` | `/bin/bash` | `dokku config:set` | Allows users to change the default shell used by Dokku for `dokku enter` and execution of deployment tasks. | | `DOKKU_APP_SHELL` | `/bin/bash` | `dokku config:set` | Allows users to change the default shell used by Dokku for `dokku enter` and execution of deployment tasks. |
@@ -113,6 +114,7 @@ The following list config variables have special meaning and can be set in a var
| `DOKKU_DOCKERFILE_ENTRYPOINT` | dockerfile entrypoint | `dokku config:set` | | | `DOKKU_DOCKERFILE_ENTRYPOINT` | dockerfile entrypoint | `dokku config:set` | |
| `DOKKU_DOCKERFILE_PORTS` | dockerfile ports | `dokku config:set` | | | `DOKKU_DOCKERFILE_PORTS` | dockerfile ports | `dokku config:set` | |
| `DOKKU_DOCKERFILE_START_CMD` | none | `dokku config:set` | | | `DOKKU_DOCKERFILE_START_CMD` | none | `dokku config:set` | |
| `DOKKU_PARALLEL_ARGUMENTS`. | none | `dokku config:set` | Allows passing custom arguments to parallel for `ps:*all` commands |
| `DOKKU_PROXY_PORT` | automatically assigned | `dokku config:set` | | | `DOKKU_PROXY_PORT` | automatically assigned | `dokku config:set` | |
| `DOKKU_PROXY_SSL_PORT` | automatically assigned | `dokku config:set` | | | `DOKKU_PROXY_SSL_PORT` | automatically assigned | `dokku config:set` | |
| `DOKKU_PROXY_PORT_MAP` | automatically assigned | `dokku proxy:ports-add` <br /> `dokku proxy:ports-remove`, `dokku proxy:ports-clear` | | | `DOKKU_PROXY_PORT_MAP` | automatically assigned | `dokku proxy:ports-add` <br /> `dokku proxy:ports-remove`, `dokku proxy:ports-clear` | |

View File

@@ -67,17 +67,17 @@ dokku certs:report
``` ```
``` ```
=====> node-js-sample =====> node-js-app
Ssl dir: /home/dokku/node-js-sample/tls Ssl dir: /home/dokku/node-js-app/tls
Ssl enabled: true Ssl enabled: true
Ssl hostnames: *.node-js-sample.org node-js-sample.org Ssl hostnames: *.node-js-app.org node-js-app.org
Ssl expires at: Oct 5 23:59:59 2019 GMT Ssl expires at: Oct 5 23:59:59 2019 GMT
Ssl issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA Ssl issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA
Ssl starts at: Oct 5 00:00:00 2016 GMT Ssl starts at: Oct 5 00:00:00 2016 GMT
Ssl subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.node-js-sample.org Ssl subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.node-js-app.org
Ssl verified: self signed. Ssl verified: self signed.
=====> python-sample =====> python-app
Ssl dir: /home/dokku/python-sample/tls Ssl dir: /home/dokku/python-app/tls
Ssl enabled: false Ssl enabled: false
Ssl hostnames: Ssl hostnames:
Ssl expires at: Ssl expires at:
@@ -90,12 +90,12 @@ dokku certs:report
You can run the command for a specific app also. You can run the command for a specific app also.
```shell ```shell
dokku certs:report node-js-sample dokku certs:report node-js-app
``` ```
``` ```
=====> node-js-sample ssl information =====> node-js-app ssl information
Ssl dir: /home/dokku/node-js-sample/tls Ssl dir: /home/dokku/node-js-app/tls
Ssl enabled: true Ssl enabled: true
Ssl hostnames: *.dokku.org dokku.org Ssl hostnames: *.dokku.org dokku.org
Ssl expires at: Oct 5 23:59:59 2019 GMT Ssl expires at: Oct 5 23:59:59 2019 GMT
@@ -108,7 +108,7 @@ dokku certs:report node-js-sample
You can pass flags which will output only the value of the specific information you want. For example: You can pass flags which will output only the value of the specific information you want. For example:
```shell ```shell
dokku certs:report node-js-sample --ssl-enabled dokku certs:report node-js-app --ssl-enabled
``` ```
## HSTS Header ## HSTS Header

View File

@@ -29,6 +29,12 @@ For users that require customization in the `build` phase, you may use build arg
dokku docker-options:add node-js-app build '--build-arg NODE_ENV=production' dokku docker-options:add node-js-app build '--build-arg NODE_ENV=production'
``` ```
The location of the `Dockerfile` may also be specified. If the location is changed, the repository **must also** have a `Dockerfile` in the root directory in order to trigger a dockerfile-based deploy.
```shell
dokku docker-options:add node-js-app build '--file Dockerfile.dokku'
```
Once set, the Dockerfile usage would be as follows: Once set, the Dockerfile usage would be as follows:
```Dockerfile ```Dockerfile

View File

@@ -5,7 +5,7 @@ Sometimes you need to either inspect running containers or run a one-off command
## Run a command in an app environment ## Run a command in an app environment
``` ```
run <app> <cmd> # Run a command in a new container using the current application image run [ --env KEY=VALUE | -e KEY=VALUE ] <app> <cmd> # Run a command in a new container using the current application image
``` ```
The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application. The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application.
@@ -13,6 +13,9 @@ The `run` command can be used to run a one-off process for a specific command. T
```shell ```shell
# runs `ls -lah` in the `/app` directory of the application `node-js-app` # runs `ls -lah` in the `/app` directory of the application `node-js-app`
dokku run node-js-app ls -lah dokku run node-js-app ls -lah
# optionally, run can be passed custom environment variables
dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask
``` ```
The `run` command can also be used to run a command defined in your Procfile: The `run` command can also be used to run a command defined in your Procfile:

View File

@@ -81,13 +81,13 @@ dokku checks:report
``` ```
``` ```
=====> search checks information =====> node-js-app checks information
Checks disabled list: none Checks disabled list: none
Checks skipped list: none Checks skipped list: none
=====> python-sample checks information =====> python-app checks information
Checks disabled list: none Checks disabled list: none
Checks skipped list: none Checks skipped list: none
=====> ruby-sample checks information =====> ruby-app checks information
Checks disabled list: _all_ Checks disabled list: _all_
Checks skipped list: none Checks skipped list: none
``` ```
@@ -95,11 +95,11 @@ dokku checks:report
You can run the command for a specific app also. You can run the command for a specific app also.
```shell ```shell
dokku checks:report node-js-sample dokku checks:report node-js-app
``` ```
``` ```
=====> node-js-sample checks information =====> node-js-app checks information
Checks disabled list: none Checks disabled list: none
Checks skipped list: none Checks skipped list: none
``` ```
@@ -107,7 +107,7 @@ dokku checks:report node-js-sample
You can pass flags which will output only the value of the specific information you want. For example: You can pass flags which will output only the value of the specific information you want. For example:
```shell ```shell
dokku checks:report node-js-sample --checks-disabled-list dokku checks:report node-js-app --checks-disabled-list
``` ```
## Customizing checks ## Customizing checks

View File

@@ -311,6 +311,24 @@ verify_app_name "$APP"
# TODO # TODO
``` ```
### `docker-args-process-build`
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options.
- Invoked by: `dokku ps:rebuild`
- Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
# TODO
```
### `docker-args-process-deploy` ### `docker-args-process-deploy`
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options. - Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options.
@@ -333,7 +351,7 @@ verify_app_name "$APP"
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker run options. - Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker run options.
- Invoked by: `dokku run` - Invoked by: `dokku run`
- Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE [$PROC_TYPE $CONTAINER_INDEX]` - Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE`
- Example: - Example:
```shell ```shell

View File

@@ -29,7 +29,7 @@ The workflow looks like this:
```shell ```shell
# having dokku-arch in ../dokku-arch # having dokku-arch in ../dokku-arch
vagrant up build-arch vagrant up build-arch
# wait for "==> build-arch: ==> Finished making: dokku 0.16.2-2 (Mon Feb 22 23:20:37 CET 2016)" # wait for "==> build-arch: ==> Finished making: dokku 0.17.7-2 (Mon Feb 22 23:20:37 CET 2016)"
cd ../dokku-arch cd ../dokku-arch
git add PKGBUILD .SRCINFO git add PKGBUILD .SRCINFO
git commit -m 'Update to dokku 0.9.9' git commit -m 'Update to dokku 0.9.9'

View File

@@ -32,6 +32,9 @@ While we do provide official packages for a variety of platforms, as our test su
# run linter & update vagrant Dokku install from local git clone # run linter & update vagrant Dokku install from local git clone
make lint copyfiles make lint copyfiles
# build a specific plugin
make go-build-plugin copyplugin PLUGIN_NAME=apps
# execute all bats tests # execute all bats tests
make unit-tests make unit-tests

View File

@@ -46,7 +46,7 @@ sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make
## Skipping Herokuish installation ## Skipping Herokuish installation
The Herokuish package is recommended but not required if not using Heroku buildpacks for deployment. Debian-based OS users can run the bootstrap installer via `sudo DOKKU_NO_INSTALL_RECOMMENDS=true bash bootstrap.sh` to skip the dependency. Please note that this will _also_ skip installation of other recommended dependencies. The Herokuish package is recommended but not required if not using Heroku buildpacks for deployment. Debian-based OS users can run the bootstrap installer via `sudo DOKKU_NO_INSTALL_RECOMMENDS=" --no-install-recommends " bash bootstrap.sh` to skip the dependency. Please note that this will _also_ skip installation of other recommended dependencies.
## Configuring an unattended installation ## Configuring an unattended installation

View File

@@ -21,8 +21,8 @@ To install the latest stable version of Dokku, you can run the following shell c
```shell ```shell
# for debian systems, installs Dokku via apt-get # for debian systems, installs Dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.2/bootstrap.sh; wget https://raw.githubusercontent.com/dokku/dokku/v0.17.7/bootstrap.sh;
sudo DOKKU_TAG=v0.16.2 bash bootstrap.sh sudo DOKKU_TAG=v0.17.7 bash bootstrap.sh
``` ```
The installation process takes about 5-10 minutes, depending upon internet connection speed. The installation process takes about 5-10 minutes, depending upon internet connection speed.

View File

@@ -1,5 +1,38 @@
# Troubleshooting # Troubleshooting
> New as of 0.17.0
```
trace:on # Enables trace mode
trace:off # Disables trace mode
```
## Trace Mode
By default, Dokku will constrain the amount of output displayed for any given command run. The verbosity of output can be increased by enabling trace mode. Trace mode will turn on the `set -x` flag for bash plugins, while other plugins are free to respect the environment variable `DOKKU_TRACE` and log differently as approprate. Trace mode can be useful to see _where_ plugins are running commands that would otherwise be unexpected.
To enable trace mode, run `trace:on`
```shell
dokku trace:on
```
```
-----> Enabling trace mode
```
Trace mode can be disabled with `trace:off`
```shell
dokku trace:off
```
```
-----> Disabling trace mode
```
## Common Problems
__Symptom:__ I deployed my app but I am getting the default nginx page. __Symptom:__ I deployed my app but I am getting the default nginx page.
__Solution:__ __Solution:__
@@ -41,22 +74,7 @@ __Symptom:__ I want to deploy my app, but while pushing I get the following erro
__Solution:__ __Solution:__
The `remote rejected` error does not give enough information. Anything could have failed. The `remote rejected` error does not give enough information. Anything could have failed. Enable trace mode and begin debugging. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue.
To enable Dokku tracing, simply run the following command:
```shell
# since 0.3.9
dokku trace on
```
In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following:
```shell
export DOKKU_TRACE=1
```
This will trace all of Dokku's activity. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue.
*** ***

View File

@@ -10,30 +10,30 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <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> <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.16.2/docs/assets/favicons/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.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.17.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/manifest.json"> <link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon.ico"> <link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku"> <meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku"> <meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/mstile-144x144.png"> <meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/browserconfig.xml"> <meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/style.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> --> <!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<style> <style>
.sponsors { .sponsors {
@@ -127,12 +127,12 @@
<p class="line"> <p class="line">
<span class="path"></span> <span class="path"></span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.16.2/bootstrap.sh</span> <span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.17.7/bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="path"></span> <span class="path"></span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.16.2 bash bootstrap.sh</span> <span class="command">sudo DOKKU_TAG=v0.17.7 bash bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span> <span class="output">&nbsp;# go to your server's IP and follow the web installer</span>

View File

@@ -3,17 +3,19 @@
> New as of 0.5.0, Enhanced in 0.6.0 > New as of 0.5.0, Enhanced in 0.6.0
``` ```
proxy:ports <app> # List proxy port mappings for app proxy:ports <app> # List proxy port mappings for an app
proxy:ports-set <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Set proxy port mappings for app proxy:ports-add <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Add proxy port mappings to an app
proxy:ports-add <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Add proxy port mappings for app proxy:ports-clear <app> # Clear all proxy port mappings for an app
proxy:ports-clear <app> # Clear all proxy port mappings for app proxy:ports-remove <app> <host-port> [<host-port>|<scheme>:<host-port>:<container-port>...] # Remove specific proxy port mappings from an app
proxy:ports-remove <app> <host-port> [<host-port>|<scheme>:<host-port>:<container-port>...] # Unset proxy port mappings for app proxy:ports-set <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Set proxy port mappings for an app
``` ```
In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx. In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx.
## Usage ## Usage
> Warning: Mapping alternative ports may conflict with the active firewall installed on your server or hosting provider. Such software includes - but is not limited to - AWS Security Groups, iptables, and UFW. Please consult the documentation for those softwares as applicable.
### Proxy port mapping ### Proxy port mapping
> New as of 0.6.0 > New as of 0.6.0

View File

@@ -9,26 +9,26 @@
<meta name="author" content=""> <meta name="author" content="">
<title>Dokku - The smallest PaaS implementation you've ever seen</title> <title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.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.17.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/manifest.json"> <link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/favicon.ico"> <link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku"> <meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku"> <meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/mstile-144x144.png"> <meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/favicons/browserconfig.xml"> <meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
<script> <script>
@@ -42,7 +42,7 @@
</script> </script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.16.2/docs/assets/style.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.7/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> --> <!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<style> <style>

5
dokku
View File

@@ -2,6 +2,7 @@
set -eo pipefail set -eo pipefail
shopt -s nullglob shopt -s nullglob
export DOCKER_BIN=docker
if [[ -r /etc/default/dokku ]]; then if [[ -r /etc/default/dokku ]]; then
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source /etc/default/dokku source /etc/default/dokku
@@ -36,6 +37,10 @@ DOKKU_DISTRO=$(
echo "$ID" echo "$ID"
) )
# Specify twice so that only host-level
# configuration can ever override the DOCKER_BIN value
export DOCKER_BIN=${DOCKER_BIN:="docker"}
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish:latest"} export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish:latest"}
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"} export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}

View File

@@ -9,7 +9,7 @@ case "$1" in
help_content_func() { help_content_func() {
declare desc="return standard plugin help content" declare desc="return standard plugin help content"
cat <<help_content cat <<help_content
run <app> <cmd>, Run a command in a new container using the current application image run [--env KEY=VALUE] <app> <cmd>, Run a command in a new container using the current application image
trace [on/off], Enable dokku tracing trace [on/off], Enable dokku tracing
url <app>, Show the first URL for an application (compatibility) url <app>, Show the first URL for an application (compatibility)
urls <app>, Show all URLs for an application urls <app>, Show all URLs for an application

View File

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

View File

@@ -12,12 +12,12 @@ dokku_report_cmd() {
dokku_log_info1 "memory: " dokku_log_info1 "memory: "
free -m | sed "s/^/ /" free -m | sed "s/^/ /"
dokku_log_info1 "docker version: " dokku_log_info1 "docker version: "
docker version | sed "s/^/ /" "$DOCKER_BIN" version | sed "s/^/ /"
dokku_log_info1 "docker daemon info: " dokku_log_info1 "docker daemon info: "
docker -D info | sed "s/^/ /" "$DOCKER_BIN" -D info | sed "s/^/ /"
dokku_log_info1 "sigil version: $(sigil -v)" dokku_log_info1 "sigil version: $(sigil -v)"
dokku_log_info1 "herokuish version: " dokku_log_info1 "herokuish version: "
docker run --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /" "$DOCKER_BIN" run --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
dokku_log_info1 "dokku version: $(dokku version)" dokku_log_info1 "dokku version: $(dokku version)"
dokku_log_info1 "dokku plugins: " dokku_log_info1 "dokku plugins: "
dokku plugin:list | sed "s/^/ /" dokku plugin:list | sed "s/^/ /"

View File

@@ -6,12 +6,38 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
dokku_run_cmd() { dokku_run_cmd() {
declare desc="runs command in container based on app image" declare desc="runs command in container based on app image"
declare cmd="run" APP="$2" declare cmd="run" APP=""
shift
declare -a RUN_ENV
RUN_ENV=()
while [[ $# -gt 0 ]]; do
case $1 in
-e=* | --env=*)
local arg=$(printf "%s" "$1" | sed -E 's/(^-e=)|(^--env=)//g')
RUN_ENV+=("$arg")
shift
;;
-e | --env)
if [[ ! $2 ]]; then
dokku_log_warn "expected $1 to have an argument"
break
fi
RUN_ENV+=("$2")
shift 2
;;
*)
APP="$1"
shift
break
;;
esac
done
verify_app_name "$APP" verify_app_name "$APP"
shift 2
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP") local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "$@" plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "${#RUN_ENV[@]}" "${RUN_ENV[@]}" "$@"
} }
dokku_run_cmd "$@" dokku_run_cmd "$@"

View File

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

View File

@@ -8,9 +8,9 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
get_phase_script() { get_phase_script() {
declare desc="extracts app.json from app image and returns the appropriate json key/value" declare desc="extracts app.json from app image and returns the appropriate json key/value"
declare IMAGE_TAG="$1" PHASE_SCRIPT_KEY="$2" declare IMAGE_TAG="$1" PHASE_SCRIPT_KEY="$2"
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_get_phase_script.XXXX") local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json" local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
trap 'rm -rf "$GET_PHASE_SCRIPT_TMP_WORK_DIR" >/dev/null' RETURN INT TERM trap "rm -rf '$GET_PHASE_SCRIPT_TMP_WORK_DIR' >/dev/null" RETURN INT TERM
copy_from_image "$IMAGE" "app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true copy_from_image "$IMAGE" "app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true
@@ -26,7 +26,7 @@ get_release_cmd() {
declare APP="$1" IMAGE_TAG="$2" declare APP="$1" IMAGE_TAG="$2"
extract_procfile "$APP" "$IMAGE_TAG" >/dev/null extract_procfile "$APP" "$IMAGE_TAG" >/dev/null
trap 'remove_procfile $APP' RETURN INT TERM EXIT trap "remove_procfile $APP" RETURN INT TERM EXIT
get_cmd_from_procfile "$APP" "release" "5000" get_cmd_from_procfile "$APP" "release" "5000"
} }
@@ -85,7 +85,7 @@ execute_script() {
local IMAGE_SOURCE_TYPE="dockerfile" local IMAGE_SOURCE_TYPE="dockerfile"
is_image_herokuish_based "$IMAGE" && IMAGE_SOURCE_TYPE="herokuish" is_image_herokuish_based "$IMAGE" && IMAGE_SOURCE_TYPE="herokuish"
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE" "$PHASE_SCRIPT_KEY") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
# eval args as array to respect escapes # eval args as array to respect escapes
declare -a ARG_ARRAY declare -a ARG_ARRAY
@@ -96,8 +96,8 @@ execute_script() {
DOKKU_APP_SHELL="$(config_get "$APP" DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")" DOKKU_APP_SHELL="$(config_get "$APP" DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")"
[[ -z "$DOKKU_APP_SHELL" ]] && DOKKU_APP_SHELL="/bin/bash" [[ -z "$DOKKU_APP_SHELL" ]] && DOKKU_APP_SHELL="/bin/bash"
id=$(docker run "$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") id=$("$DOCKER_BIN" run "$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 wait "$id")" -ne 0; then if test "$("$DOCKER_BIN" wait "$id")" -ne 0; then
dokku_container_log_verbose_quiet "$id" dokku_container_log_verbose_quiet "$id"
dokku_log_fail "execution of '$SCRIPT_CMD' failed!" dokku_log_fail "execution of '$SCRIPT_CMD' failed!"
fi fi
@@ -120,5 +120,5 @@ execute_script() {
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
eval docker commit $DOCKER_COMMIT_ARGS "$id" "$IMAGE" >/dev/null eval "$DOCKER_BIN" commit $DOCKER_COMMIT_ARGS "$id" "$IMAGE" >/dev/null
} }

View File

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

View File

@@ -40,6 +40,7 @@ apps_destroy() {
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP") local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
local REMOVE_CONTAINERS="true" local REMOVE_CONTAINERS="true"
plugn trigger scheduler-stop "$DOKKU_SCHEDULER" "$APP" "$REMOVE_CONTAINERS" plugn trigger scheduler-stop "$DOKKU_SCHEDULER" "$APP" "$REMOVE_CONTAINERS"
plugn trigger scheduler-post-delete "$DOKKU_SCHEDULER" "$APP" "$IMAGE_TAG"
plugn trigger post-delete "$APP" "$IMAGE_TAG" plugn trigger post-delete "$APP" "$IMAGE_TAG"
} }

View File

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

View File

@@ -16,7 +16,7 @@ app_post_delete() {
fi fi
# shellcheck disable=SC2046 # shellcheck disable=SC2046
docker rmi $(docker images -q "$IMAGE_REPO" | xargs) &>/dev/null || true "$DOCKER_BIN" rmi $("$DOCKER_BIN" images -q "$IMAGE_REPO" | xargs) &>/dev/null || true
} }
app_post_delete "$@" app_post_delete "$@"

View File

@@ -18,7 +18,7 @@ apps_pre_delete() {
fi fi
if [[ -d $CACHE_DIR ]]; then if [[ -d $CACHE_DIR ]]; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_HOST_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_HOST_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
fi fi
} }

View File

@@ -44,7 +44,7 @@ apps_clone_cmd() {
plugn trigger post-app-clone-setup "$OLD_APP" "$NEW_APP" plugn trigger post-app-clone-setup "$OLD_APP" "$NEW_APP"
if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi fi
rm -rf "$NEW_CACHE_DIR" rm -rf "$NEW_CACHE_DIR"

View File

@@ -16,7 +16,7 @@ apps_rename_cmd() {
local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache" local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache"
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" >/dev/null 2>&1; then if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" >/dev/null 2>&1; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi fi
rm -rf "$OLD_CACHE_DIR" rm -rf "$OLD_CACHE_DIR"
apps_create "$NEW_APP" apps_create "$NEW_APP"

View File

@@ -1,4 +1,4 @@
[plugin] [plugin]
description = "dokku core build-env plugin" description = "dokku core build-env plugin"
version = "0.16.2" version = "0.17.7"
[plugin.config] [plugin.config]

View File

@@ -19,14 +19,14 @@ build_env_pre_build_buildpack() {
dokku_log_info1 "Adding BUILD_ENV to build environment..." dokku_log_info1 "Adding BUILD_ENV to build environment..."
# create build env files for use in buildpacks like this: # create build env files for use in buildpacks like this:
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34 # https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
id=$(config_bundle --merged "$APP" | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env") id=$(config_bundle --merged "$APP" | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env")
test "$(docker wait "$id")" -eq 0 test "$("$DOCKER_BIN" wait "$id")" -eq 0
docker commit "$id" "$IMAGE" >/dev/null "$DOCKER_BIN" commit "$id" "$IMAGE" >/dev/null
# create build env for 'old style' buildpacks and dokku plugins # create build env for 'old style' buildpacks and dokku plugins
id=$(config_export app "$APP" --format envfile --merged | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env") id=$(config_export app "$APP" --format envfile --merged | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env")
test "$(docker wait "$id")" -eq 0 test "$("$DOCKER_BIN" wait "$id")" -eq 0
docker commit "$id" "$IMAGE" >/dev/null "$DOCKER_BIN" commit "$id" "$IMAGE" >/dev/null
} }
build_env_pre_build_buildpack "$@" build_env_pre_build_buildpack "$@"

View File

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

View File

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

View File

@@ -42,9 +42,9 @@ certs_set() {
# importing from file # importing from file
true true
elif is_tar_import; then elif is_tar_import; then
local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_certs_set.XXXX") local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
pushd "$CERTS_SET_TMP_WORK_DIR" &>/dev/null pushd "$CERTS_SET_TMP_WORK_DIR" &>/dev/null
trap 'popd &>/dev/null || true; rm -rf $CERTS_SET_TMP_WORK_DIR >/dev/null' RETURN trap "popd &>/dev/null || true; rm -rf '$CERTS_SET_TMP_WORK_DIR' >/dev/null" RETURN
tar xvf - <&0 tar xvf - <&0
local CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f | grep ".crt$") local CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f | grep ".crt$")

View File

@@ -13,9 +13,9 @@ certs_generate_cmd() {
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls" local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
if [[ ! -f "$APP_SSL_PATH/server.key" ]] && [[ ! -f "$APP_SSL_PATH/server.crt" ]]; then if [[ ! -f "$APP_SSL_PATH/server.key" ]] && [[ ! -f "$APP_SSL_PATH/server.crt" ]]; then
local CERTS_GENERATE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_certs.XXXXXXXXX") local CERTS_GENERATE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
pushd "$CERTS_GENERATE_TMP_WORK_DIR" >/dev/null pushd "$CERTS_GENERATE_TMP_WORK_DIR" >/dev/null
trap 'popd &>/dev/null || true; rm -rf "$CERTS_GENERATE_TMP_WORK_DIR" >/dev/null' INT TERM EXIT trap "popd &>/dev/null || true; rm -rf '$CERTS_GENERATE_TMP_WORK_DIR' >/dev/null" INT TERM EXIT
openssl genrsa -out server.key 2048 openssl genrsa -out server.key 2048
openssl req -new -key server.key -out server.csr openssl req -new -key server.key -out server.csr

View File

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

View File

@@ -136,7 +136,7 @@ func DirectoryExists(filePath string) bool {
// DockerInspect runs an inspect command with a given format against a container id // DockerInspect runs an inspect command with a given format against a container id
func DockerInspect(containerID, format string) (output string, err error) { func DockerInspect(containerID, format string) (output string, err error) {
b, err := sh.Command("docker", "inspect", "--format", format, containerID).Output() b, err := sh.Command(DockerBin(), "inspect", "--format", format, containerID).Output()
if err != nil { if err != nil {
return "", err return "", err
} }
@@ -253,7 +253,7 @@ func IsImageHerokuishBased(image string) bool {
} }
dockerGlobalArgs := os.Getenv("DOKKU_GLOBAL_RUN_ARGS") dockerGlobalArgs := os.Getenv("DOKKU_GLOBAL_RUN_ARGS")
parts := []string{"docker", "run", dockerGlobalArgs, "--entrypoint=\"/bin/sh\"", dockerArgs, image, "-c", "\"test -f /exec\""} parts := []string{DockerBin(), "run", dockerGlobalArgs, "--entrypoint=\"/bin/sh\"", dockerArgs, image, "-c", "\"test -f /exec\""}
var dockerCmdParts []string var dockerCmdParts []string
for _, str := range parts { for _, str := range parts {
@@ -339,11 +339,21 @@ func VerifyAppName(appName string) (err error) {
// VerifyImage returns true if docker image exists in local repo // VerifyImage returns true if docker image exists in local repo
func VerifyImage(image string) bool { func VerifyImage(image string) bool {
imageCmd := NewShellCmd(strings.Join([]string{"docker inspect", image}, " ")) imageCmd := NewShellCmd(strings.Join([]string{DockerBin(), "inspect", image}, " "))
imageCmd.ShowOutput = false imageCmd.ShowOutput = false
return imageCmd.Execute() return imageCmd.Execute()
} }
// DockerBin returns a string which contains a path to the current docker binary
func DockerBin() string {
dockerBin := os.Getenv("DOCKER_BIN")
if dockerBin == "" {
dockerBin = "docker"
}
return dockerBin
}
//PlugnTrigger fire the given plugn trigger with the given args //PlugnTrigger fire the given plugn trigger with the given args
func PlugnTrigger(triggerName string, args ...string) error { func PlugnTrigger(triggerName string, args ...string) error {
shellArgs := make([]interface{}, len(args)+2) shellArgs := make([]interface{}, len(args)+2)

View File

@@ -171,7 +171,7 @@ dokku_container_log_verbose_quiet() {
OIFS=$IFS OIFS=$IFS
IFS=$'\n' IFS=$'\n'
local line local line
for line in $(docker logs "$CID" 2>&1); do for line in $("$DOCKER_BIN" logs "$CID" 2>&1); do
dokku_log_verbose_quiet "$line" dokku_log_verbose_quiet "$line"
done done
IFS=$OIFS IFS=$OIFS
@@ -203,7 +203,7 @@ verify_app_name() {
verify_image() { verify_image() {
declare desc="verify image existence" declare desc="verify image existence"
local IMAGE="$1" local IMAGE="$1"
if (docker inspect "$IMAGE" &>/dev/null); then if "$DOCKER_BIN" inspect "$IMAGE" &>/dev/null; then
return 0 return 0
else else
return 1 return 1
@@ -282,7 +282,7 @@ get_running_image_tag() {
verify_app_name "$APP" verify_app_name "$APP"
local CIDS=($(get_app_container_ids "$APP")) local CIDS=($(get_app_container_ids "$APP"))
local RUNNING_IMAGE_TAG=$(docker inspect -f '{{ .Config.Image }}' "${CIDS[0]}" 2>/dev/null | awk -F: '{ print $2 }' || echo '') local RUNNING_IMAGE_TAG=$("$DOCKER_BIN" inspect -f '{{ .Config.Image }}' "${CIDS[0]}" 2>/dev/null | awk -F: '{ print $2 }' || echo '')
echo "$RUNNING_IMAGE_TAG" echo "$RUNNING_IMAGE_TAG"
} }
@@ -291,14 +291,18 @@ is_image_herokuish_based() {
declare IMAGE="$1" declare IMAGE="$1"
local USER_VALUE local USER_VALUE
if [[ -z "$IMAGE" ]]; then
return 1
fi
# due to how the build process works, all herokuish images have the Environment variable USER=herokuishuser # due to how the build process works, all herokuish images have the Environment variable USER=herokuishuser
USER_VALUE="$(docker inspect -f '{{range .Config.Env}}{{if eq . "USER=herokuishuser" }}{{println .}}{{end}}{{end}}' "$IMAGE")" USER_VALUE="$("$DOCKER_BIN" inspect -f '{{range .Config.Env}}{{if eq . "USER=herokuishuser" }}{{println .}}{{end}}{{end}}' "$IMAGE")"
[[ "$USER_VALUE" == "" ]] && return 1 [[ "$USER_VALUE" == "" ]] && return 1
return 0 return 0
} }
get_docker_version() { get_docker_version() {
CLIENT_VERSION_STRING="$(docker version -f="{{ .Client.Version }}")" CLIENT_VERSION_STRING="$("$DOCKER_BIN" version -f="{{ .Client.Version }}")"
echo "$CLIENT_VERSION_STRING" echo "$CLIENT_VERSION_STRING"
} }
@@ -372,16 +376,19 @@ copy_from_image() {
if is_image_herokuish_based "$IMAGE"; then if is_image_herokuish_based "$IMAGE"; then
WORKDIR="/app" WORKDIR="/app"
else else
WORKDIR="$(docker inspect -f '{{.Config.WorkingDir}}' "$IMAGE")" WORKDIR="$("$DOCKER_BIN" inspect -f '{{.Config.WorkingDir}}' "$IMAGE")"
fi fi
if [[ -n "$WORKDIR" ]]; then if [[ -n "$WORKDIR" ]]; then
SRC_FILE="${WORKDIR}/${SRC_FILE}" SRC_FILE="${WORKDIR}/${SRC_FILE}"
fi fi
fi fi
local CID=$(docker create "$DOKKU_GLOBAL_RUN_ARGS" "$IMAGE") local CID=$("$DOCKER_BIN" create "$DOKKU_GLOBAL_RUN_ARGS" "$IMAGE")
docker cp "$CID:$SRC_FILE" "$DST_DIR" if ! "$DOCKER_BIN" cp "$CID:$SRC_FILE" "$DST_DIR"; then
docker rm -f "$CID" &>/dev/null "$DOCKER_BIN" rm -f "$CID" &>/dev/null
return 1
fi
"$DOCKER_BIN" rm -f "$CID" &>/dev/null
else else
return 1 return 1
fi fi
@@ -463,7 +470,7 @@ is_container_running() {
local CONTAINER_STATUS local CONTAINER_STATUS
dokku_log_warn "Deprecated: common#is_container_status" dokku_log_warn "Deprecated: common#is_container_status"
CONTAINER_STATUS=$(docker inspect -f '{{.State.Running}}' "$CID" || true) CONTAINER_STATUS=$("$DOCKER_BIN" inspect -f '{{.State.Running}}' "$CID" || true)
if [[ "$CONTAINER_STATUS" == "true" ]]; then if [[ "$CONTAINER_STATUS" == "true" ]]; then
return 0 return 0
@@ -476,7 +483,7 @@ is_container_status() {
declare desc="return 0 if given docker container id is in given state" declare desc="return 0 if given docker container id is in given state"
local CID=$1 local CID=$1
local TEMPLATE="{{.State.$2}}" local TEMPLATE="{{.State.$2}}"
local CONTAINER_STATUS=$(docker inspect -f "$TEMPLATE" "$CID" 2>/dev/null || true) local CONTAINER_STATUS=$("$DOCKER_BIN" inspect -f "$TEMPLATE" "$CID" 2>/dev/null || true)
if [[ "$CONTAINER_STATUS" == "true" ]]; then if [[ "$CONTAINER_STATUS" == "true" ]]; then
return 0 return 0
@@ -522,24 +529,24 @@ dokku_build() {
case "$IMAGE_SOURCE_TYPE" in case "$IMAGE_SOURCE_TYPE" in
herokuish) herokuish)
DOKKU_IMAGE="$(config_get "$APP" DOKKU_IMAGE || echo "$DOKKU_IMAGE")" DOKKU_IMAGE="$(config_get "$APP" DOKKU_IMAGE || echo "$DOKKU_IMAGE")"
cid=$(tar -c . | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$DOKKU_IMAGE" /bin/bash -c "mkdir -p /app && tar -xC /app") cid=$(tar -c . | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$DOKKU_IMAGE" /bin/bash -c "mkdir -p /app && tar -xC /app")
test "$(docker wait "$cid")" -eq 0 test "$("$DOCKER_BIN" wait "$cid")" -eq 0
docker commit "$cid" "$IMAGE" >/dev/null "$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
[[ -d $DOKKU_APP_CACHE_DIR ]] || mkdir -p "$DOKKU_APP_CACHE_DIR" [[ -d $DOKKU_APP_CACHE_DIR ]] || mkdir -p "$DOKKU_APP_CACHE_DIR"
plugn trigger pre-build-buildpack "$APP" plugn trigger pre-build-buildpack "$APP"
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE") local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true " [[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
local IMAGE_SOURCE_TYPE="herokuish" local IMAGE_SOURCE_TYPE="herokuish"
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-run "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE" "$PHASE_SCRIPT_KEY") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
declare -a ARG_ARRAY declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)" eval "ARG_ARRAY=($DOCKER_ARGS)"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
cid=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build) cid=$("$DOCKER_BIN" run $DOKKU_GLOBAL_RUN_ARGS -d -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
docker attach "$cid" "$DOCKER_BIN" attach "$cid"
test "$(docker wait "$cid")" -eq 0 test "$("$DOCKER_BIN" wait "$cid")" -eq 0
docker commit "$cid" "$IMAGE" >/dev/null "$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
plugn trigger post-build-buildpack "$APP" plugn trigger post-build-buildpack "$APP"
;; ;;
@@ -559,7 +566,7 @@ dokku_build() {
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache" [[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE") local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
local IMAGE_SOURCE_TYPE="dockerfile" local IMAGE_SOURCE_TYPE="dockerfile"
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-run "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE" "$PHASE_SCRIPT_KEY") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
# strip --volume and -v args from DOCKER_ARGS # strip --volume and -v args from DOCKER_ARGS
local DOCKER_ARGS=$(sed -e "s/--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS") local DOCKER_ARGS=$(sed -e "s/--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
@@ -567,7 +574,7 @@ dokku_build() {
eval "ARG_ARRAY=($DOCKER_ARGS)" eval "ARG_ARRAY=($DOCKER_ARGS)"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker build "${ARG_ARRAY[@]}" $DOKKU_DOCKER_BUILD_OPTS -t $IMAGE . "$DOCKER_BIN" build "${ARG_ARRAY[@]}" $DOKKU_DOCKER_BUILD_OPTS -t $IMAGE .
plugn trigger post-build-dockerfile "$APP" plugn trigger post-build-dockerfile "$APP"
;; ;;
@@ -593,14 +600,14 @@ dokku_release() {
herokuish) herokuish)
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG" plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then if [[ -n $(config_export global) ]]; then
cid=$(config_export global | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh") cid=$(config_export global | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
test "$(docker wait "$cid")" -eq 0 test "$("$DOCKER_BIN" wait "$cid")" -eq 0
docker commit "$cid" "$IMAGE" >/dev/null "$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
fi fi
if [[ -n $(config_export app "$APP") ]]; then if [[ -n $(config_export app "$APP") ]]; then
cid=$(config_export app "$APP" | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh") cid=$(config_export app "$APP" | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
test "$(docker wait "$cid")" -eq 0 test "$("$DOCKER_BIN" wait "$cid")" -eq 0
docker commit "$cid" "$IMAGE" >/dev/null "$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
fi fi
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG" plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
;; ;;
@@ -706,15 +713,15 @@ docker_cleanup() {
# delete all non-running containers # delete all non-running containers
# shellcheck disable=SC2046 # shellcheck disable=SC2046
docker rm $(docker ps -a -f "status=exited" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true "$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=exited" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
# delete all dead containers # delete all dead containers
# shellcheck disable=SC2046 # shellcheck disable=SC2046
docker rm $(docker ps -a -f "status=dead" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true "$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=dead" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
# delete unused images # delete unused images
# shellcheck disable=SC2046 # shellcheck disable=SC2046
docker rmi $(docker images -f 'dangling=true' -q) &>/dev/null & "$DOCKER_BIN" rmi $("$DOCKER_BIN" images -f 'dangling=true' -q) &>/dev/null &
} }
get_available_port() { get_available_port() {
@@ -790,7 +797,7 @@ get_exposed_ports_from_image() {
local IMAGE="$1" local IMAGE="$1"
verify_image "$IMAGE" verify_image "$IMAGE"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
local DOCKER_IMAGE_EXPOSED_PORTS="$(docker inspect -f '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE")" local DOCKER_IMAGE_EXPOSED_PORTS="$("$DOCKER_BIN" inspect -f '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE")"
echo "$DOCKER_IMAGE_EXPOSED_PORTS" echo "$DOCKER_IMAGE_EXPOSED_PORTS"
} }
@@ -798,7 +805,7 @@ get_entrypoint_from_image() {
declare desc="return .Config.Entrypoint from passed image name" declare desc="return .Config.Entrypoint from passed image name"
local IMAGE="$1" local IMAGE="$1"
verify_image "$IMAGE" verify_image "$IMAGE"
local DOCKER_IMAGE_ENTRYPOINT="$(docker inspect --format '{{range .Config.Entrypoint}}{{.}} {{end}}' "$IMAGE")" local DOCKER_IMAGE_ENTRYPOINT="$("$DOCKER_BIN" inspect --format '{{range .Config.Entrypoint}}{{.}} {{end}}' "$IMAGE")"
echo "ENTRYPOINT $DOCKER_IMAGE_ENTRYPOINT" echo "ENTRYPOINT $DOCKER_IMAGE_ENTRYPOINT"
} }
@@ -806,7 +813,7 @@ get_cmd_from_image() {
declare desc="return .Config.Cmd from passed image name" declare desc="return .Config.Cmd from passed image name"
local IMAGE="$1" local IMAGE="$1"
verify_image "$IMAGE" verify_image "$IMAGE"
local DOCKER_IMAGE_CMD="$(docker inspect --format '{{range .Config.Cmd}}{{.}} {{end}}' "$IMAGE")" local DOCKER_IMAGE_CMD="$("$DOCKER_BIN" inspect --format '{{range .Config.Cmd}}{{.}} {{end}}' "$IMAGE")"
DOCKER_IMAGE_CMD="${DOCKER_IMAGE_CMD/\/bin\/sh -c/}" DOCKER_IMAGE_CMD="${DOCKER_IMAGE_CMD/\/bin\/sh -c/}"
echo "CMD $DOCKER_IMAGE_CMD" echo "CMD $DOCKER_IMAGE_CMD"
} }
@@ -844,7 +851,7 @@ get_container_ports() {
local cid local cid
for cid in $APP_CIDS; do for cid in $APP_CIDS; do
local container_ports="$(docker port "$cid" | awk '{ print $3 "->" $1}' | awk -F ":" '{ print $2 }')" local container_ports="$("$DOCKER_BIN" port "$cid" | awk '{ print $3 "->" $1}' | awk -F ":" '{ print $2 }')"
done done
echo "$container_ports" echo "$container_ports"
@@ -1072,8 +1079,8 @@ release_advisory_lock() {
suppress_output() { suppress_output() {
declare desc="suppress all output from a given command unless there is an error" declare desc="suppress all output from a given command unless there is an error"
local TMP_COMMAND_OUTPUT local TMP_COMMAND_OUTPUT
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX") TMP_COMMAND_OUTPUT=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
trap 'rm -rf "$TMP_COMMAND_OUTPUT" >/dev/null' RETURN INT TERM EXIT trap "rm -rf '$TMP_COMMAND_OUTPUT' >/dev/null" RETURN
"$@" >"$TMP_COMMAND_OUTPUT" 2>&1 || { "$@" >"$TMP_COMMAND_OUTPUT" 2>&1 || {
local exit_code="$?" local exit_code="$?"

View File

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

View File

@@ -92,6 +92,29 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) {
return return
} }
//UnsetAll removes all config keys
func UnsetAll(appName string, restart bool) (err error) {
global := appName == ""
env, err := loadAppOrGlobalEnv(appName)
if err != nil {
return
}
var changed = false
for k := range env.Map() {
common.LogInfo1Quiet(fmt.Sprintf("Unsetting %s", k))
env.Unset(k)
changed = true
}
if changed {
env.Write()
triggerUpdate(appName, "clear", []string{})
}
if !global && restart && env.GetBoolDefault("DOKKU_APP_RESTORE", true) {
triggerRestart(appName)
}
return
}
func triggerRestart(appName string) { func triggerRestart(appName string) {
common.LogInfo1(fmt.Sprintf("Restarting app %s", appName)) common.LogInfo1(fmt.Sprintf("Restarting app %s", appName))
if err := common.PlugnTrigger("app-restart", appName); err != nil { if err := common.PlugnTrigger("app-restart", appName); err != nil {

View File

@@ -80,6 +80,22 @@ func TestConfigSetMany(t *testing.T) {
Expect(SetMany(testAppName+"does_not_exist", vals, false)).ToNot(Succeed()) Expect(SetMany(testAppName+"does_not_exist", vals, false)).ToNot(Succeed())
} }
func TestConfigUnsetAll(t *testing.T) {
RegisterTestingT(t)
Expect(setupTestApp()).To(Succeed())
defer teardownTestApp()
expectValue(testAppName, "testKey", "TESTING")
expectValue("", "testKey", "GLOBAL_TESTING")
Expect(UnsetAll(testAppName, false)).To(Succeed())
expectNoValue(testAppName, "testKey")
expectNoValue(testAppName, "noKey")
expectNoValue(testAppName, "globalKey")
Expect(UnsetAll(testAppName+"does-not-exist", false)).ToNot(Succeed())
}
func TestConfigUnsetMany(t *testing.T) { func TestConfigUnsetMany(t *testing.T) {
RegisterTestingT(t) RegisterTestingT(t)
Expect(setupTestApp()).To(Succeed()) Expect(setupTestApp()).To(Succeed())

View File

@@ -46,6 +46,11 @@ config_get() {
config_sub get "$@" config_sub get "$@"
} }
config_clear() {
declare desc="clears config vars"
config_sub clear "$@"
}
config_set() { config_set() {
declare desc="set value of given config var" declare desc="set value of given config var"
config_sub set "$@" config_sub set "$@"

View File

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

View File

@@ -22,6 +22,7 @@ Additional commands:`
helpContent = ` helpContent = `
config (<app>|--global), Pretty-print an app or global environment config (<app>|--global), Pretty-print an app or global environment
config:bundle (<app>|--global) [--merged], Bundle environment into tarfile config:bundle (<app>|--global) [--merged], Bundle environment into tarfile
config:clear (<app>|--global), Clears environment variables
config:export (<app>|--global) [--envfile], Export a global or app environment config:export (<app>|--global) [--envfile], Export a global or app environment
config:get (<app>|--global) KEY, Display a global or app-specific config value config:get (<app>|--global) KEY, Display a global or app-specific config value
config:keys (<app>|--global) [--merged], Show keys set in environment config:keys (<app>|--global) [--merged], Show keys set in environment

View File

@@ -0,0 +1,17 @@
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

@@ -50,6 +50,15 @@ func CommandGet(args []string, global bool, quoted bool) {
} }
} }
//CommandClear implements config:clear
func CommandClear(args []string, global bool, noRestart bool) {
appName, _ := getCommonArgs(global, args)
err := UnsetAll(appName, !noRestart)
if err != nil {
common.LogFail(err.Error())
}
}
//CommandUnset implements config:unset //CommandUnset implements config:unset
func CommandUnset(args []string, global bool, noRestart bool) { func CommandUnset(args []string, global bool, noRestart bool) {
appName, keys := getCommonArgs(global, args) appName, keys := getCommonArgs(global, args)

View File

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

View File

@@ -170,12 +170,20 @@ domains_add_global() {
) -eq 0 ]]; then ) -eq 0 ]]; then
dokku_log_info1 "Skipping: $DOMAIN already added" dokku_log_info1 "Skipping: $DOMAIN already added"
else else
sed -i -e "\$a\\$DOMAIN" "$GLOBAL_VHOST_PATH" grep -qxF "$DOMAIN" "$GLOBAL_VHOST_PATH" || echo "$DOMAIN" >>"$GLOBAL_VHOST_PATH"
dokku_log_info1 "Added $DOMAIN" dokku_log_info1 "Added $DOMAIN"
fi fi
done done
} }
domains_clear_global() {
declare desc="remove all domains"
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
rm "$GLOBAL_VHOST_PATH"
touch "$GLOBAL_VHOST_PATH"
}
domains_remove_global() { domains_remove_global() {
declare desc="remove list of domains" declare desc="remove list of domains"
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST" local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
@@ -249,7 +257,7 @@ get_default_vhosts() {
local SUBDOMAIN=${APP/%\.${VHOST}/} local SUBDOMAIN=${APP/%\.${VHOST}/}
local hostname=$(: | plugn trigger nginx-hostname "$APP" "$SUBDOMAIN" "$VHOST") local hostname=$(: | plugn trigger nginx-hostname "$APP" "$SUBDOMAIN" "$VHOST")
if [[ -z $hostname ]]; then if [[ -z $hostname ]]; then
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then if [[ "$APP" == *.* ]]; then
local hostname="${APP/\//-}" local hostname="${APP/\//-}"
else else
local hostname="${APP/\//-}.$VHOST" local hostname="${APP/\//-}.$VHOST"
@@ -304,7 +312,7 @@ is_global_vhost_enabled() {
is_valid_hostname() { is_valid_hostname() {
declare desc="return 0 if argument is a valid hostname; else return 1" declare desc="return 0 if argument is a valid hostname; else return 1"
local hostname_string="${1,,}" local hostname_string="${1,,}"
local hostname_regex='^([a-z0-9\*-]+\.)*[a-z0-9\*-]+$' local hostname_regex='^[a-z0-9\.\*-]*[a-z0-9\*-]$'
if [[ $hostname_string =~ $hostname_regex ]]; then if [[ $hostname_string =~ $hostname_regex ]]; then
return 0 return 0
else else

View File

@@ -44,13 +44,13 @@ cmd-domains-report-single() {
verify_app_name "$APP" verify_app_name "$APP"
app_flags=( app_flags=(
"--domains-app-enabled: $(fn-domains-app-enabled "$APP")" "--domains-app-enabled: $(fn-domains-app-enabled "$APP")"
"--domains-app-vhosts: $(fn-domains-app-vhosts "$APP")" "--domains-app-vhosts: $(fn-domains-app-vhosts "$APP" | awk '{$1=$1};1')"
) )
fi fi
global_flags=( global_flags=(
"--domains-global-enabled: $(fn-domains-global-enabled)" "--domains-global-enabled: $(fn-domains-global-enabled)"
"--domains-global-vhosts: $(fn-domains-global-vhosts)" "--domains-global-vhosts: $(fn-domains-global-vhosts | awk '{$1=$1};1')"
) )
flag_map=("${app_flags[@]}" "${global_flags[@]}") flag_map=("${app_flags[@]}" "${global_flags[@]}")
@@ -91,6 +91,7 @@ domains_help_content_func() {
domains:add <app> <domain> [<domain> ...], Add domains to app domains:add <app> <domain> [<domain> ...], Add domains to app
domains:add-global <domain> [<domain> ...], Add global domain names domains:add-global <domain> [<domain> ...], Add global domain names
domains:clear <app>, Clear all domains for app domains:clear <app>, Clear all domains for app
domains:clear-global, Clear global domain names
domains:disable <app>, Disable VHOST support domains:disable <app>, Disable VHOST support
domains:enable <app>, Enable VHOST support domains:enable <app>, Enable VHOST support
domains:remove <app> <domain> [<domain> ...], Remove domains from app domains:remove <app> <domain> [<domain> ...], Remove domains from app

View File

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

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
domains_clear_global_cmd() {
declare desc="clear global domain names via command line"
local cmd="domains:clear-global"
shift 1
dokku_log_info1_quiet "Clearing global domains"
domains_clear_global "$@"
}
domains_clear_global_cmd "$@"

View File

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

View File

@@ -60,7 +60,7 @@ enter_default_cmd() {
has_tty && local DOKKU_RUN_OPTS+=" -i -t" has_tty && local DOKKU_RUN_OPTS+=" -i -t"
is_image_herokuish_based "$IMAGE" && local EXEC_CMD="/exec" is_image_herokuish_based "$IMAGE" && local EXEC_CMD="/exec"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker exec $DOKKU_RUN_OPTS $ID $EXEC_CMD "${@:-$DOKKU_APP_SHELL}" "$DOCKER_BIN" exec $DOKKU_RUN_OPTS $ID $EXEC_CMD "${@:-$DOKKU_APP_SHELL}"
} }
enter_default_cmd "$@" enter_default_cmd "$@"

View File

@@ -31,8 +31,8 @@ git_build_app_repo() {
verify_app_name "$APP" verify_app_name "$APP"
# clean up after ourselves # clean up after ourselves
local GIT_BUILD_APP_REPO_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_git.XXXX") local GIT_BUILD_APP_REPO_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
trap 'rm -rf "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT trap "rm -rf '$GIT_BUILD_APP_REPO_TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
local TMP_TAG="dokku/$REV" local TMP_TAG="dokku/$REV"
chmod 755 "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" chmod 755 "$GIT_BUILD_APP_REPO_TMP_WORK_DIR"

View File

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

View File

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

View File

@@ -132,7 +132,7 @@ func GetContainerPort(appName, processType string, isHerokuishContainer bool, co
break break
} }
} }
cmd := sh.Command("docker", "port", containerID, port) cmd := sh.Command(common.DockerBin(), "port", containerID, port)
cmd.Stderr = ioutil.Discard cmd.Stderr = ioutil.Discard
b, err := cmd.Output() b, err := cmd.Output()
if err == nil { if err == nil {

View File

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

View File

@@ -300,11 +300,11 @@ nginx_build_config() {
done done
local PROXY_UPSTREAM_PORTS="$(echo "$PROXY_UPSTREAM_PORTS" | xargs)" local PROXY_UPSTREAM_PORTS="$(echo "$PROXY_UPSTREAM_PORTS" | xargs)"
local NGINX_BUILD_CONFIG_TMP_WORK_DIR=$(mktemp -d /tmp/dokku_nginx_template.XXXXX) local NGINX_BUILD_CONFIG_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local NGINX_CONF=$(mktemp --tmpdir="${NGINX_BUILD_CONFIG_TMP_WORK_DIR}" "nginx.conf.XXXXXX") local NGINX_CONF=$(mktemp --tmpdir="${NGINX_BUILD_CONFIG_TMP_WORK_DIR}" "nginx.conf.XXXX")
local CUSTOM_NGINX_TEMPLATE="$NGINX_BUILD_CONFIG_TMP_WORK_DIR/$NGINX_TEMPLATE_NAME" local CUSTOM_NGINX_TEMPLATE="$NGINX_BUILD_CONFIG_TMP_WORK_DIR/$NGINX_TEMPLATE_NAME"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
trap 'rm -rf $NGINX_CONF $NGINX_BUILD_CONFIG_TMP_WORK_DIR >/dev/null' RETURN INT TERM EXIT trap "rm -rf '$NGINX_CONF' '$NGINX_BUILD_CONFIG_TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
get_custom_nginx_template "$APP" "$CUSTOM_NGINX_TEMPLATE" 2>/dev/null get_custom_nginx_template "$APP" "$CUSTOM_NGINX_TEMPLATE" 2>/dev/null
if [[ -f "$CUSTOM_NGINX_TEMPLATE" ]]; then if [[ -f "$CUSTOM_NGINX_TEMPLATE" ]]; then

View File

@@ -27,8 +27,8 @@ nginx_vhosts_is_valid_nginx_config_func() {
declare desc="checks if an app has a valid nginx config" declare desc="checks if an app has a valid nginx config"
declare APP="$1" declare APP="$1"
local VALIDATE_TEMPLATE="$PLUGIN_AVAILABLE_PATH/nginx-vhosts/templates/validate.conf.sigil" local VALIDATE_TEMPLATE="$PLUGIN_AVAILABLE_PATH/nginx-vhosts/templates/validate.conf.sigil"
local TMP_OUTPUT=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX") local TMP_OUTPUT=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
trap 'rm -rf "$TMP_OUTPUT" >/dev/null' RETURN INT TERM EXIT trap "rm -rf '$TMP_OUTPUT' >/dev/null" RETURN INT TERM EXIT
sigil -f "$VALIDATE_TEMPLATE" NGINX_CONF="$DOKKU_ROOT/$APP/nginx.conf" | cat -s >"$TMP_OUTPUT" sigil -f "$VALIDATE_TEMPLATE" NGINX_CONF="$DOKKU_ROOT/$APP/nginx.conf" | cat -s >"$TMP_OUTPUT"
sudo "$NGINX_LOCATION" -t -c "$TMP_OUTPUT" 2>/dev/null sudo "$NGINX_LOCATION" -t -c "$TMP_OUTPUT" 2>/dev/null

View File

@@ -1,4 +1,4 @@
[plugin] [plugin]
description = "dokku core nginx-vhosts plugin" description = "dokku core nginx-vhosts plugin"
version = "0.16.2" version = "0.17.7"
[plugin.config] [plugin.config]

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
nginx_show_conf_cmd() {
declare desc="display app nginx conf"
declare cmd="nginx:show-conf" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare APP="$1"
verify_app_name "$APP"
if [[ ! -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
dokku_log_fail "No nginx.conf exists for $APP"
fi
cat "$DOKKU_ROOT/$APP/nginx.conf"
}
nginx_show_conf_cmd "$@"

View File

@@ -8,13 +8,14 @@ case "$1" in
help_content_func() { help_content_func() {
declare desc="return plugin plugin help content" declare desc="return plugin plugin help content"
cat <<help_content cat <<help_content
plugin:list, Print active plugins plugin:disable <name>, Disable an installed plugin (third-party only)
plugin:enable <name>, Enable a previously disabled plugin
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]], Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones) plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]], Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones) plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones)
plugin:update [name [committish]], Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins plugin:list, Print active plugins
plugin:enable <name>, Enable a previously disabled plugin plugin:trigger <args...>, Trigger an arbitrary plugin hook
plugin:disable <name>, Disable an installed plugin (third-party only)
plugin:uninstall <name>, Uninstall a plugin (third-party only) plugin:uninstall <name>, Uninstall a plugin (third-party only)
plugin:update [name [committish]], Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
help_content help_content
} }

View File

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

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
plugin_trigger_cmd() {
declare desc="trigger an arbitrary plugin hook"
local cmd="plugin:trigger"
[[ "$1" == "$cmd" ]] && shift 1
plugn trigger "$@"
}
plugin_trigger_cmd "$@"

View File

@@ -80,12 +80,13 @@ proxy_help_content_func() {
declare desc="return proxy plugin help content" declare desc="return proxy plugin help content"
cat <<help_content cat <<help_content
proxy <app>, [DEPRECATED] Show proxy settings for app proxy <app>, [DEPRECATED] Show proxy settings for app
proxy:enable <app>, Enable proxy for app
proxy:disable <app>, Disable proxy for app proxy:disable <app>, Disable proxy for app
proxy:enable <app>, Enable proxy for app
proxy:ports <app>, List proxy port mappings for app proxy:ports <app>, List proxy port mappings for app
proxy:ports-clear <app>, Clear all proxy port mappings for app proxy:ports-add <app> [<scheme>:<host-port>:<container-port>...], Add proxy port mappings to an app
proxy:ports-add <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...], Set proxy port mappings for app proxy:ports-clear <app>, Clear all proxy port mappings for an app
proxy:ports-remove <app> <host-port> [<host-port>|<scheme>:<host-port>:<container-port>...], Unset proxy port mappings for app proxy:ports-remove <app> [<host-port>|<scheme>:<host-port>:<container-port>...], Remove specific proxy port mappings from an app
proxy:ports-set <app> [<scheme>:<host-port>:<container-port>...], Set proxy port mappings for an app
proxy:report [<app>] [<flag>], Displays a proxy report for one or more apps proxy:report [<app>] [<flag>], Displays a proxy report for one or more apps
proxy:set <app> <proxy-type>, Set proxy type for app proxy:set <app> <proxy-type>, Set proxy type for app
help_content help_content

View File

@@ -1,4 +1,4 @@
[plugin] [plugin]
description = "dokku core proxy plugin" description = "dokku core proxy plugin"
version = "0.16.2" version = "0.17.7"
[plugin.config] [plugin.config]

View File

@@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
proxy_ports_add_cmd() { proxy_ports_add_cmd() {
declare desc="add proxy port mappings from an app" declare desc="add proxy port mappings to an app"
local cmd="proxy:add" local cmd="proxy:add"
local APP="$2" local APP="$2"
verify_app_name "$APP" verify_app_name "$APP"

View File

@@ -5,14 +5,14 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
proxy_ports_set_cmd() { proxy_ports_set_cmd() {
declare desc="add proxy port mappings from an app" declare desc="set proxy port mappings for an app"
local cmd="proxy:add" local cmd="proxy:set"
local APP="$2" local APP="$2"
verify_app_name "$APP" verify_app_name "$APP"
shift 2 shift 2
set_proxy_ports "$APP" "$@" set_proxy_ports "$APP" "$@"
plugn trigger post-proxy-ports-update "$APP" "add" plugn trigger post-proxy-ports-update "$APP" "set"
} }
proxy_ports_set_cmd "$@" proxy_ports_set_cmd "$@"

View File

@@ -62,12 +62,17 @@ generate_scale_file() {
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
verify_app_name "$APP" verify_app_name "$APP"
copy_from_image "$IMAGE" "DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || true if copy_from_image "$IMAGE" "DOKKU_SCALE" "$DOKKU_ROOT/$APP" >/dev/null 2>&1; then
cp "$DOKKU_SCALE_FILE" "${DOKKU_SCALE_FILE}.extracted"
else
rm -f "${DOKKU_SCALE_FILE}.extracted"
fi
if [[ ! -f $DOKKU_SCALE_FILE ]]; then if [[ ! -f $DOKKU_SCALE_FILE ]]; then
dokku_log_info1_quiet "DOKKU_SCALE file not found in app image. Generating one based on Procfile..." dokku_log_info1_quiet "DOKKU_SCALE file not found in app image. Generating one based on Procfile..."
local GENERATE_SCALE_FILE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_scale.XXXX") local GENERATE_SCALE_FILE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
trap 'rm -rf "$GENERATE_SCALE_FILE_TMP_WORK_DIR" >/dev/null' RETURN trap "rm -rf '$GENERATE_SCALE_FILE_TMP_WORK_DIR' >/dev/null" RETURN
if [[ -f $DOKKU_PROCFILE ]]; then if [[ -f $DOKKU_PROCFILE ]]; then
while read -r line || [[ -n "$line" ]]; do while read -r line || [[ -n "$line" ]]; do
@@ -94,7 +99,7 @@ set_scale() {
shift 1 shift 1
extract_procfile "$APP" "$IMAGE_TAG" >/dev/null extract_procfile "$APP" "$IMAGE_TAG" >/dev/null
trap 'remove_procfile $APP' RETURN INT TERM EXIT trap "remove_procfile $APP" RETURN INT TERM EXIT
local SCALE_SETTINGS=("$@") local SCALE_SETTINGS=("$@")
for procscale in "${SCALE_SETTINGS[@]}"; do for procscale in "${SCALE_SETTINGS[@]}"; do
@@ -113,6 +118,13 @@ set_scale() {
done done
} }
ps_restore() {
declare desc="restores app"
local APP="$1"
ps_start "$APP"
}
ps_start() { ps_start() {
declare desc="starts app" declare desc="starts app"
local APP="$1" local APP="$1"
@@ -182,7 +194,7 @@ ps_scale() {
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
shift 1 shift 1
[[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG" [[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG" >/dev/null 2>&1
if [[ -z "$@" ]]; then if [[ -z "$@" ]]; then
dokku_log_info1_quiet "Scaling for $APP" dokku_log_info1_quiet "Scaling for $APP"
dokku_col_log_msg_quiet "proctype" "qty" dokku_col_log_msg_quiet "proctype" "qty"
@@ -194,8 +206,12 @@ ps_scale() {
dokku_col_log_msg "${PROC_NAME}:" "$PROC_COUNT" dokku_col_log_msg "${PROC_NAME}:" "$PROC_COUNT"
done <"$DOKKU_SCALE_FILE" done <"$DOKKU_SCALE_FILE"
else else
set_scale "$APP" "$@" if [[ "$(fn-ps-can-scale "$APP")" == "true" ]]; then
release_and_deploy "$APP" "$IMAGE_TAG" set_scale "$APP" "$@"
release_and_deploy "$APP" "$IMAGE_TAG"
else
dokku_log_fail "App contains DOKKU_SCALE file and cannot be manually scaled"
fi
fi fi
} }
@@ -213,27 +229,9 @@ get_restart_policies() {
fn-ps-app-status() { fn-ps-app-status() {
declare APP="$1" declare APP="$1"
local PROCS=0 RUNNING=""
local APP_CIDS=$(get_app_container_ids "$APP")
for CID in $APP_CIDS; do local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
if (is_container_status "$CID" "Running"); then plugn trigger scheduler-app-status "$DOKKU_SCHEDULER" "$APP"
RUNNING+="0"
else
RUNNING+="1"
fi
PROCS=$((PROCS + 1))
done
if [[ "${#RUNNING}" -eq 0 ]] || [[ "${#RUNNING}" -ne 0 ]] && [[ "$RUNNING" != *"0"* ]]; then
RUNNING="false"
elif [[ "$RUNNING" != *"1"* ]] && [[ "${#RUNNING}" -ne 0 ]]; then
RUNNING="true"
else
RUNNING="mixed"
fi
echo "$PROCS $RUNNING"
} }
fn-ps-is-app-running() { fn-ps-is-app-running() {
@@ -241,3 +239,17 @@ fn-ps-is-app-running() {
APP_STATUS=$(fn-ps-app-status "$APP") APP_STATUS=$(fn-ps-app-status "$APP")
echo "$APP_STATUS" | cut -d ' ' -f 2 echo "$APP_STATUS" | cut -d ' ' -f 2
} }
fn-ps-can-scale() {
declare APP="$1"
local IMAGE_TAG=$(get_running_image_tag "$APP")
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
local CAN_SCALE=false
[[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG" >/dev/null 2>&1
if [[ ! -f "${DOKKU_SCALE_FILE}.extracted" ]]; then
CAN_SCALE=true
fi
echo "$CAN_SCALE"
}

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions" source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions"
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
@@ -50,7 +51,8 @@ cmd-ps-report-single() {
if (is_deployed "$APP"); then DEPLOYED="true"; else DEPLOYED="false"; fi if (is_deployed "$APP"); then DEPLOYED="true"; else DEPLOYED="false"; fi
local passed_phases="deploy" local passed_phases="deploy"
RESTARTPOLICY=$(get_restart_policies "$(get_phase_file_path "$passed_phases")" || true) local RESTARTPOLICY=$(get_restart_policies "$(get_phase_file_path "$passed_phases")" || true)
local CAN_SCALE="$(fn-ps-can-scale "$APP")"
local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 2 -n | xargs)" local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 2 -n | xargs)"
local CONTAINER_FILE local CONTAINER_FILE
@@ -60,7 +62,7 @@ cmd-ps-report-single() {
local APP_CONTAINER_STATUS local APP_CONTAINER_STATUS
for CONTAINER_FILE in $CONTAINER_FILES; do for CONTAINER_FILE in $CONTAINER_FILES; do
CID=$(<"$DOKKU_ROOT/$APP/$CONTAINER_FILE") CID=$(<"$DOKKU_ROOT/$APP/$CONTAINER_FILE")
APP_CONTAINER_STATUS=$(docker inspect -f '{{.State.Status}}' "$CID" 2>/dev/null || true) APP_CONTAINER_STATUS=$("$DOCKER_BIN" inspect -f '{{.State.Status}}' "$CID" 2>/dev/null || true)
[[ -z "$APP_CONTAINER_STATUS" ]] && APP_CONTAINER_STATUS="missing" [[ -z "$APP_CONTAINER_STATUS" ]] && APP_CONTAINER_STATUS="missing"
STATUSES+=("${CONTAINER_FILE#*.}:$APP_CONTAINER_STATUS#${CID:0:12}") STATUSES+=("${CONTAINER_FILE#*.}:$APP_CONTAINER_STATUS#${CID:0:12}")
done done
@@ -70,6 +72,7 @@ cmd-ps-report-single() {
"--running: $RUNNING" "--running: $RUNNING"
"--restore: $RESTORE" "--restore: $RESTORE"
"--restart-policy: $RESTARTPOLICY" "--restart-policy: $RESTARTPOLICY"
"--ps-can-scale: $CAN_SCALE"
) )
if [[ -z "$INFO_FLAG" ]]; then if [[ -z "$INFO_FLAG" ]]; then
@@ -115,3 +118,53 @@ cmd-ps-report-single() {
fi fi
fi fi
} }
fn-ps-parallel-cmd() {
declare desc="Run a ps command against all apps"
declare CMD="$1"
local GNU_PARALLEL has_apps=false
for APP in $(dokku_apps); do
has_apps=true
break
done
if [[ "$has_apps" == "false" ]]; then
dokku_log_info1 "No apps detected"
return
fi
if which parallel >/dev/null 2>&1; then
dokku_log_info1 "Running 'dokku ps:${CMD}' in parallel"
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
if [[ -z "$GNU_PARALLEL" ]]; then
# shellcheck disable=SC2046
parallel $DOKKU_PARALLEL_ARGUMENTS -i bash -c "dokku ps:${CMD} {}" -- $(dokku_apps)
else
# shellcheck disable=SC2046
dokku_apps | parallel $DOKKU_PARALLEL_ARGUMENTS "dokku ps:${CMD} {}"
fi
return
fi
dokku_log_info1 "Running 'dokku ps:${CMD}' in serially"
for APP in $(dokku_apps); do
if ! (is_deployed "$APP"); then
dokku_log_warn "App $APP has not been deployed"
continue
fi
if [[ "$CMD" == "restore" ]]; then
local DOKKU_APP_RESTORE=$(config_get "$APP" DOKKU_APP_RESTORE || true)
if [[ "$DOKKU_APP_RESTORE" == 0 ]]; then
continue
fi
fi
dokku_log_verbose "Running 'dokku ps:${CMD} $APP' ..."
if ps_${CMD} "$APP"; then
continue
fi
dokku_log_warn "dokku ps:${CMD} $APP failed"
done
}

View File

@@ -1,4 +1,4 @@
[plugin] [plugin]
description = "dokku core ps plugin" description = "dokku core ps plugin"
version = "0.16.2" version = "0.17.7"
[plugin.config] [plugin.config]

View File

@@ -21,7 +21,7 @@ ps_main_cmd() {
has_tty && local DOKKU_RUN_OPTS="-i -t" has_tty && local DOKKU_RUN_OPTS="-i -t"
dokku_log_info1_quiet "running processes in container: $CID" dokku_log_info1_quiet "running processes in container: $CID"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker exec $DOKKU_RUN_OPTS $CID /bin/sh -c "ps auxwww" "$DOCKER_BIN" exec $DOKKU_RUN_OPTS $CID /bin/sh -c "ps auxwww"
done done
} }

View File

@@ -2,38 +2,13 @@
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/ps/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
ps_rebuildall_cmd() { ps_rebuildall_cmd() {
declare desc="rebuilds all apps from source" declare desc="rebuilds all apps from source"
local cmd="ps:rebuildall" local cmd="ps:rebuildall"
local GNU_PARALLEL
if which parallel >/dev/null 2>&1; then fn-ps-parallel-cmd "rebuild"
dokku_log_info1 "Rebuilding in parallel"
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
if [[ -z "$GNU_PARALLEL" ]]; then
# shellcheck disable=SC2046
parallel -i bash -c "dokku ps:rebuild {}" -- $(dokku_apps)
else
dokku_apps | parallel 'dokku ps:rebuild {}'
fi
return
fi
for app in $(dokku_apps); do
if ! (is_deployed "$app"); then
dokku_log_warn "App $app has not been deployed"
continue
fi
dokku_log_verbose "Rebuilding app $app ..."
if ps_rebuild "$app"; then
continue
fi
dokku_log_warn "dokku ps:rebuild ${app} failed"
done
} }
ps_rebuildall_cmd "$@" ps_rebuildall_cmd "$@"

View File

@@ -2,38 +2,13 @@
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/ps/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
ps_restartall_cmd() { ps_restartall_cmd() {
declare desc="restarts all apps via command line" declare desc="restarts all apps via command line"
local cmd="ps:restartall" local cmd="ps:restartall"
local GNU_PARALLEL
if which parallel >/dev/null 2>&1; then fn-ps-parallel-cmd "restart"
dokku_log_info1 "Restarting in parallel"
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
if [[ -z "$GNU_PARALLEL" ]]; then
# shellcheck disable=SC2046
parallel -i bash -c "dokku ps:restart {}" -- $(dokku_apps)
else
dokku_apps | parallel 'dokku ps:restart {}'
fi
return
fi
for app in $(dokku_apps); do
if ! (is_deployed "$app"); then
dokku_log_warn "App $app has not been deployed"
continue
fi
dokku_log_verbose "Restarting app $app ..."
if ps_restart "$app"; then
continue
fi
dokku_log_warn "dokku ps:restart ${app} failed"
done
} }
ps_restartall_cmd "$@" ps_restartall_cmd "$@"

View File

@@ -4,6 +4,7 @@ set -eo pipefail
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/internal-functions"
ps_restore_cmd() { ps_restore_cmd() {
declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line" declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line"
@@ -12,7 +13,7 @@ ps_restore_cmd() {
local DOKKU_SCHEDULER local DOKKU_SCHEDULER
DOKKU_SCHEDULER=$(get_app_scheduler "$APP") DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
plugn trigger pre-restore "$DOKKU_SCHEDULER" plugn trigger pre-restore "$DOKKU_SCHEDULER" "$APP"
if [[ -n "$APP" ]]; then if [[ -n "$APP" ]]; then
if ! (is_deployed "$APP"); then if ! (is_deployed "$APP"); then
@@ -22,43 +23,11 @@ ps_restore_cmd() {
DOKKU_APP_RESTORE="$(config_get "$APP" DOKKU_APP_RESTORE || true)" DOKKU_APP_RESTORE="$(config_get "$APP" DOKKU_APP_RESTORE || true)"
if [[ $DOKKU_APP_RESTORE != 0 ]]; then if [[ $DOKKU_APP_RESTORE != 0 ]]; then
ps_start "$APP" || dokku_log_warn "dokku ps:restore ${APP} failed" ps_restore "$APP" || dokku_log_warn "dokku ps:restore ${APP} failed"
fi fi
else else
ps_restore_all fn-ps-parallel-cmd "restore"
fi fi
} }
ps_restore_all() {
local GNU_PARALLEL
if which parallel >/dev/null 2>&1; then
dokku_log_info1 "Restarting in parallel"
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
if [[ -z "$GNU_PARALLEL" ]]; then
# shellcheck disable=SC2046
parallel -i bash -c "dokku ps:restore {}" -- $(dokku_apps)
else
dokku_apps | parallel 'dokku ps:restore {}'
fi
return
fi
for app in $(dokku_apps); do
if ! (is_deployed "$app"); then
dokku_log_warn "App $app has not been deployed"
continue
fi
local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true)
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
dokku_log_verbose "Restoring app $app ..."
if ps_start "$app"; then
continue
fi
dokku_log_warn "dokku ps:restore ${app} failed"
fi
done
}
ps_restore_cmd "$@" ps_restore_cmd "$@"

View File

@@ -2,38 +2,13 @@
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/ps/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
ps_startall_cmd() { ps_startall_cmd() {
declare desc="starts all apps via command line" declare desc="starts all apps via command line"
local cmd="ps:startall" local cmd="ps:startall"
local GNU_PARALLEL
if which parallel >/dev/null 2>&1; then fn-ps-parallel-cmd "start"
dokku_log_info1 "Starting in parallel"
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
if [[ -z "$GNU_PARALLEL" ]]; then
# shellcheck disable=SC2046
parallel -i bash -c "dokku ps:start {}" -- $(dokku_apps)
else
dokku_apps | parallel 'dokku ps:start {}'
fi
return
fi
for app in $(dokku_apps); do
if ! (is_deployed "$app"); then
dokku_log_warn "App $app has not been deployed"
continue
fi
dokku_log_verbose "Starting app $app ..."
if ps_start "$app"; then
continue
fi
dokku_log_warn "dokku ps:start ${app} failed"
done
} }
ps_startall_cmd "$@" ps_startall_cmd "$@"

View File

@@ -2,38 +2,13 @@
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/ps/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
ps_stopall_cmd() { ps_stopall_cmd() {
declare desc="stops all apps via command line" declare desc="stops all apps via command line"
local cmd="ps:stopall" local cmd="ps:stopall"
local GNU_PARALLEL
if which parallel >/dev/null 2>&1; then fn-ps-parallel-cmd "stop"
dokku_log_info1 "Stopping in parallel"
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
if [[ -z "$GNU_PARALLEL" ]]; then
# shellcheck disable=SC2046
parallel -i bash -c "dokku ps:stop {}" -- $(dokku_apps)
else
dokku_apps | parallel 'dokku ps:stop {}'
fi
return
fi
for app in $(dokku_apps); do
if ! (is_deployed "$app"); then
dokku_log_warn "App $app has not been deployed"
continue
fi
dokku_log_verbose "Stopping app $app ..."
if ps_stop "$app"; then
continue
fi
dokku_log_warn "dokku ps:stop ${app} failed"
done
} }
ps_stopall_cmd "$@" ps_stopall_cmd "$@"

View File

@@ -1,4 +1,4 @@
[plugin] [plugin]
description = "dokku core repo plugin" description = "dokku core repo plugin"
version = "0.16.2" version = "0.17.7"
[plugin.config] [plugin.config]

View File

@@ -25,7 +25,9 @@ func main() {
dokkuGlobalRunArgs := common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS") dokkuGlobalRunArgs := common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS")
image := common.GetDeployingAppImageName(appName, "", "") image := common.GetDeployingAppImageName(appName, "", "")
if info, _ := os.Stat(cacheDir); info != nil && info.IsDir() { if info, _ := os.Stat(cacheDir); info != nil && info.IsDir() {
purgeCacheCmd := common.NewShellCmd(strings.Join([]string{"docker run --rm", dokkuGlobalRunArgs, purgeCacheCmd := common.NewShellCmd(strings.Join([]string{
common.DockerBin(),
"run --rm", dokkuGlobalRunArgs,
"-v", strings.Join([]string{cacheHostDir, ":/cache"}, ""), image, "-v", strings.Join([]string{cacheHostDir, ":/cache"}, ""), image,
`find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} ;`}, " ")) `find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} ;`}, " "))
purgeCacheCmd.Execute() purgeCacheCmd.Execute()

View File

@@ -1,4 +1,4 @@
[plugin] [plugin]
description = "dokku core resource plugin" description = "dokku core resource plugin"
version = "0.16.2" version = "0.17.7"
[plugin.config] [plugin.config]

View File

@@ -75,11 +75,11 @@ func GetResourceValue(appName string, processType string, resourceType string, k
} }
defaultValue := "" defaultValue := ""
for key, value := range resources { for k, value := range resources {
if key == propertyKey("_default_", resourceType, key) { if k == propertyKey("_default_", resourceType, key) {
defaultValue = value defaultValue = value
} }
if key == propertyKey(processType, resourceType, key) { if k == propertyKey(processType, resourceType, key) {
return value, nil return value, nil
} }
} }

View File

@@ -21,6 +21,11 @@ func main() {
appName := flag.Arg(0) appName := flag.Arg(0)
processType := flag.Arg(3) processType := flag.Arg(3)
if os.Getenv("DOKKU_OMIT_RESOURCE_ARGS") == "1" {
fmt.Print(string(stdin))
return
}
resources, err := common.PropertyGetAll("resource", appName) resources, err := common.PropertyGetAll("resource", appName)
if err != nil { if err != nil {
fmt.Print(string(stdin)) fmt.Print(string(stdin))
@@ -50,6 +55,10 @@ func main() {
continue continue
} }
if parts[1] == "cpu" {
parts[1] = "cpus"
}
limits[parts[1]] = value limits[parts[1]] = value
} }
if parts[0] == "reserve" { if parts[0] == "reserve" {

View File

@@ -14,8 +14,8 @@ func main() {
flag.Parse() flag.Parse()
appName := flag.Arg(0) appName := flag.Arg(0)
processType := flag.Arg(1) processType := flag.Arg(1)
resourceType := flag.Arg(1) resourceType := flag.Arg(2)
key := flag.Arg(1) key := flag.Arg(3)
value, err := resource.GetResourceValue(appName, processType, resourceType, key) value, err := resource.GetResourceValue(appName, processType, resourceType, key)
if err != nil { if err != nil {

View File

@@ -121,10 +121,11 @@ func setResourceType(appName string, processType string, r Resource, resourceTyp
common.LogInfo2Quiet(message) common.LogInfo2Quiet(message)
for key, value := range resources { for key, value := range resources {
if value != "" { if value == "" {
common.LogVerbose(fmt.Sprintf("%v: %v", key, value)) continue
} }
common.LogVerbose(fmt.Sprintf("%v: %v", key, value))
property := propertyKey(processType, resourceType, key) property := propertyKey(processType, resourceType, key)
err := common.PropertyWrite("resource", appName, property, value) err := common.PropertyWrite("resource", appName, property, value)
if err != nil { if err != nil {
@@ -142,7 +143,9 @@ func reportResourceType(appName string, processType string, resourceType string)
} }
message := fmt.Sprintf("resource %v %v information", noun, appName) message := fmt.Sprintf("resource %v %v information", noun, appName)
if processType != "_default_" { if processType == "_default_" {
message = fmt.Sprintf("%v [defaults]", message)
} else {
message = fmt.Sprintf("%v (%v)", message, processType) message = fmt.Sprintf("%v (%v)", message, processType)
} }
common.LogInfo2Quiet(message) common.LogInfo2Quiet(message)

View File

@@ -84,8 +84,8 @@ scheduler-docker-local-check-deploy() {
# docker cp exits with status 1 when run as non-root user when it tries to chown the file # 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. # after successfully copying the file. Thus, we suppress stderr.
# ref: https://github.com/dotcloud/docker/issues/3986 # ref: https://github.com/dotcloud/docker/issues/3986
local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d /tmp/dokku_CHECKS.XXXXX) local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
docker cp "$DOKKU_APP_CONTAINER_ID:/app/CHECKS" "$CHECK_DEPLOY_TMP_WORK_DIR" 2>/dev/null || true "$DOCKER_BIN" cp "$DOKKU_APP_CONTAINER_ID:/app/CHECKS" "$CHECK_DEPLOY_TMP_WORK_DIR" 2>/dev/null || true
local FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS local FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS
@@ -99,7 +99,7 @@ scheduler-docker-local-check-deploy() {
dokku_log_info2_quiet "end $APP $DOKKU_APP_CONTAINER_TYPE container output" dokku_log_info2_quiet "end $APP $DOKKU_APP_CONTAINER_TYPE container output"
fi fi
} }
trap 'checks_check_deploy_cleanup $DOKKU_APP_CONTAINER_ID' RETURN INT TERM EXIT trap "checks_check_deploy_cleanup $DOKKU_APP_CONTAINER_ID" RETURN INT TERM EXIT
if [[ ! -s "${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]]; then if [[ ! -s "${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]]; then
# We allow custom check for web instances only # We allow custom check for web instances only
@@ -119,10 +119,10 @@ scheduler-docker-local-check-deploy() {
sleep "$DOKKU_DEFAULT_CHECKS_WAIT" sleep "$DOKKU_DEFAULT_CHECKS_WAIT"
! (is_container_status "$DOKKU_APP_CONTAINER_ID" "Running") && dokku_log_fail "App container failed to start!!" ! (is_container_status "$DOKKU_APP_CONTAINER_ID" "Running") && dokku_log_fail "App container failed to start!!"
local container_restarts="$(docker inspect -f "{{ .RestartCount }}" "$DOKKU_APP_CONTAINER_ID")" local container_restarts="$("$DOCKER_BIN" inspect -f "{{ .RestartCount }}" "$DOKKU_APP_CONTAINER_ID")"
if [[ $container_restarts -ne 0 ]]; then if [[ $container_restarts -ne 0 ]]; then
docker container update --restart=no "$DOKKU_APP_CONTAINER_ID" &>/dev/null || true "$DOCKER_BIN" container update --restart=no "$DOKKU_APP_CONTAINER_ID" &>/dev/null || true
docker stop "$DOKKU_APP_CONTAINER_ID" || true "$DOCKER_BIN" stop "$DOKKU_APP_CONTAINER_ID" || true
dokku_log_fail "App container failed to start!!" dokku_log_fail "App container failed to start!!"
fi fi

View File

@@ -36,26 +36,26 @@ scheduler-docker-local-core-post-deploy() {
local NAME="$APP.$DYNO" local NAME="$APP.$DYNO"
local CURRENT_CONTAINER_ID="$(<"$container")" local CURRENT_CONTAINER_ID="$(<"$container")"
# TODO: Ensure these are from the current service # TODO: Ensure these are from the current service
local PREVIOUS_CIDS=$(docker ps -a -q -f name="^.?$NAME\$" | xargs) || true local PREVIOUS_CIDS=$("$DOCKER_BIN" ps -a -q -f name="^.?$NAME\$" | xargs) || true
if [[ -n $PREVIOUS_CIDS ]]; then if [[ -n $PREVIOUS_CIDS ]]; then
dokku_log_info1_quiet "Found previous container(s) ($PREVIOUS_CIDS) named $NAME" dokku_log_info1_quiet "Found previous container(s) ($PREVIOUS_CIDS) named $NAME"
# in case $PREVIOUS_CIDS has more than one entry # in case $PREVIOUS_CIDS has more than one entry
local cid local cid
for cid in $PREVIOUS_CIDS; do for cid in $PREVIOUS_CIDS; do
local PREVIOUS_CONTAINER_STATUS=$(docker inspect -f '{{.State.Status}}' "$cid" || echo "dead") local PREVIOUS_CONTAINER_STATUS=$("$DOCKER_BIN" inspect -f '{{.State.Status}}' "$cid" || echo "dead")
# dead containers cannot be renamed # dead containers cannot be renamed
if [[ "$PREVIOUS_CONTAINER_STATUS" != "dead" ]]; then if [[ "$PREVIOUS_CONTAINER_STATUS" != "dead" ]]; then
local CONTAINER_DATE_NAME="$NAME.$(date +%s)" local CONTAINER_DATE_NAME="$NAME.$(date +%s)"
dokku_log_info2_quiet "Renaming container ($cid) ${NAME} to $CONTAINER_DATE_NAME" dokku_log_info2_quiet "Renaming container ($cid) ${NAME} to $CONTAINER_DATE_NAME"
docker rename "$NAME" "$CONTAINER_DATE_NAME" >/dev/null 2>&1 || dokku_log_warn "Unable to rename container" "$DOCKER_BIN" rename "$NAME" "$CONTAINER_DATE_NAME" >/dev/null 2>&1 || dokku_log_warn "Unable to rename container"
fi fi
done done
fi fi
local ID=$(cat "$container") local ID=$(cat "$container")
local CURRENT_NAME=$(docker inspect -f '{{.Name}}' "$ID" | tr -d /) local CURRENT_NAME=$("$DOCKER_BIN" inspect -f '{{.Name}}' "$ID" | tr -d /)
if [[ -n "$CURRENT_NAME" ]]; then if [[ -n "$CURRENT_NAME" ]]; then
dokku_log_info2_quiet "Renaming container (${ID:0:12}) $CURRENT_NAME to $NAME" dokku_log_info2_quiet "Renaming container (${ID:0:12}) $CURRENT_NAME to $NAME"
docker rename "$CURRENT_NAME" "$NAME" >/dev/null "$DOCKER_BIN" rename "$CURRENT_NAME" "$NAME" >/dev/null
fi fi
done done
shopt -u nullglob shopt -u nullglob

View File

@@ -95,7 +95,7 @@ fn-scheduler-docker-local-retire-container() {
declare APP="$1" CID="$2" DEAD_TIME="$3" declare APP="$1" CID="$2" DEAD_TIME="$3"
local STATE local STATE
STATE="$(docker inspect -f "{{ .State.Status }}" "$CID" 2>/dev/null || true)" STATE="$("$DOCKER_BIN" inspect -f "{{ .State.Status }}" "$CID" 2>/dev/null || true)"
if [[ -z "$STATE" ]]; then if [[ -z "$STATE" ]]; then
return return
fi fi
@@ -104,7 +104,7 @@ fn-scheduler-docker-local-retire-container() {
[[ $DOKKU_DOCKER_STOP_TIMEOUT ]] && DOCKER_STOP_TIME_ARG="--time=${DOKKU_DOCKER_STOP_TIMEOUT}" [[ $DOKKU_DOCKER_STOP_TIMEOUT ]] && DOCKER_STOP_TIME_ARG="--time=${DOKKU_DOCKER_STOP_TIMEOUT}"
if [[ "$STATE" == "restarting" ]]; then if [[ "$STATE" == "restarting" ]]; then
docker update --restart=no "$CID" >/dev/null 2>&1 "$DOCKER_BIN" update --restart=no "$CID" >/dev/null 2>&1
fi fi
if [[ "$STATE" != "dead" ]] && [[ "$STATE" != "exited" ]]; then if [[ "$STATE" != "dead" ]] && [[ "$STATE" != "exited" ]]; then
@@ -112,18 +112,18 @@ fn-scheduler-docker-local-retire-container() {
# to not send SIGKILL as the docs would indicate. If that fails, move # to not send SIGKILL as the docs would indicate. If that fails, move
# on to the next. # on to the next.
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker stop $DOCKER_STOP_TIME_ARG "$CID" \ "$DOCKER_BIN" stop $DOCKER_STOP_TIME_ARG "$CID" \
|| docker kill "$CID" \ || "$DOCKER_BIN" kill "$CID" \
|| dokku_log_warn "Unable to kill container ${CID}" || dokku_log_warn "Unable to kill container ${CID}"
fi fi
STATE="$(docker inspect -f "{{ .State.Status }}" "$CID" 2>/dev/null || true)" STATE="$("$DOCKER_BIN" inspect -f "{{ .State.Status }}" "$CID" 2>/dev/null || true)"
if [[ -z "$STATE" ]]; then if [[ -z "$STATE" ]]; then
return return
fi fi
if [[ "$STATE" != "dead" ]] && [[ "$STATE" != "exited" ]]; then if [[ "$STATE" != "dead" ]] && [[ "$STATE" != "exited" ]]; then
if ! docker kill "$CID"; then if ! "$DOCKER_BIN" kill "$CID"; then
dokku_log_warn "Unable to kill container ${CID}" dokku_log_warn "Unable to kill container ${CID}"
fi fi
fi fi

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