Compare commits

...

72 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
197f0c7c95 Release 0.23.3
Some checks failed
bump-formula / bump-formula (push) Has been cancelled
# History

## 0.23.3

Install/update via the bootstrap script:

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

### Bug Fixes

- #4397: @josegonzalez Correctly handle environment variables in deployment tasks for Cloud Native Buildpacks
- #4394: @josegonzalez Swap order of arguments on config-get call

### New Features

- #4395: @josegonzalez Add environment variable support to CNB-based containers

### Refactors

- #4393: @josegonzalez Use docker-image-labeler in cnb builder-build trigger

### Documentation

- #4396: @nerg4l Invalid link to Herokuish Buildpack Deployment in Cloud Native Buildpacks

### Tests

- #4390: @josegonzalez Run tests faster by not cloning the buildpack each time

### Other

- #4389: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 188 to 189 in /tests/apps/php
2021-02-11 07:58:47 -05:00
Jose Diaz-Gonzalez
ef2682945c Merge pull request #4397 from dokku/cnb-deployment-tasks
Correctly handle environment variables in deployment tasks for Cloud Native Buildpacks
2021-02-11 07:57:55 -05:00
Jose Diaz-Gonzalez
5e7ea4217f tests: install pack for app-json tests 2021-02-11 07:34:27 -05:00
Jose Diaz-Gonzalez
123fbea7c0 feat: add a deployment task test for cnb 2021-02-11 07:16:54 -05:00
Jose Diaz-Gonzalez
0673fdff2d fix: handle new herokuish image detection in deployment tasks 2021-02-11 07:16:43 -05:00
Jose Diaz-Gonzalez
e07befb93c Merge pull request #4396 from nerg4l/documentation-patch-cloud-native-buildpacks-link
Invalid link to Herokuish Buildpack Deployment in Cloud Native Buildpacks
2021-02-11 07:15:49 -05:00
László Görög
8e1f890322 docs: fix link
[ci skip]
2021-02-11 13:12:07 +01:00
Jose Diaz-Gonzalez
8ca713f6bb fix: handle empty start command for cnb apps
We should instead fetch the command from the Procfile.
2021-02-11 06:53:48 -05:00
Jose Diaz-Gonzalez
da1ddee0ba fix: override the launcher for cnb apps since the default launcher is the process launcher... 2021-02-11 06:51:01 -05:00
Jose Diaz-Gonzalez
d48cf24c4d fix: unify IsImageHerokuishBased with shell version
Really we should just spit this out into a bin and then have the shell version wrap the golang ones...
2021-02-11 06:49:19 -05:00
Jose Diaz-Gonzalez
5614475521 refactor: reverse if statements
The shell version of IsImageHerokuishBased returns true if it is CNB for legacy reasons...
2021-02-11 06:48:38 -05:00
Jose Diaz-Gonzalez
b826770687 fix: add cnb fix to copy_from_image 2021-02-11 06:43:37 -05:00
Jose Diaz-Gonzalez
34807028db feat: ensure we inject environment variables into the docker container create call in app-json
This fixes an issue where the values are empty for CNB applications.
2021-02-11 06:43:15 -05:00
Jose Diaz-Gonzalez
0405b36ab4 fix: implement config-export hook
This will allow dropping many of the "source config/functions" calls littered over the codebase. Plugin triggers are the way to perform cross-plugin communication :)
2021-02-11 06:41:11 -05:00
Jose Diaz-Gonzalez
291f59999c Merge pull request #4395 from dokku/cnb-env-vars
Add environment variable support to CNB-based containers
2021-02-11 05:21:31 -05:00
Jose Diaz-Gonzalez
1568fc7827 refactor: only special case cnb for now 2021-02-11 04:21:08 -05:00
Jose Diaz-Gonzalez
681fd6abf6 fix: install pack for tests 2021-02-11 04:04:25 -05:00
Jose Diaz-Gonzalez
031159c1b9 fix: correct dockblock 2021-02-11 04:02:06 -05:00
Jose Diaz-Gonzalez
812e34c6f5 feat: properly export env vars for cnb apps
They are not baked into the image like they are for herokuish, so we need to manually set them via --env. Additionally, due to newline constraints in docker, we need to use `--env=key` format to correctly pull the values into place.
2021-02-11 03:52:02 -05:00
Jose Diaz-Gonzalez
5921692f83 feat: add ability to export env vars as a --env=key ... string 2021-02-11 03:50:51 -05:00
Jose Diaz-Gonzalez
33d5dd44d9 refactor: pull container creation into standalone function
this is necessary for us to be able to inject env vars into the call.
2021-02-11 03:50:08 -05:00
Jose Diaz-Gonzalez
d7562d36e6 chore: drop unused destroy 2021-02-11 03:48:42 -05:00
Jose Diaz-Gonzalez
49a2f8ab82 fix: properly specify as argument array 2021-02-11 02:21:43 -05:00
Jose Diaz-Gonzalez
82afae6447 tests: add missing assertion 2021-02-11 02:21:29 -05:00
Jose Diaz-Gonzalez
25ab915883 refactor: standardize on using long-form and equal sign for docker arguments 2021-02-11 02:21:16 -05:00
Jose Diaz-Gonzalez
0963c403ab refactor: simplify container creation call 2021-02-10 11:18:12 -05:00
Jose Diaz-Gonzalez
9c1852fcdb Merge pull request #4393 from dokku/cnb-docker-image-labeler
Use docker-image-labeler in cnb builder-build trigger
2021-02-10 10:33:27 -05:00
Jose Diaz-Gonzalez
a6aef82236 Merge pull request #4394 from dokku/fix-custom-shell
Swap order of arguments on config-get call
2021-02-10 10:33:17 -05:00
Jose Diaz-Gonzalez
8b4e31bb22 refactor: use docker-image-labeler in cnb builder-build trigger 2021-02-10 05:24:11 -05:00
Jose Diaz-Gonzalez
7c923a0fa1 fix: swap order of arguments on config-get call 2021-02-10 05:23:42 -05:00
Jose Diaz-Gonzalez
169f202994 Merge pull request #4390 from dokku/faster-null-runs
Run tests faster by not cloning the buildpack each time
2021-02-08 12:28:56 -05:00
Jose Diaz-Gonzalez
4448e60a8b tests: run tests faster by not cloning the buildpack each time
This is now included in herokuish.
2021-02-08 11:17:14 -05:00
Jose Diaz-Gonzalez
c744c25d35 Merge pull request #4389 from dokku/dependabot/composer/tests/apps/php/heroku/heroku-buildpack-php-189
chore(deps-dev): bump heroku/heroku-buildpack-php from 188 to 189 in /tests/apps/php
2021-02-08 10:51:03 -05:00
dependabot-preview[bot]
f9ebdae66d chore(deps-dev): bump heroku/heroku-buildpack-php in /tests/apps/php
Bumps [heroku/heroku-buildpack-php](https://github.com/heroku/heroku-buildpack-php) from 188 to 189.
- [Release notes](https://github.com/heroku/heroku-buildpack-php/releases)
- [Changelog](https://github.com/heroku/heroku-buildpack-php/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heroku/heroku-buildpack-php/compare/v188...v189)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 06:53:06 +00:00
Jose Diaz-Gonzalez
767ba96186 Release 0.23.2
Some checks failed
bump-formula / bump-formula (push) Has been cancelled
# History

## 0.23.2

Install/update via the bootstrap script:

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

### Bug Fixes

- #4388: @josegonzalez Do not inject max-size option when not using local or json-file log-drivers
- #4386: @josegonzalez Update to docker-image-labeler that handles in-use images

### New Features

- #4387: @josegonzalez Only warn if the vector container is stopped when fetching logs
- #4372: @josegonzalez Add ability to clear an individual resource
- #4384: @josegonzalez Add support for injected cron entries from external plugins

### Refactors

- #4373: @josegonzalez Do not attempt to extract Procfile in ps:scale

### Documentation

- #4377: @josegonzalez Add note about the dokku user cron being overwritten by Dokku

### Other

- #3757: @pickettd Add provision line to Windows Vagrant box for dokku-installer
2021-02-07 22:33:31 -05:00
Jose Diaz-Gonzalez
55213e1045 Merge pull request #4388 from dokku/4376-handle-log-drivers
Do not inject max-size option when not using local or json-file log-drivers
2021-02-07 22:32:54 -05:00
Jose Diaz-Gonzalez
1843d42e0b Merge pull request #4387 from dokku/4385-warn-if-vector-stopped
Only warn if the vector container is stopped when fetching logs
2021-02-07 22:11:09 -05:00
Jose Diaz-Gonzalez
065f5e5922 fix: do not inject max-size option when not using local or json-file log drivers
Closes #4376
2021-02-07 22:10:06 -05:00
Jose Diaz-Gonzalez
f7beb3d95d Merge pull request #3757 from pickettd/fix-installer-windows-vagrant
Add provision line to Windows Vagrant box for dokku-installer
2021-02-07 21:04:25 -05:00
Jose Diaz-Gonzalez
c09dfb8ec8 feat: only warn if the vector container is stopped when fetching logs
Closes #4385
2021-02-07 21:03:21 -05:00
Jose Diaz-Gonzalez
87b90e96b6 Merge pull request #4372 from dokku/clear-individual-resource
Add ability to clear an individual resource
2021-02-07 20:57:33 -05:00
Jose Diaz-Gonzalez
e556be1a0d feat: add ability to clear an individual resource 2021-02-07 20:32:43 -05:00
Jose Diaz-Gonzalez
88fddf2a6d Merge pull request #4384 from dokku/cron-trigger
Add support for injected cron entries from external plugins
2021-02-07 19:28:16 -05:00
Jose Diaz-Gonzalez
97fe71a829 Merge pull request #4386 from dokku/4371-image-labeling
Update to docker-image-labeler that handles in-use images
2021-02-07 19:18:02 -05:00
Jose Diaz-Gonzalez
988cdbd6bb fix: update to docker-image-labeler that handles in-use images
Also ensure we keep track of previous docker image tags.

Refs #4371
2021-02-07 18:26:39 -05:00
Jose Diaz-Gonzalez
be84325de1 feat: add support for injected cron entries
This allows alternative plugins - such as dokku-letsencrypt - to inject scheduled cron tasks into the cron system used by Dokku. Cron systems can choose to include or not include a cron task based on the specified scheduler, and can also optionally use a third parameter to store arbitrary information.
2021-02-07 16:45:34 -05:00
Jose Diaz-Gonzalez
e7d9d6b19e Merge pull request #4373 from dokku/fast-scale
Do not attempt to extract Procfile in ps:scale
2021-02-03 14:50:04 -05:00
Jose Diaz-Gonzalez
bd378e8a44 Merge pull request #4377 from dokku/josegonzalez-patch-1
Add note about the dokku user cron being overwritten by Dokku
2021-02-03 14:49:38 -05:00
Jose Diaz-Gonzalez
82da43cfba docs: fix reference to dokku user crontab in cron docs
[ci skip]
2021-02-03 14:49:25 -05:00
Jose Diaz-Gonzalez
a96ad0c10c docs: add note about the dokku user cron being overwritten by Dokku
This is a BC-incompatible change introduced by 0.23.0.
2021-02-03 14:45:11 -05:00
Jose Diaz-Gonzalez
670e679a09 refactor: do not attempt to extract Procfile in ps:scale
The Procfile is now extracted in the pre-deploy step for every deploy and otherwise not removed. Thus, it should always exist when necessary - web will be scale to 1 automatically and it won't need to be present on future ps:scale calls since we'll have the scale file - and the command can execute faster.
2021-02-03 03:49:44 -05:00
Jose Diaz-Gonzalez
b03485a85b Release 0.23.1
Some checks failed
bump-formula / bump-formula (push) Has been cancelled
# History

## 0.23.1

Install/update via the bootstrap script:

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

### Bug Fixes

- #4368: @josegonzalez Always report resources

### New Features

- #4369: @josegonzalez Allow formatting :report command output as json

### Documentation

- #4367: @josegonzalez Update deeplink to digitalocean marketplace image on homepage
- #4366: @josegonzalez Update Digitalocean docs
- #4363: @josegonzalez Refer to the monitored slack and github discussions channels in the issue template
- #4359: @josegonzalez Fix command call for set-property
- #4358: @Cellane Update header on cron documentation
- #4357: @Cellane Fix spelling in nginx documentation

### Other

- #4365: @dependabot-preview[bot] chore(deps): bump jinja2 from 2.11.2 to 2.11.3 in /tests/apps/python-flask
2021-02-01 22:46:34 -05:00
Jose Diaz-Gonzalez
aac0408f76 Merge pull request #4369 from dokku/report-json-output
Allow formatting :report command output as json
2021-02-01 22:42:00 -05:00
Jose Diaz-Gonzalez
5b9ed4f373 Merge pull request #4368 from dokku/always-report-resources
Always report resources
2021-02-01 22:26:04 -05:00
Jose Diaz-Gonzalez
033b0952dd feat: allow formatting :report command output as json 2021-02-01 22:23:30 -05:00
Jose Diaz-Gonzalez
12e2686e3f fix: always report resource 2021-02-01 19:57:22 -05:00
Jose Diaz-Gonzalez
cc2f054e6a Merge pull request #4367 from dokku/josegonzalez-patch-1
Update deeplink to digitalocean marketplace image on homepage
2021-02-01 17:38:56 -05:00
Jose Diaz-Gonzalez
a799630fac docs: update deeplink to digitalocean marketplace image on homepage
The images have changed location. Also add a referral code to make it possible to run Dokku tests without breaking the bank.
2021-02-01 17:38:40 -05:00
Jose Diaz-Gonzalez
77f0f55ee7 Merge pull request #4366 from dokku/josegonzalez-patch-1
Update Digitalocean docs
2021-02-01 17:37:51 -05:00
Jose Diaz-Gonzalez
48428ed777 Update digitalocean docs
They were slightly out of date. Also include an updated referral link that deeplinks to the marketplace image.

[ci skip]
2021-02-01 17:37:32 -05:00
Jose Diaz-Gonzalez
0c7afb26b0 Merge pull request #4365 from dokku/dependabot/pip/tests/apps/python-flask/jinja2-2.11.3
chore(deps): bump jinja2 from 2.11.2 to 2.11.3 in /tests/apps/python-flask
2021-02-01 02:52:03 -05:00
dependabot-preview[bot]
4f2c968daa chore(deps): bump jinja2 in /tests/apps/python-flask
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-01 06:02:56 +00:00
Jose Diaz-Gonzalez
411f0550e0 Merge pull request #4363 from dokku/josegonzalez-patch-1
Refer to the monitored slack and github discussions channels in the issue template
2021-01-27 16:51:31 -05:00
Jose Diaz-Gonzalez
f9fcad257e docs: refer to the monitored slack and github discussions channels in the issue template
[ci skip]
2021-01-27 16:51:08 -05:00
Jose Diaz-Gonzalez
b0d699f281 Merge pull request #4359 from dokku/josegonzalez-patch-1
Fix command call for set-property
2021-01-25 21:48:05 -05:00
Jose Diaz-Gonzalez
4e8242fe5e docs: fix command call for set-property
[ci skip]
2021-01-25 21:47:54 -05:00
Jose Diaz-Gonzalez
5ceccbdf68 docs: fix command call for set-property
[ci skip]
2021-01-25 21:47:01 -05:00
Jose Diaz-Gonzalez
324c08a8a2 Merge pull request #4358 from Cellane/patch-3
Update header on cron documentation
2021-01-24 20:22:14 -05:00
Milan Vit
103e47b6dd [ci skip] Fix spelling in Cron documentation 2021-01-25 10:09:00 +09:00
Jose Diaz-Gonzalez
09831c3b93 Merge pull request #4357 from Cellane/patch-2
Fix spelling in nginx documentation
2021-01-24 19:55:09 -05:00
Milan Vit
99336870b8 Fix spelling in Nginx documentation 2021-01-25 09:32:15 +09:00
David Pickett
7115839fd5 Add provision line to Windows Vagrant definition so dokku-installer is running/available by default in dokku-windows box 2019-10-23 11:57:20 -10:00
137 changed files with 1006 additions and 325 deletions

View File

@@ -1,5 +1,101 @@
# History
## 0.23.3
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
```
### Bug Fixes
- #4397: @josegonzalez Correctly handle environment variables in deployment tasks for Cloud Native Buildpacks
- #4394: @josegonzalez Swap order of arguments on config-get call
### New Features
- #4395: @josegonzalez Add environment variable support to CNB-based containers
### Refactors
- #4393: @josegonzalez Use docker-image-labeler in cnb builder-build trigger
### Documentation
- #4396: @nerg4l Invalid link to Herokuish Buildpack Deployment in Cloud Native Buildpacks
### Tests
- #4390: @josegonzalez Run tests faster by not cloning the buildpack each time
### Other
- #4389: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 188 to 189 in /tests/apps/php
## 0.23.2
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh
sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh
```
### Bug Fixes
- #4388: @josegonzalez Do not inject max-size option when not using local or json-file log-drivers
- #4386: @josegonzalez Update to docker-image-labeler that handles in-use images
### New Features
- #4387: @josegonzalez Only warn if the vector container is stopped when fetching logs
- #4372: @josegonzalez Add ability to clear an individual resource
- #4384: @josegonzalez Add support for injected cron entries from external plugins
### Refactors
- #4373: @josegonzalez Do not attempt to extract Procfile in ps:scale
### Documentation
- #4377: @josegonzalez Add note about the dokku user cron being overwritten by Dokku
### Other
- #3757: @pickettd Add provision line to Windows Vagrant box for dokku-installer
## 0.23.1
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.1/bootstrap.sh
sudo DOKKU_TAG=v0.23.1 bash bootstrap.sh
```
### Bug Fixes
- #4368: @josegonzalez Always report resources
### New Features
- #4369: @josegonzalez Allow formatting :report command output as json
### Documentation
- #4367: @josegonzalez Update deeplink to digitalocean marketplace image on homepage
- #4366: @josegonzalez Update Digitalocean docs
- #4363: @josegonzalez Refer to the monitored slack and github discussions channels in the issue template
- #4359: @josegonzalez Fix command call for set-property
- #4358: @Cellane Update header on cron documentation
- #4357: @Cellane Fix spelling in nginx documentation
### Other
- #4365: @dependabot-preview[bot] chore(deps): bump jinja2 from 2.11.2 to 2.11.3 in /tests/apps/python-flask
## 0.23.0
Install/update via the bootstrap script:

View File

@@ -2,7 +2,7 @@
>
> If you'd like to sponsor specific functionality, see the project's [Sponsoring](https://github.com/dokku/.github/blob/master/SPONSORING.md) document.
>
> If you need help figuring out how to use a specific buildpack, or are having issues using multiple buildpacks, please see our [irc or slack channels](http://dokku.viewdocs.io/dokku/getting-started/where-to-get-help/#the-irc-and-slack-channels). Issues pertaining to buildpacks may be closed and locked.
> If you need help figuring out how to use a specific buildpack, are seeing an issue in during the buildpack process, or are having issues using multiple buildpacks, please see our [slack channels or github discussion board](http://dokku.viewdocs.io/dokku/getting-started/where-to-get-help/#monitored-locations). Issues pertaining to buildpacks may be closed and locked.
>
> If you need support for a version of Dokku that is more than a year old, your issue may be closed without an answer. Please upgrade to a recent version.

View File

@@ -1,7 +1,7 @@
DOKKU_VERSION ?= master
DOCKER_IMAGE_LABELER_VERSION ?= 0.2.0
HEROKUISH_VERSION ?= 0.5.19
DOCKER_IMAGE_LABELER_VERSION ?= 0.2.2
HEROKUISH_VERSION ?= 0.5.25
PLUGN_VERSION ?= 0.6.1
PROCFILE_VERSION ?= 0.11.0
SIGIL_VERSION ?= 0.6.0

View File

@@ -99,8 +99,8 @@ Otherwise, you will need to import the keypair manually after installation using
To install the latest stable release, run the following commands as a user who has access to `sudo`:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.0/bootstrap.sh
sudo DOKKU_TAG=v0.23.0 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.

1
Vagrantfile vendored
View File

@@ -74,6 +74,7 @@ Vagrant::configure("2") do |config|
vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git dos2unix >/dev/null"
vm.vm.provision :shell, :inline => "cd /vagrant/ && export DOKKU_BRANCH=`git symbolic-ref -q --short HEAD 2>/dev/null` && export DOKKU_TAG=`git describe --tags --exact-match 2>/dev/null` && cd /root/ && cp /vagrant/bootstrap.sh ./ && dos2unix bootstrap.sh && bash bootstrap.sh"
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
end
config.vm.define "dokku-deb", autostart: false do |vm|

View File

@@ -15,7 +15,7 @@ import subprocess
import sys
import threading
VERSION = 'v0.23.0'
VERSION = 'v0.23.3'
def bytes_to_string(b):
if type(b) == bytes:

4
debian/control vendored
View File

@@ -1,9 +1,9 @@
Package: dokku
Version: 0.23.0
Version: 0.23.3
Section: web
Priority: optional
Architecture: amd64
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-image-labeler (>= 0.2.0), net-tools, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-image-labeler (>= 0.2.2), net-tools, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
Recommends: herokuish (>= 0.3.4), parallel, dokku-update, dokku-event-listener
Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>

View File

@@ -35,35 +35,35 @@ dokku plugin:list
```
plugn: dev
00_dokku-standard 0.23.0 enabled dokku core standard plugin
20_events 0.23.0 enabled dokku core events logging plugin
app-json 0.23.0 enabled dokku core app-json plugin
apps 0.23.0 enabled dokku core apps plugin
build-env 0.23.0 enabled dokku core build-env plugin
buildpacks 0.23.0 enabled dokku core buildpacks plugin
certs 0.23.0 enabled dokku core certificate management plugin
checks 0.23.0 enabled dokku core checks plugin
common 0.23.0 enabled dokku core common plugin
config 0.23.0 enabled dokku core config plugin
docker-options 0.23.0 enabled dokku core docker-options plugin
domains 0.23.0 enabled dokku core domains plugin
enter 0.23.0 enabled dokku core enter plugin
git 0.23.0 enabled dokku core git plugin
logs 0.23.0 enabled dokku core logs plugin
network 0.23.0 enabled dokku core network plugin
nginx-vhosts 0.23.0 enabled dokku core nginx-vhosts plugin
plugin 0.23.0 enabled dokku core plugin plugin
proxy 0.23.0 enabled dokku core proxy plugin
ps 0.23.0 enabled dokku core ps plugin
repo 0.23.0 enabled dokku core repo plugin
resource 0.23.0 enabled dokku core resource plugin
scheduler-docker-local 0.23.0 enabled dokku core scheduler-docker-local plugin
shell 0.23.0 enabled dokku core shell plugin
ssh-keys 0.23.0 enabled dokku core ssh-keys plugin
storage 0.23.0 enabled dokku core storage plugin
tags 0.23.0 enabled dokku core tags plugin
tar 0.23.0 enabled dokku core tar plugin
trace 0.23.0 enabled dokku core trace plugin
00_dokku-standard 0.23.3 enabled dokku core standard plugin
20_events 0.23.3 enabled dokku core events logging plugin
app-json 0.23.3 enabled dokku core app-json plugin
apps 0.23.3 enabled dokku core apps plugin
build-env 0.23.3 enabled dokku core build-env plugin
buildpacks 0.23.3 enabled dokku core buildpacks plugin
certs 0.23.3 enabled dokku core certificate management plugin
checks 0.23.3 enabled dokku core checks plugin
common 0.23.3 enabled dokku core common plugin
config 0.23.3 enabled dokku core config plugin
docker-options 0.23.3 enabled dokku core docker-options plugin
domains 0.23.3 enabled dokku core domains plugin
enter 0.23.3 enabled dokku core enter plugin
git 0.23.3 enabled dokku core git plugin
logs 0.23.3 enabled dokku core logs plugin
network 0.23.3 enabled dokku core network plugin
nginx-vhosts 0.23.3 enabled dokku core nginx-vhosts plugin
plugin 0.23.3 enabled dokku core plugin plugin
proxy 0.23.3 enabled dokku core proxy plugin
ps 0.23.3 enabled dokku core ps plugin
repo 0.23.3 enabled dokku core repo plugin
resource 0.23.3 enabled dokku core resource plugin
scheduler-docker-local 0.23.3 enabled dokku core scheduler-docker-local plugin
shell 0.23.3 enabled dokku core shell plugin
ssh-keys 0.23.3 enabled dokku core ssh-keys plugin
storage 0.23.3 enabled dokku core storage plugin
tags 0.23.3 enabled dokku core tags plugin
tar 0.23.3 enabled dokku core tar plugin
trace 0.23.3 enabled dokku core trace plugin
```
> Warning: All plugin commands other than `plugin:list` and `plugin:help` require sudo access and must be run directly from the Dokku server.

View File

@@ -71,6 +71,17 @@ dokku resource:limit --cpu 100 --memory 100 --process-type worker node-js-app
memory: 100
```
A resource value can be individually cleared by setting the value to the special value `clear`.
```shell
dokku resource:limit --cpu clear node-js-app
```
```
=====> Setting resource limits for node-js-app
cpu: cleared
```
#### Displaying Resource Limits
Running the `resource:limit` command without any flags will display the currently configured default app limits.
@@ -169,6 +180,17 @@ dokku resource:reserve --cpu 100 --memory 100 --process-type worker node-js-app
memory: 100
```
A resource value can be individually cleared by setting the value to the special value `clear`.
```shell
dokku resource:reserve --cpu clear node-js-app
```
```
=====> Setting resource reservation for node-js-app
cpu: cleared
```
#### Displaying Resource Reservations
Running the `resource:reserve` command without any flags will display the currently configured default app reservations.

View File

@@ -4,3 +4,5 @@
- The `plugin:list` command no longer outputs the version for the `plugn` binary.
- Users building docker images that run Dokku will need to use a new sudoer wrapper for the `docker-image-labeler` binary to work correctly. A reference version has been placed in the `docker` skeleton directory. This should only impact platform developers, and users of our Docker image will already have the file available.
- The `dokku` user's cron is now in use by Dokku itself. Customizations will be overwritten. Users are encouraged to use a cron entry in `/etc/cron.d/dokku` to avoid this issue.
- As of 0.23.0, Dokku will now inject the `max-size` log driver option for applications. This is restricted to app-configured log driver values empty, `local` or `json-file` in 0.23.1 to increase setup compatibility. Users who configure alternative log drivers at the system level will need to either set the global `max-size` property to `unlimited` or switch to the built-in `vector` logging support.

View File

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

View File

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

View File

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

View File

@@ -20,6 +20,6 @@
"0.20.4",
"0.21.4",
"0.22.9",
"0.23.0"
"0.23.3"
]
}

View File

@@ -168,7 +168,7 @@ Users can override the default `client_max_body_size` value - which limits file
dokku nginx:set node-js-app client-max-body-size 50m
```
The default value is empty string, which will result in nginx falling back to any configured, higher-level defaults (or `1m` if unconfigued. all numeric values _must_ have a trailing time value specified (`k` for kilobytes, `m` for megabytes).
The default value is empty string, which will result in nginx falling back to any configured, higher-level defaults (or `1m` if unconfigued; all numerical values _must_ have a size unit specified (`k` for kilobytes, `m` for megabytes).
The default value may be set by passing an empty value for the option:
@@ -178,7 +178,7 @@ dokku nginx:set node-js-app client-max-body-size
In all cases, the nginx config must be regenerated after setting the above value.
Changing this value when using the php buildpack (or any other buildpack that uses an intermediary server) will require changing the value in the server config shipped with that buildpack. Consult your buildpack documentation for further details.
Changing this value when using the PHP buildpack (or any other buildpack that uses an intermediary server) will require changing the value in the server config shipped with that buildpack. Consult your buildpack documentation for further details.
### Showing the nginx config

View File

@@ -5,7 +5,7 @@
```
buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpacks property for an app
```
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish.md) for more information on how to clear buildpack build cache for an application.
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish-buildpacks.md) for more information on how to clear buildpack build cache for an application.
> Warning: This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps. As the integration is experimental in Dokku, it is likely to change over time.
@@ -42,13 +42,13 @@ As this functionality is highly experimental, there are a number of caveats. Ple
The default stack builder in use by CNB buildpacks in Dokku is based on `heroku/buildpacks`. Users may desire to switch the stack builder to a custom version, either to update the operating system or to customize packages included with the stack builder. This can be performed via the `buildpacks:set-property` command.
```shell
dokku buildpacks:set-property node-js-app paketobuildpacks/build:base-cnb
dokku buildpacks:set-property node-js-app stack paketobuildpacks/build:base-cnb
```
The specified stack builder can also be unset by omitting the name of the stack builder when calling `buildpacks:set-property`.
```shell
dokku buildpacks:set-property node-js-app
dokku buildpacks:set-property node-js-app stack
```
A change in the stack builder value will execute the `post-stack-set` trigger.
@@ -57,8 +57,8 @@ Finally, stack builders can be set or unset globally as a fallback. This will ta
```shell
# set globally
dokku buildpacks:set-property --global paketobuildpacks/build:base-cnb
dokku buildpacks:set-property --global stack paketobuildpacks/build:base-cnb
# unset globally
dokku buildpacks:set-property --global
dokku buildpacks:set-property --global stack
```

View File

@@ -131,13 +131,13 @@ dokku buildpacks:clear node-js-app
The default stack builder in use by Herokuish buildpacks in Dokku is based on `gliderlabs/herokuish:latest`. Typically, this is installed via an OS package which pulls the requisite Docker image. Users may desire to switch the stack builder to a custom version, either to update the operating system or to customize packages included with the stack builder. This can be performed via the `buildpacks:set-property` command.
```shell
dokku buildpacks:set-property node-js-app gliderlabs/herokuish:latest
dokku buildpacks:set-property node-js-app stack gliderlabs/herokuish:latest
```
The specified stack builder can also be unset by omitting the name of the stack builder when calling `buildpacks:set-property`.
```shell
dokku buildpacks:set-property node-js-app
dokku buildpacks:set-property node-js-app stack
```
A change in the stack builder value will execute the `post-stack-set` trigger.
@@ -146,10 +146,10 @@ Finally, stack builders can be set or unset globally as a fallback. This will ta
```shell
# set globally
dokku buildpacks:set-property --global gliderlabs/herokuish:latest
dokku buildpacks:set-property --global stack gliderlabs/herokuish:latest
# unset globally
dokku buildpacks:set-property --global
dokku buildpacks:set-property --global stack
```
### Displaying buildpack reports for an app

View File

@@ -261,6 +261,21 @@ help_content
esac
```
### `config-export`
- Description: Returns the environment variables in a specified format
- Invoked by: app-json plugin
- Arguments: `$APP $GLOBAL $MERGED $FORMAT`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `config-get`
- Description: Fetches the app config value for a key
@@ -309,6 +324,40 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
curl "http://httpstat.us/200"
```
### `cron-write`
- Description: Force triggers writing out cron entries
- Invoked by:
- Arguments:
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
# TODO
```
### `cron-entries`
- Description: Allows injecting cron entries into the written out scheduled cron task list. Each entry is newline delimited, and individual entries come in the form `$SCHEDULE;$FULL_COMMAND;$ARBITRARY_DATA`. Individual implementations of cron writing can decide whether and how to include these cron entries. The `ARBITRARY_DATA` includes the log file path for the basic `docker-local` cron implementation.
- Invoked by:
- Arguments: `$DOKKU_SCHEDULER`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
DOKKU_SCHEDULER="$1"
# TODO
```
### `dependencies`
- Description: Used to install system-level dependencies.

View File

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

View File

@@ -1,12 +1,12 @@
# DigitalOcean Droplet Installation Notes
[DigitalOcean](https://www.digitalocean.com/products/compute/) offers a pre-installed Dokku image. You can run this image on any sized Droplet, although larger Droplets will allow you to run larger applications.
[DigitalOcean](https://marketplace.digitalocean.com/apps/dokku?refcode=fe06b043a083) offers a pre-installed Dokku image. You can run this image on any sized Droplet, although larger Droplets will allow you to run larger applications.
> **Please disable IPv6**. There are known issues with IPv6 on DigitalOcean and Docker. If you would like to run Dokku on an IPv6 DigitalOcean Droplet, please consult [this guide](https://jeffloughridge.wordpress.com/2015/01/17/native-ipv6-functionality-in-docker/).
1. Login to your [DigitalOcean](https://m.do.co/c/fe06b043a083) account.
2. Click **Create a Droplet**.
3. Under **Choose an image > One-click apps**, choose the latest **Dokku** release for 18.04 _(version numbers may vary)_.
3. Under **Choose an image > Marketplace**, search latest **Dokku** release for Ubuntu 20.04 _(version numbers may vary)_.
4. Under **Choose a size**, select your machine spec.
5. Under **Choose a datacenter region**, select your region.
6. Add an SSH Key.

View File

@@ -3,7 +3,7 @@
Pull the dokku/dokku image:
```shell
docker pull dokku/dokku:0.23.0
docker pull dokku/dokku:0.23.3
```
Next, run the image.
@@ -17,7 +17,7 @@ docker run \
--publish 8443:443 \
--volume /var/lib/dokku:/mnt/dokku \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:0.23.0
dokku/dokku:0.23.3
```
Dokku is run in the following configuration:

View File

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

View File

@@ -10,30 +10,30 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.0/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<style>
.sponsors {
@@ -130,12 +130,12 @@
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.23.0/bootstrap.sh</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.23.0 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>
@@ -215,7 +215,7 @@
</div>
<div class="alternate-instructions">
<p>Hate <code>curl | bash</code>? See our official <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/dokku-vm" target="_blank">Azure</a>, <a href="https://www.digitalocean.com/features/one-click-apps/dokku/" target="_blank">DigitalOcean</a>, and <a href="/{{NAME}}~{{REF}}/getting-started/install/dreamhost/">DreamHost Cloud</a> instructions.</p>
<p>Hate <code>curl | bash</code>? See our official <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/dokku-vm" target="_blank">Azure</a>, <a href="https://marketplace.digitalocean.com/apps/dokku?refcode=fe06b043a083 target="_blank">DigitalOcean</a>, and <a href="/{{NAME}}~{{REF}}/getting-started/install/dreamhost/">DreamHost Cloud</a> instructions.</p>
<p>Still no love? <a href="https://github.com/dokku/dokku/blob/master/CONTRIBUTING.md" target="_blank">Contributions welcome</a>!</a></p>
</div>
</div>

View File

@@ -1,4 +1,4 @@
# Scheduled Cron T
# Scheduled Cron Tasks
> New as of 0.23.0
@@ -141,7 +141,7 @@ For tasks that will properly resume, you *should* use the above method, as runni
Regularly scheduled tasks can be a bit of a pain with Dokku. The following are general recommendations to follow to help ensure successful task runs.
- Use the `dokku` user's crontab.
- Use the `dokku` user in your cron entry.
- If you do not, the `dokku` binary will attempt to execute with `sudo`, and your cron run with fail with `sudo: no tty present and no askpass program specified`.
- Add a `MAILTO` environment variable to ship cron emails to yourself.
- Add a `PATH` environment variable or specify the full path to binaries on the host.

View File

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

View File

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

View File

@@ -9,6 +9,10 @@ cmd-report() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
if [[ "$APP" == "--format" ]]; then
dokku_log_fail "--format flag not supported on global report"
fi
dokku_log_info1 "uname: $(uname -a)"
dokku_log_info1 "memory: "
free -m | sed "s/^/ /"

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

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

View File

@@ -16,7 +16,7 @@ import (
"golang.org/x/sync/errgroup"
)
func constructScript(command string, shell string, isHerokuishImage bool, hasEntrypoint bool) []string {
func constructScript(command string, shell string, isHerokuishImage bool, isCnbImage bool, hasEntrypoint bool) []string {
if hasEntrypoint {
words, err := shellquote.Split(strings.TrimSpace(command))
if err != nil {
@@ -31,7 +31,7 @@ func constructScript(command string, shell string, isHerokuishImage bool, hasEnt
script = append(script, "set -x;")
}
if isHerokuishImage {
if isHerokuishImage && !isCnbImage {
script = append(script, []string{
"if [[ -d '/app' ]]; then",
" export HOME=/app;",
@@ -60,7 +60,7 @@ func constructScript(command string, shell string, isHerokuishImage bool, hasEnt
script = append(script, fmt.Sprintf("%s || exit 1;", command))
if isHerokuishImage {
if isHerokuishImage && !isCnbImage {
script = append(script, []string{
"if [[ -d '/cache' ]]; then",
" rm -f /tmp/cache;",
@@ -127,7 +127,7 @@ func getDokkuAppShell(appName string) string {
return nil
})
errs.Go(func() error {
b, _ := common.PlugnTriggerOutput("config-get", []string{"DOKKU_APP_SHELL", appName}...)
b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_SHELL"}...)
appShell = strings.TrimSpace(string(b[:]))
return nil
})
@@ -164,6 +164,7 @@ func executeScript(appName string, image string, imageTag string, phase string)
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
isCnbImage := common.IsImageCnbBased(image)
dockerfileEntrypoint := ""
dockerfileCommand := ""
if !isHerokuishImage {
@@ -173,11 +174,13 @@ func executeScript(appName string, image string, imageTag string, phase string)
hasEntrypoint := dockerfileEntrypoint != ""
dokkuAppShell := getDokkuAppShell(appName)
script := constructScript(command, dokkuAppShell, isHerokuishImage, hasEntrypoint)
script := constructScript(command, dokkuAppShell, isHerokuishImage, isCnbImage, hasEntrypoint)
imageSourceType := "dockerfile"
if isHerokuishImage {
imageSourceType = "herokuish"
} else if isCnbImage {
imageSourceType = "cnb"
}
cacheDir := fmt.Sprintf("%s/cache", common.AppRoot(appName))
@@ -224,6 +227,13 @@ func executeScript(appName string, image string, imageTag string, phase string)
if os.Getenv("DOKKU_TRACE") != "" {
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
}
if isCnbImage {
// TODO: handle non-linux lifecycles
// Ideally we don't have to override this but `pack` injects the web process
// as the default entrypoint, so we need to specify the launcher so the script
// runs as expected
dockerArgs = append(dockerArgs, "--entrypoint=/cnb/lifecycle/launcher")
}
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
if err != nil {
@@ -246,7 +256,7 @@ func executeScript(appName string, image string, imageTag string, phase string)
}
commitArgs := []string{"container", "commit"}
if !isHerokuishImage {
if !isHerokuishImage || isCnbImage {
if dockerfileEntrypoint != "" {
commitArgs = append(commitArgs, "--change", dockerfileEntrypoint)
}
@@ -366,15 +376,25 @@ func createdContainerID(appName string, dockerArgs []string, image string, comma
arguments = append(arguments, image)
arguments = append(arguments, command...)
b, err := common.PlugnTriggerOutput("config-export", []string{appName, "false", "true", "json"}...)
if err != nil {
return "", err
}
var env map[string]string
if err := json.Unmarshal(b, &env); err != nil {
return "", err
}
containerCreateCmd := common.NewShellCmdWithArgs(
common.DockerBin(),
arguments...,
)
var stderr bytes.Buffer
containerCreateCmd.Env = env
containerCreateCmd.ShowOutput = false
containerCreateCmd.Command.Stderr = &stderr
b, err := containerCreateCmd.Output()
b, err = containerCreateCmd.Output()
if err != nil {
return "", errors.New(stderr.String())
}

View File

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

View File

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

View File

@@ -7,7 +7,7 @@ import (
)
// ReportSingleApp is an internal function that displays the app report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
func ReportSingleApp(appName string, format string, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
@@ -26,7 +26,7 @@ func ReportSingleApp(appName, infoFlag string) error {
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportDir(appName string) string {

View File

@@ -65,11 +65,12 @@ func main() {
err = apps.CommandRename(oldAppName, newAppName, *skipDeploy)
case "report":
args := flag.NewFlagSet("apps:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
osArgs, infoFlag, flagErr := common.ParseReportArgs("apps", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = apps.CommandReport(appName, infoFlag)
err = apps.CommandReport(appName, *format, infoFlag)
}
case "unlock":
args := flag.NewFlagSet("apps:unlock", flag.ExitOnError)

View File

@@ -35,7 +35,7 @@ func main() {
err = apps.TriggerPostDelete(appName)
case "report":
appName := flag.Arg(0)
err = apps.ReportSingleApp(appName, "")
err = apps.ReportSingleApp(appName, "", "")
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
}

View File

@@ -175,21 +175,21 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
}
// CommandReport displays an app report for one or more apps
func CommandReport(appName string, infoFlag string) error {
func CommandReport(appName string, format string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
return ReportSingleApp(appName, format, infoFlag)
}
// CommandUnlock unlocks an app for deployment

View File

@@ -38,7 +38,7 @@ trigger-builder-cnb-builder-build() {
pack build "$IMAGE" --builder "$DOKKU_CNB_BUILDER" --path "$SOURCECODE_WORK_DIR" --default-process web
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=build --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.app-name=$APP --label=dokku -t "$IMAGE" -
docker-image-labeler --label=com.dokku.image-stage=build --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku "$IMAGE"
plugn trigger post-build-cnb "$APP" "$SOURCECODE_WORK_DIR"
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-cnb plugin"
version = "0.23.0"
version = "0.23.3"
[plugin.config]

View File

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

View File

@@ -47,14 +47,14 @@ trigger-builder-herokuish-builder-build() {
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true "
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
local DOKKU_CONTAINER_EXIT_CODE=0
local CID=$("$DOCKER_BIN" container create "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
local CID=$("$DOCKER_BIN" container create "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -v $DOKKU_APP_HOST_CACHE_DIR:/cache --env=CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
plugn trigger post-container-create "app" "$CID" "$APP" "build"
"$DOCKER_BIN" container start "$CID" >/dev/null || DOKKU_CONTAINER_EXIT_CODE=$?
"$DOCKER_BIN" container attach "$CID"

View File

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

View File

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

View File

@@ -8,7 +8,7 @@ import (
)
// ReportSingleApp is an internal function that displays the buildpacks report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
func ReportSingleApp(appName string, format string, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
@@ -28,7 +28,7 @@ func ReportSingleApp(appName, infoFlag string) error {
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportComputedStack(appName string) string {

View File

@@ -44,11 +44,12 @@ func main() {
err = buildpacks.CommandRemove(appName, buildpack, *index)
case "report":
args := flag.NewFlagSet("buildpacks:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
osArgs, infoFlag, flagErr := common.ParseReportArgs("buildpacks", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = buildpacks.CommandReport(appName, infoFlag)
err = buildpacks.CommandReport(appName, *format, infoFlag)
}
case "set":
args := flag.NewFlagSet("buildpacks:set", flag.ExitOnError)

View File

@@ -40,7 +40,7 @@ func main() {
err = buildpacks.TriggerPostExtract(appName, sourceWorkDir)
case "report":
appName := flag.Arg(0)
err = buildpacks.ReportSingleApp(appName, "")
err = buildpacks.ReportSingleApp(appName, "", "")
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
}

View File

@@ -104,21 +104,21 @@ func CommandRemove(appName string, buildpack string, index int) (err error) {
}
// CommandReport displays a buildpacks report for one or more apps
func CommandReport(appName string, infoFlag string) error {
func CommandReport(appName string, format string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
return ReportSingleApp(appName, format, infoFlag)
}
// CommandSet implements buildpacks:set

View File

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

View File

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

View File

@@ -2,6 +2,7 @@ package common
import (
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
@@ -305,7 +306,17 @@ func GetenvWithDefault(key string, defaultValue string) (val string) {
func ParseReportArgs(pluginName string, arguments []string) ([]string, string, error) {
osArgs := []string{}
infoFlags := []string{}
for _, argument := range arguments {
skipNext := false
for i, argument := range arguments {
if skipNext {
skipNext = false
continue
}
if argument == "--format" {
osArgs = append(osArgs, argument, arguments[i+1])
skipNext = true
continue
}
if strings.HasPrefix(argument, "--") {
infoFlags = append(infoFlags, argument)
} else {
@@ -323,7 +334,30 @@ func ParseReportArgs(pluginName string, arguments []string) ([]string, string, e
}
// ReportSingleApp is an internal function that displays a report for an app
func ReportSingleApp(reportType string, appName string, infoFlag string, infoFlags map[string]string, infoFlagKeys []string, trimPrefix bool, uppercaseFirstCharacter bool) error {
func ReportSingleApp(reportType string, appName string, infoFlag string, infoFlags map[string]string, infoFlagKeys []string, format string, trimPrefix bool, uppercaseFirstCharacter bool) error {
if format != "stdout" && infoFlag != "" {
return errors.New("--format flag cannot be specified when specifying an info flag")
}
if format == "json" {
data := map[string]string{}
for key, value := range infoFlags {
prefix := "--"
if trimPrefix {
prefix = fmt.Sprintf("--%v-", reportType)
}
// key = strings.Replace(strings.Replace(strings.TrimPrefix(key, prefix), "-", " ", -1), ".", " ", -1)
data[strings.TrimPrefix(key, prefix)] = value
}
out, err := json.Marshal(data)
if err != nil {
return err
}
Log(string(out))
return nil
}
flags := []string{}
for key := range infoFlags {
flags = append(flags, key)

View File

@@ -66,7 +66,9 @@ func CopyFromImage(appName string, image string, source string, destination stri
workDir := ""
if !IsAbsPath(source) {
if IsImageHerokuishBased(image, appName) {
if IsImageCnbBased(image) {
workDir = "/workspace"
} else if IsImageHerokuishBased(image, appName) {
workDir = "/app"
} else {
workDir, _ = DockerInspect(image, "{{.Config.WorkingDir}}")
@@ -257,9 +259,42 @@ func DockerInspect(containerOrImageID, format string) (output string, err error)
return
}
// IsImageCnbBased returns true if app image is based on cnb
func IsImageCnbBased(image string) bool {
if len(image) == 0 {
return false
}
output, err := DockerInspect(image, "{{index .Config.Labels \"io.buildpacks.stack.id\" }}")
if err != nil {
return false
}
return output != ""
}
// IsImageHerokuishBased returns true if app image is based on herokuish
func IsImageHerokuishBased(image string, appName string) bool {
output, err := DockerInspect(image, "{{range .Config.Env}}{{if eq . \"USER=herokuishuser\" }}{{println .}}{{end}}{{end}}")
if len(image) == 0 {
return false
}
if IsImageCnbBased(image) {
return true
}
dokkuAppUser := ""
if len(appName) != 0 {
b, err := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_USER"}...)
if err == nil {
dokkuAppUser = strings.TrimSpace(string(b))
}
}
if len(dokkuAppUser) == 0 {
dokkuAppUser = "herokuishuser"
}
output, err := DockerInspect(image, fmt.Sprintf("{{range .Config.Env}}{{if eq . \"USER=%s\" }}{{println .}}{{end}}{{end}}", dokkuAppUser))
if err != nil {
return false
}

View File

@@ -477,10 +477,10 @@ copy_from_image() {
if verify_image "$IMAGE"; then
if ! is_abs_path "$SRC_FILE"; then
if is_image_herokuish_based "$IMAGE" "$APP"; then
WORKDIR="/app"
elif is_image_cnb_based "$IMAGE"; then
if is_image_cnb_based "$IMAGE"; then
WORKDIR="/workspace"
elif is_image_herokuish_based "$IMAGE" "$APP"; then
WORKDIR="/app"
else
WORKDIR="$("$DOCKER_BIN" image inspect --format '{{.Config.WorkingDir}}' "$IMAGE")"
fi

View File

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

View File

@@ -106,6 +106,16 @@ func PropertyGet(pluginName string, appName string, property string) string {
func PropertyGetAll(pluginName string, appName string) (map[string]string, error) {
properties := make(map[string]string)
pluginAppConfigRoot := getPluginAppPropertyPath(pluginName, appName)
fi, err := os.Stat(pluginAppConfigRoot)
if err != nil {
return properties, nil
}
if !fi.IsDir() {
return properties, errors.New("Specified property path is not a directory")
}
files, err := ioutil.ReadDir(pluginAppConfigRoot)
if err != nil {
return properties, err

View File

@@ -1,5 +1,5 @@
SUBCOMMANDS = subcommands/bundle subcommands/clear subcommands/export subcommands/get subcommands/keys subcommands/show subcommands/set subcommands/unset
TRIGGERS = triggers/config-get triggers/config-get-global
TRIGGERS = triggers/config-export triggers/config-get triggers/config-get-global
BUILD = commands subcommands triggers
PLUGIN_NAME = config

View File

@@ -14,6 +14,12 @@ trigger-config-docker-args() {
STDIN=$(cat)
trigger="$0 config_docker_args"
if is_image_cnb_based "$IMAGE"; then
ENV_ARGS="$(config_export app "$APP" --format docker-args-keys --merged)"
echo -n "$STDIN $ENV_ARGS"
return
fi
if ! is_image_herokuish_based "$IMAGE" "$APP"; then
ENV_ARGS="$(config_export app "$APP" --format docker-args --merged)"
echo -n "$STDIN $ENV_ARGS"

View File

@@ -24,8 +24,10 @@ const (
ExportFormatExports ExportFormat = iota
//ExportFormatEnvfile format: dotenv file
ExportFormatEnvfile
//ExportFormatDockerArgs format: --env args for docker
//ExportFormatDockerArgs format: --env KEY=VALUE args for docker
ExportFormatDockerArgs
//ExportFormatDockerArgsKeys format: --env KEY args for docker
ExportFormatDockerArgsKeys
//ExportFormatShell format: env arguments for shell
ExportFormatShell
//ExportFormatPretty format: pretty-printed in columns
@@ -171,6 +173,8 @@ func (e *Env) Export(format ExportFormat) string {
return e.EnvfileString()
case ExportFormatDockerArgs:
return e.DockerArgsString()
case ExportFormatDockerArgsKeys:
return e.DockerArgsKeysString()
case ExportFormatShell:
return e.ShellString()
case ExportFormatPretty:
@@ -201,6 +205,16 @@ func (e *Env) DockerArgsString() string {
return e.stringWithPrefixAndSeparator("--env=", " ")
}
//DockerArgsKeysString gets the contents of this Env in the form -env=KEY --env...
func (e *Env) DockerArgsKeysString() string {
keys := e.Keys()
entries := make([]string, len(keys))
for i, k := range keys {
entries[i] = fmt.Sprintf("%s%s", "--env=", k)
}
return strings.Join(entries, " ")
}
//JSONString returns the contents of this Env as a key/value json object
func (e *Env) JSONString() string {
data, err := json.Marshal(e.Map())

View File

@@ -54,6 +54,7 @@ func TestExport(t *testing.T) {
e, _ := newEnvFromString("BAR='BAZ'\nFOO='b'ar '\nBAZ='a\\nb'")
Expect(e.Export(ExportFormatEnvfile)).To(Equal("BAR=\"BAZ\"\nBAZ=\"a\\nb\"\nFOO=\"b'ar \""))
Expect(e.Export(ExportFormatDockerArgs)).To(Equal("--env=BAR='BAZ' --env=BAZ='a\nb' --env=FOO='b'\\''ar '"))
Expect(e.Export(ExportFormatDockerArgsKeys)).To(Equal("--env=BAR --env=BAZ --env=FOO"))
Expect(e.Export(ExportFormatShell)).To(Equal("BAR='BAZ' BAZ='a\nb' FOO='b'\\''ar '"))
Expect(e.Export(ExportFormatExports)).To(Equal("export BAR='BAZ'\nexport BAZ='a\nb'\nexport FOO='b'\\''ar '"))
Expect(e.Export(ExportFormatPretty)).To(Equal("BAR: BAZ\nBAZ: a\nb\nFOO: b'ar"))

View File

@@ -0,0 +1,38 @@
package config
import "fmt"
func export(appName string, global bool, merged bool, format string) error {
appName, err := getAppNameOrGlobal(appName, global)
if err != nil {
return err
}
env := getEnvironment(appName, merged)
exportType := ExportFormatExports
suffix := "\n"
exportTypes := map[string]ExportFormat{
"exports": ExportFormatExports,
"envfile": ExportFormatEnvfile,
"docker-args": ExportFormatDockerArgs,
"docker-args-keys": ExportFormatDockerArgsKeys,
"shell": ExportFormatShell,
"pretty": ExportFormatPretty,
"json": ExportFormatJSON,
"json-list": ExportFormatJSONList,
}
exportType, ok := exportTypes[format]
if !ok {
return fmt.Errorf("Unknown export format: %v", format)
}
if exportType == ExportFormatShell {
suffix = " "
}
exported := env.Export(exportType)
fmt.Print(exported + suffix)
return nil
}

View File

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

View File

@@ -49,7 +49,7 @@ func main() {
args := flag.NewFlagSet("config:export", flag.ExitOnError)
global := args.Bool("global", false, "--global: use the global environment")
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | shell | pretty | json | json-list ] which format to export as)")
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | docker-args-keys | shell | pretty | json | json-list ] which format to export as)")
args.Parse(os.Args[2:])
if !*global {
appName = args.Arg(0)

View File

@@ -18,6 +18,12 @@ func main() {
var err error
switch trigger {
case "config-export":
appName := flag.Arg(0)
global := flag.Arg(1)
merged := flag.Arg(2)
format := flag.Arg(3)
config.TriggerConfigExport(appName, global, merged, format)
case "config-get":
appName := flag.Arg(0)
key := flag.Arg(1)

View File

@@ -33,37 +33,7 @@ func CommandClear(appName string, global bool, noRestart bool) error {
// CommandExport implements config:export
func CommandExport(appName string, global bool, merged bool, format string) error {
appName, err := getAppNameOrGlobal(appName, global)
if err != nil {
return err
}
env := getEnvironment(appName, merged)
exportType := ExportFormatExports
suffix := "\n"
exportTypes := map[string]ExportFormat{
"exports": ExportFormatExports,
"envfile": ExportFormatEnvfile,
"docker-args": ExportFormatDockerArgs,
"shell": ExportFormatShell,
"pretty": ExportFormatPretty,
"json": ExportFormatJSON,
"json-list": ExportFormatJSONList,
}
exportType, ok := exportTypes[format]
if !ok {
return fmt.Errorf("Unknown export format: %v", format)
}
if exportType == ExportFormatShell {
suffix = " "
}
exported := env.Export(exportType)
fmt.Print(exported + suffix)
return nil
return export(appName, global, merged, format)
}
// CommandGet implements config:get

View File

@@ -1,6 +1,23 @@
package config
import "fmt"
import (
"fmt"
"strconv"
)
// TriggerConfigExport returns a global config value by key
func TriggerConfigExport(appName string, global string, merged string, format string) error {
g, err := strconv.ParseBool(global)
if err != nil {
return err
}
m, err := strconv.ParseBool(merged)
if err != nil {
return err
}
return export(appName, g, m, format)
}
// TriggerConfigGet returns an app config value by key
func TriggerConfigGet(appName string, key string) error {

View File

@@ -2,5 +2,6 @@
/subcommands/*
/triggers/*
/triggers
/cron-*
/post-*
/report

View File

@@ -1,5 +1,5 @@
SUBCOMMANDS = subcommands/list subcommands/report
TRIGGERS = triggers/post-delete triggers/post-deploy triggers/report
TRIGGERS = triggers/cron-write triggers/post-delete triggers/post-deploy triggers/report
BUILD = commands subcommands triggers
PLUGIN_NAME = cron

View File

@@ -4,11 +4,11 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"html/template"
"io/ioutil"
"os"
"path/filepath"
"strings"
"text/template"
appjson "github.com/dokku/dokku/plugins/app-json"
"github.com/dokku/dokku/plugins/common"
@@ -17,10 +17,23 @@ import (
)
type templateCommand struct {
ID string
App string
Command string
Schedule string
ID string
App string
Command string
Schedule string
AltCommand string
LogFile string
}
func (t templateCommand) CronCommand() string {
if t.AltCommand != "" {
if t.LogFile != "" {
return fmt.Sprintf("%s &>> %s", t.AltCommand, t.LogFile)
}
return t.AltCommand
}
return fmt.Sprintf("dokku --rm run --cron-id %s %s", t.ID, t.App, t.Command)
}
func fetchCronEntries(appName string) ([]templateCommand, error) {
@@ -86,11 +99,7 @@ func deleteCrontab() error {
}
func writeCronEntries() error {
apps, err := common.DokkuApps()
if err != nil {
return deleteCrontab()
}
apps, _ := common.DokkuApps()
commands := []templateCommand{}
for _, appName := range apps {
scheduler := common.GetAppScheduler(appName)
@@ -106,6 +115,30 @@ func writeCronEntries() error {
commands = append(commands, c...)
}
b, _ := common.PlugnTriggerOutput("cron-entries", "docker-local")
common.Log(fmt.Sprintf("output: %s", string(b)))
for _, line := range strings.Split(strings.TrimSpace(string(b[:])), "\n") {
if strings.TrimSpace(line) == "" {
continue
}
parts := strings.Split(line, ";")
if len(parts) != 2 && len(parts) != 3 {
return fmt.Errorf("Invalid injected cron task: %v", line)
}
id := base64.StdEncoding.EncodeToString([]byte(strings.Join(parts, ";;;")))
command := templateCommand{
ID: id,
Schedule: parts[0],
AltCommand: parts[1],
}
if len(parts) == 3 {
command.LogFile = parts[2]
}
commands = append(commands, command)
}
if len(commands) == 0 {
return deleteCrontab()
}
@@ -119,7 +152,7 @@ func writeCronEntries() error {
return err
}
tmpFile, err := ioutil.TempFile(os.TempDir(), fmt.Sprintf("dokku-%s-%s", common.MustGetEnv("DOKKU_PID"), "CopyFromImage"))
tmpFile, err := ioutil.TempFile(os.TempDir(), fmt.Sprintf("dokku-%s-%s", common.MustGetEnv("DOKKU_PID"), "WriteCronEntries"))
if err != nil {
return fmt.Errorf("Cannot create temporary schedule file: %v", err)
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core cron plugin"
version = "0.23.0"
version = "0.23.3"
[plugin.config]

View File

@@ -7,7 +7,7 @@ import (
)
// ReportSingleApp is an internal function that displays the cron report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
func ReportSingleApp(appName string, format string, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
@@ -24,7 +24,7 @@ func ReportSingleApp(appName, infoFlag string) error {
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("cron", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("cron", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportTasks(appName string) string {

View File

@@ -25,11 +25,12 @@ func main() {
err = cron.CommandList(appName)
case "report":
args := flag.NewFlagSet("cron:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
osArgs, infoFlag, flagErr := common.ParseReportArgs("cron", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = cron.CommandReport(appName, infoFlag)
err = cron.CommandReport(appName, *format, infoFlag)
}
default:
common.LogFail(fmt.Sprintf("Invalid plugin subcommand call: %s", subcommand))

View File

@@ -18,13 +18,15 @@ func main() {
var err error
switch trigger {
case "cron-write":
err = cron.TriggerCronWrite()
case "post-delete":
err = cron.TriggerPostDelete()
case "post-deploy":
err = cron.TriggerPostDeploy()
case "report":
appName := flag.Arg(0)
err = cron.ReportSingleApp(appName, "")
err = cron.ReportSingleApp(appName, "", "")
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
}

View File

@@ -29,19 +29,19 @@ func CommandList(appName string) error {
}
// CommandReport displays a cron report for one or more apps
func CommandReport(appName string, infoFlag string) error {
func CommandReport(appName string, format string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
return ReportSingleApp(appName, format, infoFlag)
}

View File

@@ -2,5 +2,5 @@ PATH=/usr/local/bin:/usr/bin:/bin
SHELL=/bin/bash
{{ range $entry := .Commands -}}
{{ $entry.Schedule }} dokku --rm run --cron-id {{ $entry.ID }} {{ $entry.App }} {{ $entry.Command }}
{{ $entry.Schedule }} {{ $entry.CronCommand }}
{{ end -}}

View File

@@ -9,3 +9,8 @@ func TriggerPostDelete() error {
func TriggerPostDeploy() error {
return writeCronEntries()
}
// TriggerCronWrite force updates the cron file for all apps
func TriggerCronWrite() error {
return writeCronEntries()
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,9 +5,11 @@ go 1.15
require (
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/dokku/dokku/plugins/docker-options v0.0.0-20210208020425-f7beb3d95ddd
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common
replace github.com/dokku/dokku/plugins/docker-options => ../docker-options

View File

@@ -4,6 +4,7 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0 h1:ct2XA1aDw8A07Dr8gtrrZgIgLKcZNAl2o9nn0WRMK4Y=
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

View File

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

View File

@@ -5,7 +5,7 @@ import (
)
// ReportSingleApp is an internal function that displays the logs report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
func ReportSingleApp(appName string, format string, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
@@ -26,7 +26,7 @@ func ReportSingleApp(appName, infoFlag string) error {
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("logs", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("logs", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportComputedMaxSize(appName string) string {

View File

@@ -26,11 +26,12 @@ func main() {
err = logs.CommandFailed(appName, *allApps)
case "report":
args := flag.NewFlagSet("logs:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
osArgs, infoFlag, flagErr := common.ParseReportArgs("logs", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = logs.CommandReport(appName, infoFlag)
err = logs.CommandReport(appName, *format, infoFlag)
}
case "set":
args := flag.NewFlagSet("logs:set", flag.ExitOnError)

View File

@@ -32,7 +32,7 @@ func main() {
err = logs.TriggerPostDelete(appName)
case "report":
appName := flag.Arg(0)
err = logs.ReportSingleApp(appName, "")
err = logs.ReportSingleApp(appName, "", "")
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
}

View File

@@ -50,21 +50,21 @@ func CommandFailed(appName string, allApps bool) error {
}
// CommandReport displays a logs report for one or more apps
func CommandReport(appName string, infoFlag string) error {
func CommandReport(appName string, format string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
return ReportSingleApp(appName, format, infoFlag)
}
// CommandSet sets or clears a logs property for an app
@@ -88,7 +88,7 @@ func CommandVectorLogs(lines int, tail bool) error {
}
if !common.ContainerIsRunning(vectorContainerName) {
return errors.New("Vector container is not running")
common.LogWarn("Vector container is not running")
}
common.LogInfo1Quiet("Vector container logs")

View File

@@ -6,8 +6,10 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/dokku/dokku/plugins/common"
dockeroptions "github.com/dokku/dokku/plugins/docker-options"
)
// TriggerDockerArgsProcessDeploy outputs the logs plugin docker options for an app
@@ -17,13 +19,38 @@ func TriggerDockerArgsProcessDeploy(appName string) error {
return err
}
maxSize := common.PropertyGet("logs", appName, "max-size")
if maxSize == "" {
maxSize = common.PropertyGetDefault("logs", "--global", "max-size", MaxSize)
allowedDrivers := map[string]bool{
"local": true,
"json-file": true,
}
if maxSize != "unlimited" {
fmt.Printf(" --log-opt max-size=%s ", maxSize)
ignoreMaxSize := false
options, err := dockeroptions.GetDockerOptionsForPhase(appName, "deploy")
if err != nil {
return err
}
for _, option := range options {
if !strings.HasPrefix(option, "--log-driver=") {
continue
}
logDriver := strings.TrimPrefix(option, "--log-driver=")
if !allowedDrivers[logDriver] {
ignoreMaxSize = true
}
break
}
if !ignoreMaxSize {
maxSize := common.PropertyGet("logs", appName, "max-size")
if maxSize == "" {
maxSize = common.PropertyGetDefault("logs", "--global", "max-size", MaxSize)
}
if maxSize != "unlimited" {
fmt.Printf(" --log-opt=max-size=%s ", maxSize)
}
}
fmt.Print(string(stdin))

View File

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

View File

@@ -7,7 +7,7 @@ import (
)
// ReportSingleApp is an internal function that displays the network report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
func ReportSingleApp(appName string, format string, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
@@ -27,7 +27,7 @@ func ReportSingleApp(appName, infoFlag string) error {
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("network", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("network", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportBindAllInterfaces(appName string) string {

View File

@@ -53,11 +53,12 @@ func main() {
err = network.CommandRebuildall()
case "report":
args := flag.NewFlagSet("network:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
osArgs, infoFlag, flagErr := common.ParseReportArgs("network", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = network.CommandReport(appName, infoFlag)
err = network.CommandReport(appName, *format, infoFlag)
}
case "set":
args := flag.NewFlagSet("network:set", flag.ExitOnError)

View File

@@ -88,7 +88,7 @@ func main() {
network.TriggerCorePostDeploy(appName)
case "report":
appName := flag.Arg(0)
err = network.ReportSingleApp(appName, "")
err = network.ReportSingleApp(appName, "", "")
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
}

View File

@@ -123,21 +123,21 @@ func CommandRebuildall() error {
}
// CommandReport displays a network report for one or more apps
func CommandReport(appName string, infoFlag string) error {
func CommandReport(appName string, format string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
return ReportSingleApp(appName, format, infoFlag)
}
// CommandSet set or clear a network property for an app

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@ import (
)
// ReportSingleApp is an internal function that displays the proxy report for one or more apps
func ReportSingleApp(appName string, infoFlag string) error {
func ReportSingleApp(appName string, format string, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
@@ -26,7 +26,7 @@ func ReportSingleApp(appName string, infoFlag string) error {
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("proxy", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("proxy", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportEnabled(appName string) string {

View File

@@ -64,11 +64,12 @@ func main() {
err = proxy.CommandPortsSet(appName, portMaps)
case "report":
args := flag.NewFlagSet("proxy:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
osArgs, infoFlag, flagErr := common.ParseReportArgs("proxy", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = proxy.CommandReport(appName, infoFlag)
err = proxy.CommandReport(appName, *format, infoFlag)
}
case "set":
args := flag.NewFlagSet("proxy:set", flag.ExitOnError)

View File

@@ -32,7 +32,7 @@ func main() {
proxy.TriggerPostCertsUpdate(appName)
case "report":
appName := flag.Arg(0)
err = proxy.ReportSingleApp(appName, "")
err = proxy.ReportSingleApp(appName, "", "")
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
}

View File

@@ -150,21 +150,21 @@ func CommandPortsSet(appName string, portMaps []string) error {
}
// CommandReport displays a proxy report for one or more apps
func CommandReport(appName string, infoFlag string) error {
func CommandReport(appName string, format string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
return ReportSingleApp(appName, format, infoFlag)
}
// CommandSet sets a proxy for an app

View File

@@ -9,3 +9,4 @@
/pre-*
/procfile-*
/app-restart
/core-post-deploy

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