Compare commits

...

132 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
950b7ed6be Release 0.18.2
# History

## 0.18.2

Install/update via the bootstrap script:

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

### New Features

- #3645: @josegonzalez Use version in DOKKU_LIB_ROOT
- #3644: @josegonzalez Refactor temp file handling
- #3643: @josegonzalez Quiet deploy output
- #3641: @josegonzalez Pass SOURCECODE_WORK_DIR to build-buildpack triggers
- #3639: @josegonzalez Refer to upstream sshcommand package

### Documentation

- #3642: @josegonzalez Correct issue with label change in docs
- #3640: @josegonzalez Add missing popd to post-extract example
2019-08-13 13:57:56 -04:00
Jose Diaz-Gonzalez
9432cdd37c fix: remove the build-env plugin from rpm installs
Closes #3646
2019-08-13 13:57:19 -04:00
Jose Diaz-Gonzalez
5bd499a9bc Merge pull request #3645 from dokku/version-outside-dokku-root
Use version in DOKKU_LIB_ROOT
2019-08-13 01:59:44 -04:00
Jose Diaz-Gonzalez
5506c9e27d refactor: use version in DOKKU_LIB_ROOT
The version in DOKKU_ROOT may be incorrect for docker-based installs if that directory is mounted from an external volume. Instead, pull it from the DOKKU_LIB_ROOT directory, and respect the STABLE_VERSION if specified (VERSION will be the entire version, including commit sha).
2019-08-13 00:53:49 -04:00
Jose Diaz-Gonzalez
e07703645e Merge pull request #3644 from dokku/tmp-files
Refactor temp file handling
2019-08-12 19:27:24 -04:00
Jose Diaz-Gonzalez
3ca6245b00 fix: use 6 X to support running under busybox
mktemp from busybox requires that all templates end with XXXXXX.
2019-08-12 18:16:16 -04:00
Jose Diaz-Gonzalez
925c6c4c28 feat: inject the dokku PID into temporary files/directories
This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
2019-08-12 17:56:17 -04:00
Jose Diaz-Gonzalez
0588b6f161 refactor: directly use a tmp file for app.json 2019-08-12 17:53:15 -04:00
Jose Diaz-Gonzalez
fee2d50148 Merge pull request #3643 from dokku/quieter-deploys
Quiet deploy output
2019-08-12 17:40:10 -04:00
Jose Diaz-Gonzalez
9a2c8e04a5 feat: quiet down deploys 2019-08-12 17:39:01 -04:00
Jose Diaz-Gonzalez
2517d392a4 Merge pull request #3642 from dokku/fix-label-docs
Correct issue with label change in docs
2019-08-12 16:20:50 -04:00
Jose Diaz-Gonzalez
a0b6663bef docs: correct issue with label change in docs
[ci skip]
2019-08-12 16:20:22 -04:00
Jose Diaz-Gonzalez
5fb7b0a74c Merge pull request #3641 from dokku/pass-sourcecode-work-dir
Pass SOURCECODE_WORK_DIR to build-buildpack triggers
2019-08-12 16:14:51 -04:00
Jose Diaz-Gonzalez
026d04a65f feat: pass SOURCECODE_WORK_DIR to build-buildpack triggers
This will allow those triggers to insert and extract files from the sourcecode work directory. Note that changes are not committed to this directory, nor will they be reflected in the committed codebase.
2019-08-12 16:08:31 -04:00
Jose Diaz-Gonzalez
94ace70626 Merge pull request #3639 from dokku/upgrade-sshcommand
Refer to upstream sshcommand package
2019-08-12 11:11:33 -04:00
Jose Diaz-Gonzalez
2d36dc2a04 Merge pull request #3640 from dokku/josegonzalez-patch-1
Add missing popd to post-extract example
2019-08-12 11:11:18 -04:00
Jose Diaz-Gonzalez
f3819a46e9 docs: add missing popd to post-extract example
[ci skip]
2019-08-12 11:10:54 -04:00
Jose Diaz-Gonzalez
c66e08041a refactor: refer to upstream sshcommand package
sshcommand now packages itself.
2019-08-10 19:55:21 -04:00
Jose Diaz-Gonzalez
9e9f601690 Release 0.18.1
# History

## 0.18.1

Install/update via the bootstrap script:

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

### New Features

- #3636: @josegonzalez Unify deb and rpm creation code
- #3635: @josegonzalez Upgrade herokuish to 0.5.2
2019-08-10 14:32:13 -04:00
Jose Diaz-Gonzalez
c9bc4f8615 Merge pull request #3636 from dokku/refactor-deb-install
Unify deb and rpm creation code
2019-08-10 14:29:29 -04:00
Jose Diaz-Gonzalez
34ee8e7079 Merge pull request #3635 from dokku/upgrade-herokuish
Upgrade herokuish to 0.5.2
2019-08-08 15:52:48 -04:00
Jose Diaz-Gonzalez
4ab30b8c14 chore: unify deb and rpm creation code
- split things into functions
- port code that handled postinst on deb to rpm and vice-versa
2019-08-08 15:18:00 -04:00
Jose Diaz-Gonzalez
3bc6f071cf feat: upgrade herokuish to 0.5.2 2019-08-08 14:53:50 -04:00
Jose Diaz-Gonzalez
0669121242 fix: correct minor issues in docker install docs 2019-08-07 11:53:18 -04:00
Jose Diaz-Gonzalez
03c7543060 Release 0.18.0
# History

## 0.18.0

Install/update via the bootstrap script:

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

### Bug Fixes

- #3627: @josegonzalez Make image removal synchronous
- #3618: @josegonzalez Ensure the dokku-retire timer is properly installed
- #3614: @alexquick Validate args for config:set and config:unset
- #3605: @josegonzalez Handle case where there are empty newlines in the authorized_keys file
- #3603: @josegonzalez Drop extra % sign in common.LogVerboseQuiet
- #3597: @josegonzalez Allow default trace function to work

### New Features

- #3628: @josegonzalez Handle file copying in a secure and reliable fashion
- #3630: @josegonzalez Fix issue where push warning on bad branch was skipped
- #3629: @josegonzalez Avoid calling the user-auth trigger where possible
- #3626: @josegonzalez Builder plugins
- #3599: @josegonzalez Scope docker-cleanup to specific app
- #3589: @michaelshobbs Allow running Dokku in Docker
- #3607: @josegonzalez Purge cache using herokuish image
- #3602: @alexymik Create a 502 error page to automatically refresh if backend status changes
- #3600: @josegonzalez Refactor IsImageHerokuishBased to match shell version

### Documentation

- #3625: @josegonzalez Remove old reference to SPONSORS.md
- #3619: @josegonzalez Cleanup plugin creation docs
- #3612: @jayjun Improve testing docs
- #3613: @Lyelt Remove all uses of proxy_set_header Connection "upgrade"
- #3596: @josegonzalez Add missing hooks to events plugin and plugin triggers docs

### Tests

- #3610: @jayjun Correct Bats path in single tests
2019-08-07 07:22:12 -04:00
Jose Diaz-Gonzalez
9730992f95 Merge pull request #3628 from dokku/3611-windows-newlines
Handle file copying in a secure and reliable fashion
2019-08-05 16:56:23 -04:00
Jose Diaz-Gonzalez
6fcb53113a fix: return true when removing temporary files extracted from docker
If you are running docker in docker, the permissions on the generated file are such that they may not be accessible by the normal dokku user. For dokku, it is good enough to ignore the failed removal.
2019-08-05 15:57:54 -04:00
Jose Diaz-Gonzalez
5affe42699 fix: remove unnecessary cat 2019-08-05 15:24:15 -04:00
Jose Diaz-Gonzalez
eef9f5eba5 fix: ignore errors in copy_from_image within the check-deploy trigger
The trigger will later on check if it needs to run checks on its own by inspecting the file.
2019-08-05 13:35:33 -04:00
Jose Diaz-Gonzalez
86febeb7ca fix: do not try to remove the container twice 2019-08-05 13:35:03 -04:00
Jose Diaz-Gonzalez
697afaa2cc fix: add missing dos2unix dependency 2019-08-05 12:44:34 -04:00
Jose Diaz-Gonzalez
78a5e4d331 docs: document copying files from images 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
1a322eeeb8 refactor: use copy_from_image helper for copying CHECKS files
Closes #3611
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
7dbeffd041 chore: drop unnecessary stdout redirect to /dev/null 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
8dbf855d56 feat: handle case where docker cp is run as non root and tries to chown the file
This _may_ be cargo-cult, but its an easy way to handle any potential issues, so we'll include it regardless.
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
dc9d597cd8 feat: handle case where file may not have trailing newline and parsing depends on it 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
f771b272e3 fix: handle case where file may have windows newlines
Closes #3611
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
6c8f716c11 refactor: handle case copied file is not directly readable
If "docker cp" is run within docker, it seems the owner is root, resulting in other processes not being able to directly read the file without resorting to `cat` trickery. Doing this in a single place avoids the problem completely.
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
d326c17dfb chore: standardize on writing to file versus a destination 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
0567bfd65d Merge pull request #3627 from dokku/3474-synchronous-image-removal
Make image removal synchronous
2019-08-05 11:38:49 -04:00
Jose Diaz-Gonzalez
008fafbed8 fix: force image pruning 2019-08-03 14:21:34 -04:00
Jose Diaz-Gonzalez
c959b236ea fix: do not prune all unused images
This would impact base images related to image building, as well as other images not managed by Dokku directly.
2019-08-02 11:38:08 -04:00
Jose Diaz-Gonzalez
85b41121de fix: make image removal synchronous
Asynchronous image removal would remove intermediate build images during the build process, causing intermittent build failures for users of multi-stage dockerfiles. While we still remove intermediate docker images that may be used in the current build, we now do so during the deploy, ensuring that there are no intermediate build failures in the future.

Closes #3474
2019-08-02 11:21:51 -04:00
Jose Diaz-Gonzalez
7de242b4ee Merge pull request #3630 from dokku/3592-notify-on-bad-branch
Fix issue where push warning on bad branch was skipped
2019-08-02 11:20:46 -04:00
Jose Diaz-Gonzalez
27ed3c52e3 Merge branch 'master' into 3592-notify-on-bad-branch 2019-08-02 11:20:37 -04:00
Jose Diaz-Gonzalez
c4c278fbcb Merge pull request #3629 from dokku/faster-execution
Avoid calling the user-auth trigger where possible
2019-08-02 11:20:26 -04:00
Jose Diaz-Gonzalez
5f4f12c27f fix: add run as prefix to deploy_app 2019-08-01 20:54:56 -04:00
Jose Diaz-Gonzalez
5000c32efe fix: add test for warning on pushing to wrong branch
Closes #3592
2019-08-01 20:54:38 -04:00
Jose Diaz-Gonzalez
5b53994447 feat: avoid calling the user-auth trigger where possible
As this trigger is always in the execution path, `plugn` starts and expensively checks to see if it can execute the trigger. Rather than call this on every invocation, skip the trigger if no non-core implementation exists.
2019-08-01 20:18:14 -04:00
Jose Diaz-Gonzalez
ba5b5d4596 Merge pull request #3626 from dokku/builder-plugins
Builder plugins
2019-08-01 18:17:09 -04:00
Jose Diaz-Gonzalez
a17a0e9a82 feat: add the ability to modify the DOKKU_IMAGE in use for the herokuish builder
This is a "one-shot" ability, meaning that it is highly discouraged for multiple plugins to implement the triggers.

The `builder-create-dokku-image` trigger is meant to modify the base DOKKU_IMAGE that will be used to build an application. A good use of the hook is to inject system packages by:

- calculating an image tag from the set of system packages
- checking that the image doesnt already exist
- creating the image if it does not

As the output is sent to stdout, we have to find an alternative way of fetching the new DOKKU_IMAGE. The `builder-dokku-image` trigger can output an image tag based on the calculated image tag. If no tag is output, then the DOKKU_IMAGE is used as is.

Using this pattern, users can efficiently modify the base image in use for an app without duplicating the work on every push. This is especially useful for package installation, where packages are required for app building, but may take a long time and can be error prone.
2019-07-30 14:58:49 -04:00
Jose Diaz-Gonzalez
0a8d5eb744 refactor: add initial support for builder plugins
A builder plugin implements some method for 'building' artifacts from a given source code archive. This refactor moves the majority of the image building code into separate plugins, allowing us to implement other builders, but also simplifying the common pugin codebase.

Also move the pre-build-buildpack hook from the build-env plugin to builder-herokuish.
2019-07-30 14:42:30 -04:00
Jose Diaz-Gonzalez
af8ade0a09 Merge pull request #3625 from dokku/josegonzalez-patch-1
Remove old reference to SPONSORS.md
2019-07-30 10:43:19 -04:00
Jose Diaz-Gonzalez
b3ba600cf8 docs: remove old reference to SPONSORS.md
Anyone wishing to sponsor should do so on Patreon or OpenCollective.

[ci skip]
2019-07-30 10:42:54 -04:00
Jose Diaz-Gonzalez
ce98222eec Merge pull request #3599 from dokku/3515-better-cleanup
Scope docker-cleanup to specific app
2019-07-29 21:37:54 -04:00
Jose Diaz-Gonzalez
6836e56b24 refactor: add global docker build and run args
This reduces duplication and allows users to rely on global arguments to generate most labels needed.

The 'commit' command cannot have global arguments because the whitespace within the label change breaks string-based interpolation, and shell arrays cannot be exported.
2019-07-20 05:52:20 -04:00
Jose Diaz-Gonzalez
193e40b4c3 feat: scope cleanup to app when specified
This will require changes in community plugins to properly add the specified labels to intermediate containers.

Closes #3515
2019-07-19 15:45:43 -04:00
Jose Diaz-Gonzalez
d1af10fc51 feat: add labels to all build, commit, create, and run docker calls
This will allow us to further filter containers and images by application when cleaning up containers.

Refs #3515
2019-07-19 15:45:43 -04:00
Jose Diaz-Gonzalez
968543c66c Merge pull request #3619 from dokku/josegonzalez-patch-1
Cleanup plugin creation docs
2019-07-19 15:45:32 -04:00
Jose Diaz-Gonzalez
da27ab3d40 docs: cleanup plugin creation docs
The plugin creation docs were hard to follow, unnecessarily complicating issues for developers. The new format should make the recommendations clear, and align examples with the core code.

[ci skip]
2019-07-19 15:31:44 -04:00
Jose Diaz-Gonzalez
034ebff42a Merge pull request #3589 from dokku/1076-run-in-docker
Allow running Dokku in Docker
2019-07-18 02:44:43 -04:00
Jose Diaz-Gonzalez
11241e5003 fix: add missing cgroupfs-mount 2019-07-18 01:15:44 -04:00
Michael Hobbs
b8c2259775 test docker image 2019-07-18 00:28:48 -04:00
Michael Hobbs
1437b77c6c run tests against native dokku 2019-07-18 00:28:48 -04:00
Michael Hobbs
ded056d003 hack: use tmp file for CHECKS file without EOF newline 2019-07-18 00:27:09 -04:00
Michael Hobbs
8830e15526 use custom docker bin 2019-07-18 00:27:09 -04:00
Michael Hobbs
67bdd47015 wait for CI dokku container to startup 2019-07-18 00:27:09 -04:00
Michael Hobbs
e8382362e5 remove tests/dhparam.pem dockerignore exception 2019-07-18 00:27:09 -04:00
Michael Hobbs
7de68e7052 remove unnecessary CI env vars 2019-07-18 00:27:09 -04:00
Michael Hobbs
f723333a90 don't run shfmt in CI 2019-07-18 00:26:31 -04:00
Michael Hobbs
d8ada6a6e9 install dokku from built deb package and use docker image for integrations tests 2019-07-18 00:26:31 -04:00
Michael Hobbs
1f882d09bf fix port typo 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
ecfb54c668 refactor: switch to /mnt/dokku 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
7aeb17986a docs: clarify usage of docker-based installation
ssh-key addition wasn't previously scoped out.
2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
3500dbfa6a refactor: clean up dockerfile to reduce image layers 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
230a098b7b chore: drop unnecessary copy of test dhparam 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
a568965d14 fix: run shfmt 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
c5d5bc9a9c chore: minor fixes to docker-based install docs 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
1a4af9b3ea feat: handle builds during the release process 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
ea32544e37 feat: set the debconf value for the global hostname 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
9b67ffe9d4 feat: properly handle dhparam
The dhparam file should be specific to each installation, and thus needs to be generated on first run.
2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
6fe984fd3c fix: ensure releases take docker-based installation into account when updating version numbers 2019-07-18 00:24:24 -04:00
Jose Diaz-Gonzalez
98bf4b7b31 docs: add documentation for docker-based installation 2019-07-18 00:24:23 -04:00
Jose Diaz-Gonzalez
d7bb131b37 feat: add the ability to install arbitrary plugins on container start 2019-07-18 00:24:23 -04:00
Jose Diaz-Gonzalez
01f317bbf3 feat: initialize plugins on boot 2019-07-18 00:24:23 -04:00
Jose Diaz-Gonzalez
56d8346d65 docs: standardizing installation doc titles 2019-07-18 00:24:23 -04:00
Jose Diaz-Gonzalez
3eb9c9b3ba feat: initial docker installation support
Refs #1076
2019-07-18 00:24:23 -04:00
Jose Diaz-Gonzalez
6b42fde028 fix: handle case where modprobe does not exist
This is possible when installing dokku within a docker image.
2019-07-18 00:24:23 -04:00
Jose Diaz-Gonzalez
b0b036549a Merge pull request #3618 from dokku/3615-systemd-retire
Ensure the dokku-retire timer is properly installed
2019-07-18 00:09:30 -04:00
Jose Diaz-Gonzalez
eada23d3f6 feat: build on systemd 2019-07-17 20:48:57 -04:00
Jose Diaz-Gonzalez
402c6db826 chore: move the event logging to it's own tag
Without this, rsyslog will shunt any logging output from the dokku user to the event log, garbling output for future investigation.
2019-07-17 20:48:57 -04:00
Jose Diaz-Gonzalez
5a52286309 fix: ensure the dokku-retire timer is properly installed
Closes #3615
2019-07-17 20:48:57 -04:00
Jose Diaz-Gonzalez
22ffa41d31 Merge pull request #3612 from jayjun/testing
Improve testing docs
2019-07-17 17:20:20 -04:00
Jose Diaz-Gonzalez
e8d6e879c8 Merge pull request #3614 from alexquick/fix-3606
[config] validate args for config:set and config:unset
2019-07-17 17:19:00 -04:00
Jose Diaz-Gonzalez
d4d69e5224 Merge pull request #3610 from jayjun/bats
Correct Bats path in single tests
2019-07-14 23:13:01 -07:00
Jose Diaz-Gonzalez
f4c0715299 Merge pull request #3613 from Lyelt/master
Remove all uses of proxy_set_header Connection "upgrade"
2019-07-14 23:11:57 -07:00
Alex Quick
2cab7f24ed [config] validate args for config:set and config:unset
Fixes dokku/dokku#3606
2019-07-14 12:16:56 -04:00
Nicholas Ghobrial
af9a43b4f5 Merge branch 'master' into master 2019-07-13 01:50:19 -04:00
Nicholas Ghobrial
dfda7d63f4 Escape $ 2019-07-13 01:25:55 -04:00
Nicholas Ghobrial
05bdda036f Remove all uses of
proxy_set_header Connection "upgrade"
2019-07-13 01:18:29 -04:00
Tan Jay Jun
a09cda126b docs: improve testing docs 2019-07-12 15:47:55 +08:00
Tan Jay Jun
9a43b41208 fix: correct bats path in single tests 2019-07-09 17:20:48 +08:00
Jose Diaz-Gonzalez
b3341999a1 Merge pull request #3607 from dokku/herokuish-cache-purge
Purge cache using herokuish image
2019-07-05 18:25:37 -04:00
Jose Diaz-Gonzalez
69e4cd7c44 refactor: use only a single implementation for cache purging
This change moves cache clearing into the repo plugin, and standardizes on a single way of clearing the cache.
2019-07-05 17:40:20 -04:00
Jose Diaz-Gonzalez
33423a0508 feat: purge cache using herokuish image
In some cases, the cache directory may exist but there may be no app image to use for cache purging. This may be the case if the app was never deployed.

Instead of failing, we can simply use the configured herokuish image for clearing cache, as that image is the base image for anything that would have modified cache.
2019-07-05 16:07:13 -04:00
Jose Diaz-Gonzalez
39f3f598a5 feat: add extra newline for good luck 2019-07-05 15:39:35 -04:00
Jose Diaz-Gonzalez
2c5106fe32 Merge pull request #3605 from dokku/empty-ssh-key
fix: handle case where there are empty newlines in the authorized_keys file
2019-07-05 15:32:41 -04:00
Jose Diaz-Gonzalez
699719b600 fix: handle case where there are empty newlines in the authorized_keys file
Previously, an empty line would result in a failing ssh-keys:list call, or a failure to verify the file. Newlines should be ignored.
2019-07-05 10:00:52 -04:00
Jose Diaz-Gonzalez
8481ea2306 Merge pull request #3603 from dokku/remove-percent
Drop extra % sign in common.LogVerboseQuiet
2019-07-03 14:33:34 -04:00
Jose Diaz-Gonzalez
a984464931 fix: drop extra % sign in common.LogVerboseQuiet 2019-07-03 13:53:56 -04:00
Jose Diaz-Gonzalez
f3e191988d Merge pull request #3602 from alexymik/master
Create a 502 error page to automatically refresh if backend status changes
2019-07-01 17:21:56 -04:00
Alexy Mikhailichenko
c99f92e9f2 Change 500 to 502 2019-07-01 17:17:14 -04:00
Alexy Mikhailichenko
a496ae987a Remove console calls 2019-07-01 17:10:45 -04:00
Alexy Mikhailichenko
75036dfa27 Remove console calls 2019-07-01 14:24:36 -04:00
Alexy Mikhailichenko
b35235f1e9 Change 502 error page to automatically refresh if backend status changes 2019-07-01 14:14:34 -04:00
Jose Diaz-Gonzalez
eabcf84f0b Merge pull request #3600 from dokku/simple-herokuish-go-check
Refactor IsImageHerokuishBased to match shell version
2019-06-29 17:13:02 -04:00
Jose Diaz-Gonzalez
7fc8770027 feat: refactor IsImageHerokuishBased to match shell version
The shell version is faster due to not needing to create a new container.
2019-06-29 15:43:02 -04:00
Jose Diaz-Gonzalez
23d647ee51 Merge pull request #3597 from dokku/trace-tests
Allow default trace function to work
2019-06-21 11:05:58 -04:00
Jose Diaz-Gonzalez
2fd53a7a01 fix: allow default trace function to work
Also add some simple tests for the trace plugin.
2019-06-21 10:24:33 -04:00
Jose Diaz-Gonzalez
3decb8c4d3 Merge pull request #3596 from dokku/update-hooks
Add missing hooks to events plugin and plugin triggers docs
2019-06-19 13:52:56 -04:00
Jose Diaz-Gonzalez
966afcb787 chore: add missing hooks to events plugin and plugin triggers docs 2019-06-19 13:50:29 -04:00
Jose Diaz-Gonzalez
48484732a0 Release 0.17.9
# History

## 0.17.9

Install/update via the bootstrap script:

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

### Bug Fixes

- #3593: @JakeAngell Fix nginx template for https in "Connection" header

### Documentation

- #3595: @josegonzalez Drop extra help output for trace
2019-06-18 12:32:49 -04:00
Jose Diaz-Gonzalez
3e5e6b10dd Merge pull request #3595 from dokku/josegonzalez-patch-1
Drop extra help output for trace
2019-06-18 12:28:11 -04:00
Jose Diaz-Gonzalez
2d47931cc4 docs: drop extra help output for trace
Closes #3594

[ci skip]
2019-06-18 12:27:43 -04:00
Jose Diaz-Gonzalez
c13c3f8012 Merge pull request #3593 from JakeAngell/patch-1
Fix nginx template for https in "Connection" header
2019-06-18 11:38:29 -04:00
JakeAngell
4e4e256a27 Update nginx.conf.sigil 2019-06-17 21:21:10 +01:00
Jose Diaz-Gonzalez
161380d639 Release 0.17.8
# History

## 0.17.8

Install/update via the bootstrap script:

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

### Bug Fixes

- #3591: @palfrey Allow SSH keys with no ending newline

### New Features

- #3587: @josegonzalez feat: drop make and gcc as dependencies
2019-06-14 12:59:57 -05:00
Jose Diaz-Gonzalez
5f36b138fb Merge pull request #3591 from palfrey/3590-ssh-key-without-newlines
Allow SSH keys with no ending newline
2019-06-14 12:59:02 -05:00
Tom Parker-Shemilt
024fd958e8 Add no-newline SSH key test 2019-06-12 22:30:26 +01:00
Tom Parker-Shemilt
a848d92823 Allow SSH keys with no ending newline (fixes #3590) 2019-06-12 22:16:02 +01:00
Jose Diaz-Gonzalez
3696757e8f Merge pull request #3587 from dokku/drop-unused-deps
feat: drop make and gcc as dependencies
2019-06-10 18:08:16 -04:00
Jose Diaz-Gonzalez
2cabf0a21f feat: drop make and gcc as dependencies
They aren't actually used within Dokku.
2019-06-10 16:25:41 -04:00
148 changed files with 1855 additions and 780 deletions

View File

@@ -1,7 +1,8 @@
version: 2
jobs:
build:
machine: true
machine:
image: ubuntu-1604:201903-01
parallelism: 4
steps:
- checkout
@@ -12,11 +13,16 @@ jobs:
- run: |
echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup
- run: |
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to eth0
sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev eth0
if [[ "$(lsb_release -rs)" == "14.04" ]]; then
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to eth0
sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev eth0
else
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to ens4
sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev ens4
fi
- run: |
case $CIRCLE_NODE_INDEX in
0) sudo -E make -e lint go-tests ci-go-coverage ;;
0) sudo -E make -e lint-ci go-tests ci-go-coverage ;;
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
2) sudo -E make -e deploy-test-multi ;;
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
@@ -25,6 +31,11 @@ jobs:
shell: /bin/bash
command: sudo -E make -e test-ci
no_output_timeout: 60m
- run: |
if [ "${CIRCLE_NODE_INDEX}" == "0" ]; then
./tests/ci/setup.sh docker
DOKKU_SSH_PORT=3022 sudo -E make -e test-ci-docker
fi
- store_artifacts:
path: ./coverage.out
- store_artifacts:

View File

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

52
Dockerfile Normal file
View File

@@ -0,0 +1,52 @@
FROM phusion/baseimage:0.11
CMD ["/sbin/my_init"]
ARG DOKKU_TAG=0.17.7
ARG DOKKU_GID=200
ARG DOKKU_UID=200
ARG DOKKU_HOSTNAME=dokku.invalid
ARG DOKKU_SKIP_KEY_FILE=true
ARG DOKKU_VHOST_ENABLE=false
ARG DOKKU_WEB_CONFIG=false
COPY ./build/dokku.deb /tmp/dokku.deb
RUN addgroup --gid $DOKKU_GID dokku \
&& adduser --uid $DOKKU_UID --gid $DOKKU_GID --disabled-password --gecos "" "dokku"
RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \
&& echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \
&& echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \
&& echo "dokku dokku/web_config boolean $DOKKU_WEB_CONFIG" | debconf-set-selections \
&& curl -sSL https://packagecloud.io/dokku/dokku/gpgkey | apt-key add - \
&& echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ bionic main" | tee /etc/apt/sources.list.d/dokku.list \
&& apt-get update -qq \
&& apt-get install --no-install-recommends --only-upgrade -y -qq openssl openssh-server \
&& apt --no-install-recommends -qq -y install rsync /tmp/dokku.deb \
&& apt-get purge -y -q syslog-ng-core \
&& apt-get autoremove -y -q \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /tmp
COPY ./docker .
RUN \
rsync -a /tmp/ / \
&& rm -rf /tmp/* \
&& rm /etc/runit/runsvdir/default/sshd/down \
&& chown -R dokku:dokku /home/dokku/ \
&& mkdir -p /skel/etc /skel/home /skel/var/lib/dokku /var/log/services \
&& mv /etc/ssh /skel/etc/ssh \
&& mv /home/dokku /skel/home/dokku \
&& mv /var/lib/dokku/config /skel/var/lib/dokku/config \
&& mv /var/lib/dokku/data /skel/var/lib/dokku/data \
&& ln -sf /mnt/dokku/etc/ssh /etc/ssh \
&& ln -sf /mnt/dokku/home/dokku /home/dokku \
&& ln -sf /mnt/dokku/var/lib/dokku/config /var/lib/dokku/config \
&& ln -sf /mnt/dokku/var/lib/dokku/data /var/lib/dokku/data \
&& mv /etc/my_init.d/00_regen_ssh_host_keys.sh /etc/my_init.d/15_regen_ssh_host_keys \
&& rm /etc/nginx/sites-enabled/default /usr/share/nginx/html/index.html /etc/my_init.d/10_syslog-ng.init \
&& sed -i '/imklog/d' /etc/rsyslog.conf \
&& rm /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/* /var/log/nginx/*

View File

@@ -1,5 +1,117 @@
# History
## 0.18.2
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.18.2/bootstrap.sh
sudo DOKKU_TAG=v0.18.2 bash bootstrap.sh
```
### New Features
- #3645: @josegonzalez Use version in DOKKU_LIB_ROOT
- #3644: @josegonzalez Refactor temp file handling
- #3643: @josegonzalez Quiet deploy output
- #3641: @josegonzalez Pass SOURCECODE_WORK_DIR to build-buildpack triggers
- #3639: @josegonzalez Refer to upstream sshcommand package
### Documentation
- #3642: @josegonzalez Correct issue with label change in docs
- #3640: @josegonzalez Add missing popd to post-extract example
## 0.18.1
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.18.1/bootstrap.sh
sudo DOKKU_TAG=v0.18.1 bash bootstrap.sh
```
### New Features
- #3636: @josegonzalez Unify deb and rpm creation code
- #3635: @josegonzalez Upgrade herokuish to 0.5.2
## 0.18.0
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.18.0/bootstrap.sh
sudo DOKKU_TAG=v0.18.0 bash bootstrap.sh
```
### Bug Fixes
- #3627: @josegonzalez Make image removal synchronous
- #3618: @josegonzalez Ensure the dokku-retire timer is properly installed
- #3614: @alexquick Validate args for config:set and config:unset
- #3605: @josegonzalez Handle case where there are empty newlines in the authorized_keys file
- #3603: @josegonzalez Drop extra % sign in common.LogVerboseQuiet
- #3597: @josegonzalez Allow default trace function to work
### New Features
- #3628: @josegonzalez Handle file copying in a secure and reliable fashion
- #3630: @josegonzalez Fix issue where push warning on bad branch was skipped
- #3629: @josegonzalez Avoid calling the user-auth trigger where possible
- #3626: @josegonzalez Builder plugins
- #3599: @josegonzalez Scope docker-cleanup to specific app
- #3589: @michaelshobbs Allow running Dokku in Docker
- #3607: @josegonzalez Purge cache using herokuish image
- #3602: @alexymik Create a 502 error page to automatically refresh if backend status changes
- #3600: @josegonzalez Refactor IsImageHerokuishBased to match shell version
### Documentation
- #3625: @josegonzalez Remove old reference to SPONSORS.md
- #3619: @josegonzalez Cleanup plugin creation docs
- #3612: @jayjun Improve testing docs
- #3613: @Lyelt Remove all uses of proxy_set_header Connection "upgrade"
- #3596: @josegonzalez Add missing hooks to events plugin and plugin triggers docs
### Tests
- #3610: @jayjun Correct Bats path in single tests
## 0.17.9
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.9/bootstrap.sh
sudo DOKKU_TAG=v0.17.9 bash bootstrap.sh
```
### Bug Fixes
- #3593: @JakeAngell Fix nginx template for https in "Connection" header
### Documentation
- #3595: @josegonzalez Drop extra help output for trace
## 0.17.8
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.8/bootstrap.sh
sudo DOKKU_TAG=v0.17.8 bash bootstrap.sh
```
### Bug Fixes
- #3591: @palfrey Allow SSH keys with no ending newline
### New Features
- #3587: @josegonzalez feat: drop make and gcc as dependencies
## 0.17.7
Install/update via the bootstrap script:

View File

@@ -39,4 +39,4 @@
- If using a `Dockerfile`, the contents of that file
- If it exists, the contents of your `Procfile`.
- Output of failing Dokku commands after running `dokku trace:on`
(BEWARE: `trace:on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
(BEWARE: `trace:on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXX):

View File

@@ -2,7 +2,8 @@ DOKKU_VERSION ?= master
PROCFILE_VERSION ?= 0.6.0
PLUGN_VERSION ?= 0.3.2
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand
SSHCOMMAND_VERSION ?= 0.8.0
SSHCOMMAND_URL ?= https://github.com/dokku/sshcommand/releases/download/v${SSHCOMMAND_VERSION}/sshcommand_${SSHCOMMAND_VERSION}_linux_x86_64.tgz
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz
@@ -107,10 +108,11 @@ addman: help2man man-db
mandb
version:
mkdir -p ${DOKKU_LIB_ROOT}
ifeq ($(DOKKU_VERSION),master)
git describe --tags > ~dokku/VERSION 2>/dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
git describe --tags > ${DOKKU_LIB_ROOT}/VERSION 2>/dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ${DOKKU_LIB_ROOT}/VERSION
else
echo $(DOKKU_VERSION) > ~dokku/VERSION
echo $(DOKKU_VERSION) > ${DOKKU_LIB_ROOT}/STABLE_VERSION
endif
plugin-dependencies: plugn procfile-util
@@ -119,12 +121,15 @@ plugin-dependencies: plugn procfile-util
plugins: plugn procfile-util docker
sudo -E dokku plugin:install --core
dependencies: apt-update sshcommand plugn procfile-util docker help2man man-db sigil
dependencies: apt-update sshcommand plugn procfile-util docker help2man man-db sigil dos2unix
$(MAKE) -e stack
apt-update:
apt-get update -qq
dos2unix:
apt-get install -qq -y dos2unix
help2man:
apt-get install -qq -y help2man
@@ -132,8 +137,8 @@ man-db:
apt-get install -qq -y man-db
sshcommand:
wget -qO /usr/local/bin/sshcommand ${SSHCOMMAND_URL}
chmod +x /usr/local/bin/sshcommand
wget -qO /tmp/procfile-util_latest.tgz ${SSHCOMMAND_URL}
tar xzf /tmp/procfile-util_latest.tgz -C /usr/local/bin
sshcommand create dokku /usr/local/bin/dokku
procfile-util:

View File

@@ -13,8 +13,6 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen.
## Sponsors
See our list of past sponsors in the [SPONSORS](https://github.com/dokku/dokku/blob/master/SPONSORS.md) file.
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/dokku#sponsor)]
<a href="https://opencollective.com/dokku/sponsor/0/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/0/avatar.svg"></a>
@@ -98,8 +96,8 @@ A fresh VM running any of the following operating systems:
To install the latest stable release, run the following commands as a user who has access to `sudo`:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.7/bootstrap.sh
sudo DOKKU_TAG=v0.17.7 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.18.2/bootstrap.sh
sudo DOKKU_TAG=v0.18.2 bash bootstrap.sh
```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.

View File

@@ -36,7 +36,7 @@ RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \
SKIP_GO_CLEAN=true \
make version copyfiles \
&& rm -rf plugins/common/*.go plugins/common/glide* plugins/common/vendor/ \
&& make deb-dokku deb-sshcommand deb-sigil \
rpm-dokku rpm-sshcommand rpm-sigil
&& make deb-dokku deb-sigil \
rpm-dokku rpm-sigil
RUN ls -lha /tmp/

8
contrib/dokku-docker-bin.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x && DOKKU_DOCKER_ENV="--env DOKKU_TRACE=on"
DOKKU_DOCKER_CONTAINER_NAME=${DOKKU_DOCKER_CONTAINER_NAME:=dokku}
# TODO: handle cases where we need a tty
# shellcheck disable=SC2086
docker exec $DOKKU_DOCKER_ENV -i "$DOKKU_DOCKER_CONTAINER_NAME" dokku "$@"

View File

@@ -10,7 +10,7 @@ import subprocess
import sys
import threading
VERSION = 'v0.17.7'
VERSION = 'v0.18.2'
hostname = ''
try:

View File

@@ -3,7 +3,7 @@ set -eo pipefail
[[ $TRACE ]] && set -x
readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXX")"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXXXX")"
readonly DOKKU_GIT_REV="$(git rev-parse HEAD)"
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT
@@ -206,13 +206,15 @@ fn-repo-update() {
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" contrib/dokku-installer.py
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" debian/control
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" Dockerfile
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/advanced-usage/plugin-management.md
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/assets/favicons/browserconfig.xml
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/assets/favicons/manifest.json
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/assets/style.css
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/development/release-process.md
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/home.html
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/getting-started/install/docker.md
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/getting-started/installation.md
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/home.html
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/template.html
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" README.md
@@ -317,6 +319,13 @@ fn-require-bin() {
fi
}
fn-build-docker-image() {
declare desc="Builds the dokku docker image and tags it with the given version"
declare VERSION="$1"
docker build -t "dokku/dokku:$VERSION" .
docker push "dokku/dokku:$VERSION"
}
main() {
declare RELEASE="$1"
local CURRENT_VERSION NEXT_VERSION IS_RELEASE
@@ -358,12 +367,14 @@ main() {
if [[ "$RELEASE" != "build" ]]; then
fn-publish-package "$IS_RELEASE" "deb" "build/dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fn-build-docker-image "$NEXT_VERSION" || log-fail "Error building docker image"
fn-repo-push-tags "$IS_RELEASE"
fi
if [[ "$IS_RELEASE" != "true" ]]; then
git reset -q HEAD plugins/*/plugin.toml
git checkout -- plugins/*/plugin.toml
cp "build/dokku_${NEXT_VERSION}_amd64.deb" build/dokku.deb
fi
echo "build/dokku_${NEXT_VERSION}_amd64.deb" >build/deb-filename

View File

@@ -3,7 +3,7 @@ set -eo pipefail
[[ $TRACE ]] && set -x
readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXX")"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXXXX")"
readonly DOKKU_GIT_REV="$(git rev-parse HEAD)"
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT

View File

@@ -3,7 +3,7 @@ set -eo pipefail
[[ $TRACE ]] && set -x
readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXX")"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXXXX")"
readonly DOKKU_GIT_REV="$(git rev-parse HEAD)"
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT

View File

@@ -2,7 +2,7 @@
set -eo pipefail
[[ $TRACE ]] && set -x
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-plugin-release.XXXX")"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-plugin-release.XXXXXX")"
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT

42
deb.mk
View File

@@ -2,7 +2,7 @@ BUILD_DIRECTORY ?= /tmp
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
HEROKUISH_VERSION ?= 0.5.0
HEROKUISH_VERSION ?= 0.5.2
HEROKUISH_ARCHITECTURE = amd64
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
@@ -16,17 +16,6 @@ DOKKU_UPDATE_VERSION ?= 0.1.0
DOKKU_UPDATE_ARCHITECTURE = amd64
DOKKU_UPDATE_PACKAGE_NAME = dokku-update_$(DOKKU_UPDATE_VERSION)_$(DOKKU_UPDATE_ARCHITECTURE).deb
define SSHCOMMAND_DESCRIPTION
Turn SSH into a thin client specifically for your app
Simplifies running a single command over SSH, and
manages authorized keys (ACL) and users in order to do so.
endef
SSHCOMMAND_REPO_NAME ?= dokku/sshcommand
SSHCOMMAND_VERSION ?= 0.7.0
SSHCOMMAND_ARCHITECTURE = amd64
SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v$(SSHCOMMAND_VERSION)/sshcommand
define SIGIL_DESCRIPTION
Standalone string interpolator and template processor
Sigil is a command line tool for template processing
@@ -45,9 +34,8 @@ ifndef IS_RELEASE
endif
export SIGIL_DESCRIPTION
export SSHCOMMAND_DESCRIPTION
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-dokku-update deb-setup deb-sshcommand deb-sigil
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-dokku-update deb-setup deb-sigil
install-from-deb:
@echo "--> Initial apt-get update"
@@ -63,7 +51,7 @@ install-from-deb:
sudo apt-get update -qq >/dev/null
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku
deb-all: deb-setup deb-herokuish deb-dokku deb-sshcommand deb-sigil deb-dokku-update
deb-all: deb-setup deb-herokuish deb-dokku deb-sigil deb-dokku-update
mv $(BUILD_DIRECTORY)/*.deb .
@echo "Done"
@@ -129,30 +117,6 @@ deb-dokku-update:
contrib/dokku-update=/usr/local/bin/dokku-update \
contrib/dokku-update-version=/var/lib/dokku-update/VERSION
deb-sshcommand:
rm -rf /tmp/tmp /tmp/build $(SSHCOMMAND_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/local/bin
@echo "-> Downloading package"
wget -q -O /tmp/tmp/sshcommand-$(SSHCOMMAND_VERSION) $(SSHCOMMAND_URL)
@echo "-> Copying files into place"
mkdir -p "/tmp/build/usr/local/bin"
cp /tmp/tmp/sshcommand-$(SSHCOMMAND_VERSION) /tmp/build/usr/local/bin/sshcommand
chmod +x /tmp/build/usr/local/bin/sshcommand
@echo "-> Creating $(SSHCOMMAND_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n sshcommand \
--version $(SSHCOMMAND_VERSION) \
--architecture $(SSHCOMMAND_ARCHITECTURE) \
--package $(BUILD_DIRECTORY)/$(SSHCOMMAND_PACKAGE_NAME) \
--url "https://github.com/$(SSHCOMMAND_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category admin \
--description "$$SSHCOMMAND_DESCRIPTION" \
--license 'MIT License' \
.
deb-sigil:
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin

4
debian/control vendored
View File

@@ -1,9 +1,9 @@
Package: dokku
Version: 0.17.7
Version: 0.18.2
Section: web
Priority: optional
Architecture: amd64
Depends: locales, git, make, curl, gcc, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.7.1) | docker-engine (>= 1.7.1) | docker-io (>= 1.7.1) | docker.io (>= 1.7.1) | docker-ce | docker-ee, net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog
Depends: locales, git, curl, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.7.1) | docker-engine (>= 1.7.1) | docker-io (>= 1.7.1) | docker.io (>= 1.7.1) | docker-ce | docker-ee, net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog, dos2unix
Recommends: herokuish (>= 0.3.4), parallel, dokku-update
Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python2.7, debconf
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>

212
debian/postinst vendored
View File

@@ -26,6 +26,115 @@ call-sshcommand() {
fi
}
setup-user() {
echo "Setting up dokku user"
call-sshcommand create dokku /usr/bin/dokku
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
mkdir -p "$DOKKU_ROOT/.ssh" "$DOKKU_ROOT/.dokkurc"
touch "$DOKKU_ROOT/.ssh/authorized_keys"
chown -R dokku:dokku "$DOKKU_ROOT/.ssh" "${DOKKU_ROOT}/.dokkurc"
}
setup-storage() {
echo "Setting up storage directories"
mkdir -p "${DOKKU_LIB_ROOT}/data" "${DOKKU_LIB_ROOT}/data/storage"
chown dokku:dokku "${DOKKU_LIB_ROOT}/data"
}
setup-plugins() {
echo "Setting up plugin directories"
# should be replaced by `plugn init`
mkdir -p "${DOKKU_LIB_ROOT}/core-plugins/available" "${DOKKU_LIB_ROOT}/plugins/available"
mkdir -p "${DOKKU_LIB_ROOT}/core-plugins/enabled" "${DOKKU_LIB_ROOT}/plugins/enabled"
touch "${DOKKU_LIB_ROOT}/core-plugins/config.toml" "${DOKKU_LIB_ROOT}/plugins/config.toml"
echo "Migrating old plugins"
find ${DOKKU_LIB_ROOT}/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then
continue
elif [ -f ${DOKKU_LIB_ROOT}/plugins/$plugin/.core ]; then
rm -rf ${DOKKU_LIB_ROOT}/plugins/$plugin
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available
fi
done
db_get "dokku/nginx_enable"
echo "Enabling all core plugins"
find "${DOKKU_LIB_ROOT}/core-plugins/available" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
if [ "$plugin" = "nginx-vhosts" ] && [ "$RET" = "false" ]; then
echo "Skipping enable of nginx-vhosts plugin"
continue
elif [ ! -d "${DOKKU_LIB_ROOT}/plugins/available/$plugin" ]; then
ln -s "${DOKKU_LIB_ROOT}/core-plugins/available/$plugin" "${DOKKU_LIB_ROOT}/plugins/available/$plugin"
PLUGIN_PATH="${DOKKU_LIB_ROOT}/core-plugins" plugn enable "$plugin"
PLUGIN_PATH="${DOKKU_LIB_ROOT}/plugins" plugn enable "$plugin"
fi
done
find -L "${DOKKU_LIB_ROOT}" -type l -delete
chown dokku:dokku -R "${DOKKU_LIB_ROOT}/plugins" "${DOKKU_LIB_ROOT}/core-plugins"
echo "Install all core plugins"
dokku plugin:install --core
}
setup-sshcommand() {
echo "Ensure proper sshcommand path"
echo '/usr/bin/dokku' >"${DOKKU_ROOT}/.sshcommand"
if [[ -f .ssh/authorized_keys ]]; then
sed -i.bak 's#/usr/local/bin/dokku#/usr/bin/dokku#' "${DOKKU_ROOT}/.ssh/authorized_keys"
rm "${DOKKU_ROOT}/.ssh/authorized_keys"
fi
}
setup-dokku-installer() {
if [[ -f /etc/nginx/conf.d/dokku-installer.conf ]]; then
echo "Setting up dokku-installer"
/usr/share/dokku/contrib/dokku-installer.py onboot
if command -v systemctl &>/dev/null; then
echo "Enabling dokku-installer"
systemctl enable dokku-installer
fi
installer_status="$(service dokku-installer status 2>/dev/null || true)"
if echo $installer_status | grep -Eq "(inactive|waiting)" >/dev/null; then
echo "Starting dokku-installer"
service dokku-installer start || echo "Unable to start dokku-installer"
fi
fi
}
dpkg-handling() {
db_get "dokku/web_config"
if [ "$RET" = "true" ]; then
db_stop
exit 0
fi
if [ -f "${DOKKU_ROOT}/VHOST" ]; then
echo "VHOST file detected, skipping modification"
else
db_get "dokku/vhost_enable"
if [ "$RET" = "true" ]; then
db_get "dokku/hostname"
echo "Setting VHOST contents to $RET"
echo "$RET" >"${DOKKU_ROOT}/VHOST"
fi
fi
db_get "dokku/hostname"
echo "$RET" >"${DOKKU_ROOT}/HOSTNAME"
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/key_file"
if [ -f "$RET" ]; then
call-sshcommand acl-add dokku default <"$RET" || true
fi
fi
}
case "$1" in
abort-upgrade | abort-remove | abort-deconfigure) ;;
@@ -33,103 +142,16 @@ case "$1" in
configure)
mandb
[ ! -x /usr/bin/docker.io ] || ln -sf /usr/bin/docker.io /usr/local/bin/docker
modprobe aufs || echo "WARNING: Restart server to finish installing dokku!"
call-sshcommand create dokku /usr/bin/dokku
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
echo "Setting up storage directories"
mkdir -p ${DOKKU_LIB_ROOT}/data ${DOKKU_LIB_ROOT}/data/storage
chown dokku:dokku ${DOKKU_LIB_ROOT}/data ${DOKKU_LIB_ROOT}/data/storage
echo "Setting up plugin directories"
# should be replaced by `plugn init`
mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/available ${DOKKU_LIB_ROOT}/plugins/available
mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/enabled ${DOKKU_LIB_ROOT}/plugins/enabled
touch ${DOKKU_LIB_ROOT}/core-plugins/config.toml ${DOKKU_LIB_ROOT}/plugins/config.toml
echo "Migrating old plugins"
find ${DOKKU_LIB_ROOT}/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then
continue
elif [ -f ${DOKKU_LIB_ROOT}/plugins/$plugin/.core ]; then
rm -rf ${DOKKU_LIB_ROOT}/plugins/$plugin
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available
fi
done
db_get "dokku/nginx_enable"
echo "Enabling all core plugins"
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
if [ "$plugin" = "nginx-vhosts" ] && [ "$RET" = "false" ]; then
echo "Skipping enable of nginx-vhosts plugin"
continue
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
fi
done
find -L ${DOKKU_LIB_ROOT} -type l -delete
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
echo "Ensure proper sshcommand path"
echo '/usr/bin/dokku' >"${DOKKU_ROOT}/.sshcommand"
if [[ -f .ssh/authorized_keys ]]; then
sed -i.bak 's#/usr/local/bin/dokku#/usr/bin/dokku#' "${DOKKU_ROOT}/.ssh/authorized_keys"
rm "${DOKKU_ROOT}/.ssh/authorized_keys"
if [[ -f /sbin/modprobe ]]; then
modprobe aufs || echo "WARNING: Restart server to finish installing dokku!"
fi
echo "Install all core plugins"
dokku plugin:install --core
rm -f ${DOKKU_ROOT}/VERSION
cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION
if [[ -f /etc/nginx/conf.d/dokku-installer.conf ]]; then
echo "Setting up dokku-installer"
/usr/share/dokku/contrib/dokku-installer.py onboot
if command -v systemctl &>/dev/null; then
echo "Enabling dokku-installer"
systemctl enable dokku-installer
fi
installer_status="$(service dokku-installer status 2>/dev/null || true)"
if echo $installer_status | grep -Eq "(inactive|waiting)" >/dev/null; then
echo "Starting dokku-installer"
service dokku-installer start || echo "Unable to start dokku-installer"
fi
fi
db_get "dokku/web_config"
if [ "$RET" = "true" ]; then
db_stop
exit 0
fi
if [ -f "${DOKKU_ROOT}/VHOST" ]; then
echo "VHOST file detected, skipping modification"
else
db_get "dokku/vhost_enable"
if [ "$RET" = "true" ]; then
db_get "dokku/hostname"
echo "Setting VHOST contents to $RET"
echo "$RET" >"${DOKKU_ROOT}/VHOST"
fi
fi
db_get "dokku/hostname"
echo "$RET" >"${DOKKU_ROOT}/HOSTNAME"
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/key_file"
if [ -f "$RET" ]; then
call-sshcommand acl-add dokku default <"$RET" || true
fi
fi
setup-user
setup-storage
setup-plugins
setup-sshcommand
setup-dokku-installer
dpkg-handling
;;
*)

View File

@@ -0,0 +1,4 @@
PATH=/usr/local/bin:/usr/bin:/bin
SHELL=/bin/bash
*/5 * * * * root /usr/bin/dokku ps:retire >> /var/log/dokku/retire.log 2>&1

View File

@@ -0,0 +1,9 @@
/var/log/services/* {
daily
missingok
rotate 7
compress
delaycompress
notifempty
copytruncate
}

View File

@@ -0,0 +1,62 @@
#!/bin/bash
set -eo pipefail
log-info() {
declare desc="Log info formatter"
echo " $*" 1>&2
}
log-fail() {
declare desc="Log fail formatter"
echo "! $*" 1>&2
exit 1
}
main() {
if [[ ! -d /mnt/dokku ]]; then
log-info "Creating missing /mnt/dokku"
mkdir -p /mnt/dokku
fi
directories=("/etc/ssh" "/home/dokku" "/var/lib/dokku/config" "/var/lib/dokku/data")
for dir in "${directories[@]}"; do
if [[ ! -e "$dir" ]]; then
log-info "Copying ${dir} skel into place"
mkdir -p "/mnt/dokku${dir}"
rsync -a "/skel${dir}/" "${dir}/" || log-fail "Unable to copy ${dir} skel into place"
fi
# chown mount directories to "dokku:dokku"
if [[ "$dir" != "/etc/ssh" ]]; then
find "$dir" -print0 | xargs -0 chown -h dokku:dokku
fi
done
if [[ -f /mnt/dokku/plugin-list ]]; then
while read line; do
dokku plugin:install "$(echo "$line" | awk '{print $2}')" "$(echo "$line" | cut -d':' -f1)"
done </mnt/dokku/plugin-list
fi
if [[ -n "$DOKKU_HOSTNAME" ]]; then
echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections
echo "dokku dokku/vhost_enable boolean true" | debconf-set-selections
dokku --quiet domains:set-global "$DOKKU_HOSTNAME"
fi
if [[ -x /usr/local/bin/docker ]]; then
mkdir -p /home/dokku/.dokkurc
echo "export DOCKER_BIN=/usr/local/bin/docker" >"/home/dokku/.dokkurc/DOCKER_BIN"
fi
if [[ ! -f /mnt/dokku/etc/nginx/dhparam.pem ]]; then
mkdir -p /mnt/dokku/etc/nginx
openssl dhparam -out /mnt/dokku/etc/nginx/dhparam.pem 2048
fi
cp -f /mnt/dokku/etc/nginx/dhparam.pem /etc/nginx/dhparam.pem
chown root:root /etc/nginx/dhparam.pem
chown root:root /etc/nginx/conf.d
}
main "$@"

View File

@@ -0,0 +1,15 @@
#!/bin/bash
exec >>/var/log/services/dokku-restore
exec 2>&1
if [[ "$1" -ne 0 ]]; then
echo "Error restoring dokku apps! Retrying in 30 seconds..."
exec sleep 30
exit 0
fi
echo "Done restoring dokku apps."
exec sleep infinity
exit 0

View File

@@ -0,0 +1,9 @@
#!/bin/bash
exec >>/var/log/services/dokku-restore
exec 2>&1
echo "Running dokku-restore"
cd /tmp || exit 1
exec dokku ps:restore

View File

@@ -0,0 +1,7 @@
#!/bin/bash
exec >>/var/log/services/nginx
exec 2>&1
echo "Running nginx"
exec /usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;"

View File

@@ -0,0 +1,7 @@
#!/bin/bash
exec >>/var/log/services/rsyslog
exec 2>&1
echo "Running rsyslog"
exec /usr/sbin/rsyslogd -n

View File

@@ -0,0 +1 @@
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker

20
docker/usr/local/bin/docker Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $TRACE ]] && set -x
main() {
declare desc="re-runs docker commands as sudo"
local DOCKER_BIN=""
if [[ -x "/usr/bin/docker" ]]; then
DOCKER_BIN="/usr/bin/docker"
fi
if [[ -z "$DOCKER_BIN" ]]; then
echo "! No docker binary found" 1>&2
exit 1
fi
sudo -E "$DOCKER_BIN" "$@"
}
main "$@"

View File

@@ -32,35 +32,35 @@ dokku plugin:list
```
plugn: dev
00_dokku-standard 0.17.7 enabled dokku core standard plugin
20_events 0.17.7 enabled dokku core events logging plugin
app-json 0.17.7 enabled dokku core app-json plugin
apps 0.17.7 enabled dokku core apps plugin
build-env 0.17.7 enabled dokku core build-env plugin
buildpacks 0.17.7 enabled dokku core buildpacks plugin
certs 0.17.7 enabled dokku core certificate management plugin
checks 0.17.7 enabled dokku core checks plugin
common 0.17.7 enabled dokku core common plugin
config 0.17.7 enabled dokku core config plugin
docker-options 0.17.7 enabled dokku core docker-options plugin
domains 0.17.7 enabled dokku core domains plugin
enter 0.17.7 enabled dokku core enter plugin
git 0.17.7 enabled dokku core git plugin
logs 0.17.7 enabled dokku core logs plugin
network 0.17.7 enabled dokku core network plugin
nginx-vhosts 0.17.7 enabled dokku core nginx-vhosts plugin
plugin 0.17.7 enabled dokku core plugin plugin
proxy 0.17.7 enabled dokku core proxy plugin
ps 0.17.7 enabled dokku core ps plugin
repo 0.17.7 enabled dokku core repo plugin
resource 0.17.7 enabled dokku core resource plugin
scheduler-docker-local 0.17.7 enabled dokku core scheduler-docker-local plugin
shell 0.17.7 enabled dokku core shell plugin
ssh-keys 0.17.7 enabled dokku core ssh-keys plugin
storage 0.17.7 enabled dokku core storage plugin
tags 0.17.7 enabled dokku core tags plugin
tar 0.17.7 enabled dokku core tar plugin
trace 0.17.7 enabled dokku core trace plugin
00_dokku-standard 0.18.2 enabled dokku core standard plugin
20_events 0.18.2 enabled dokku core events logging plugin
app-json 0.18.2 enabled dokku core app-json plugin
apps 0.18.2 enabled dokku core apps plugin
build-env 0.18.2 enabled dokku core build-env plugin
buildpacks 0.18.2 enabled dokku core buildpacks plugin
certs 0.18.2 enabled dokku core certificate management plugin
checks 0.18.2 enabled dokku core checks plugin
common 0.18.2 enabled dokku core common plugin
config 0.18.2 enabled dokku core config plugin
docker-options 0.18.2 enabled dokku core docker-options plugin
domains 0.18.2 enabled dokku core domains plugin
enter 0.18.2 enabled dokku core enter plugin
git 0.18.2 enabled dokku core git plugin
logs 0.18.2 enabled dokku core logs plugin
network 0.18.2 enabled dokku core network plugin
nginx-vhosts 0.18.2 enabled dokku core nginx-vhosts plugin
plugin 0.18.2 enabled dokku core plugin plugin
proxy 0.18.2 enabled dokku core proxy plugin
ps 0.18.2 enabled dokku core ps plugin
repo 0.18.2 enabled dokku core repo plugin
resource 0.18.2 enabled dokku core resource plugin
scheduler-docker-local 0.18.2 enabled dokku core scheduler-docker-local plugin
shell 0.18.2 enabled dokku core shell plugin
ssh-keys 0.18.2 enabled dokku core ssh-keys plugin
storage 0.18.2 enabled dokku core storage plugin
tags 0.18.2 enabled dokku core tags plugin
tar 0.18.2 enabled dokku core tar plugin
trace 0.18.2 enabled dokku core trace plugin
```
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.

View File

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

View File

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

View File

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

View File

@@ -14,6 +14,7 @@
"0.14.6",
"0.15.5",
"0.16.4",
"0.17.7"
"0.17.9",
"0.18.2"
]
}

View File

@@ -139,7 +139,7 @@ server {
proxy_pass http://{{ .APP }};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Connection $http_connection;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;

View File

@@ -2,56 +2,250 @@
A plugin can be a simple implementation of [triggers](/docs/development/plugin-triggers.md) or can implement a command structure of its own. Dokku has no restrictions on the language in which a plugin is implemented; it only cares that the plugin implements the appropriate [commands](/docs/development/plugin-creation.md#command-api) or [triggers](/docs/development/plugin-triggers.md) for the API. **NOTE:** any file that implements triggers or uses the command API must be executable.
If you create your own plugin:
When creating custom plugins:
1. Take a look at [the plugins shipped with Dokku](/docs/community/plugins.md) and hack away!
2. Check out the [list of triggers](/docs/development/plugin-triggers.md) your plugin can implement
3. Upload your plugin to GitHub with a repository name following the `dokku-<name>` convention (e.g. `dokku-mariadb`)
4. Edit [this page](/docs/community/plugins.md) and add a link to your plugin
2. Check out the [list of triggers](/docs/development/plugin-triggers.md) the plugin can implement
3. Upload the plugin to GitHub with a repository name following the `dokku-<name>` convention (e.g. `dokku-mariadb`)
4. Edit [this page](/docs/community/plugins.md) and add a link to the plugin
5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases
## Compilable plugins (Golang, Java(?), C, etc.)
When developing a plugin, you must implement the `install` trigger such that it outputs the built executable(s) using a directory structure that implements the plugin's desired command and/or triggers the API. See the [smoke-test-plugin](https://github.com/dokku/smoke-test-plugin) for an example.
When developing a plugin, the `install` trigger must be implemented such that it outputs the built executable(s) using a directory structure that implements the plugin's desired command and/or triggers the API. See the [smoke-test-plugin](https://github.com/dokku/smoke-test-plugin) for an example.
## Command API
There are 3 main integration points: `commands`, `subcommands/default`, and `subcommands/<command-name>`.
### `commands`
Primarily used to supply the plugin's usage/help output. (i.e. [plugin help](https://github.com/dokku/dokku/tree/master/plugins/plugin/commands)).
### `subcommands/default`
Implements the plugin's default command behavior. (i.e. [`dokku plugin`](https://github.com/dokku/dokku/tree/master/plugins/plugin/subcommands/default)).
### `subcommands/<command-name>`
Implements the additional command interface and will translate to `dokku plugin:cmd` on the command line. (i.e. [`dokku plugin:install`](https://github.com/dokku/dokku/tree/master/plugins/plugin/subcommands/install)).
# Plugin Building Tips
## Always create a `plugin.toml`
The `plugin.toml` file is used to describe the plugin in help output, and helps users understand the purpose of the plugin. This _must_ have a description and a version. The version _should_ be bumped at every plugin release.
```toml
[plugin]
description = "dokku example plugin"
version = "0.1.0"
[plugin.config]
```
## Files should be executable
Commands, subcommands, triggers and source shell scripts should all be executable. On a Unix-like machine, the following command can be used to make them executable:
```shell
chmod +x path/to/file
```
Non-executable commands, subcommands, and triggers will be ignored.
## Use the `pipefail` bash option
Consider whether to include the `set -eo pipefail` option. Look at the following example:
```shell
IMAGE=$(docker images | grep "user/repo" | awk '{print $3}')
if [[ -z $IMAGE ]]; then
dokku_log_fail "user/repo image not found... Did you run 'dokku plugin:install'?"
fi
```
If `user/repo` doesn't exist, Dokku exits just before the `awk` command and the `dokku_log_fail` message will never go to `STDOUT`. printed with echo. The `set -e` option should be used in this case.
Here is the `help` entry for `set`:
```
help set
Options:
-e Exit immediately if a command exits with a non-zero status.
-o option-name
pipefail the return value of a pipeline is the status of
the last command to exit with a non-zero status,
or zero if no command exited with a non-zero status
```
## Support trace mode
Trace mode is useful for getting debugging output from plugins when the `--trace` flag is specified or `dokku trace:on` is triggered. This should be done at the top of each shell script:
```shell
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
```
In the above example, the third line enables bash's debug mode, which prints command traces before executing command.
## Verify the existence of dependencies
If a plugin depends on a specific command-line tool, check whether that tool exists before utilizing it. Either `command -v` or `which` may be used to do so:
```shell
# `command -v` example
if ! command -v "nginx" &>/dev/null; then
log-fail "Missing nginx, install it"
fi
# `which` example
if ! which nginx >/dev/null 2>&1; then
log-fail "Missing nginx, install it"
fi
```
In cases where a dependency should be installed before the plugin can be used at all, use the `dependencies` plugin trigger to install the dependency.
## Implement a help command
For plugins which expose commands, implement a `help` command. This may be empty, but should contain a listing of all available commands.
Commas - `,` - are used in the help output for columnizing output. Verify that the plugin conforms to the spec by running `dokku help --all` and manually verifying the output.
See the sample plugin below for an example.
## Namespace commands
All commands *should* be namespaced. In cases where a core plugin is overriden, the plugin _may_ utilize the a namespace in use by the core, but generally this should be avoided to reduce confusion as to where the command is implemented.
## Implement a proper catch-all command
As of 0.3.3, a catch-all should be implemented that exits with a `DOKKU_NOT_IMPLEMENTED_EXIT` code. This allows Dokku to output a `command not found` message.
See the sample plugin below for an example.
## Set app config without restarting
In the case that a plugin needs to set app configuration settings and a restart should be avoided (default Heroku-style behavior) these "internal" commands provide this functionality:
```shell
config_set --no-restart node-js-app KEY1=VALUE1 [KEY2=VALUE2 ...]
config_unset --no-restart node-js-app KEY1 [KEY2 ...]
```
## Expose functionality in a `functions` file
To allow other plugins access to (some of) a plugin's functionality, functions can expose by including a `functions` file in the plugin for others to source. All functions in that file should be considered publicly accessible by other plugins.
Any functions that must be kept private should reside in the plugin's `trigger/` or `commands/` directories. Other files may also be used to hide private functions; the official convention for hiding private functions is to place them an `internal-functions` file.
## Use helper functions to fetch app images
> New as of 0.4.0
Dokku allows image tagging and deployment of tagged images. This means hard-coding the `$IMAGE` as `dokku/$APP` is no longer sufficient.
Plugins should use `get_running_image_tag()` and `get_app_image_name()` as sourced from `common/functions`. See the [plugin triggers](/docs/development/plugin-triggers.md) doc for examples.
> **Note:** This is only for plugins that are not `pre/post-build-*` plugins
## Use `$DOCKER_BIN` instead of `docker` directly
> New as of 0.17.5
Certain systems may require a wrapper function around the `docker` binary for proper execution. Utilizing the `$DOCKER_BIN` environment variable when calling docker for those functions is preferred.
```shell
# good
"$DOCKER_BIN" run -d $IMAGE /bin/bash -e -c "$COMMAND"
# bad
docker run -d $IMAGE /bin/bash -e -c "$COMMAND"
```
## Include labels for all temporary containers and images
> New as of 0.5.0
As of 0.5.0, labels are used to help cleanup intermediate containers with `dokku cleanup`. Plugins that create containers and images should add the correct labels to the `build`, `commit`, and `run` docker commands.
Note that where possible, a label `com.dokku.app-name=$APP` - where `$APP` is the name of the app - should also be included. This enables `dokku cleanup APP` to cleanup the specific containers for a given app.
```shell
# `docker build` example
"$DOCKER_BIN" build "--label=com.dokku.app-name=${APP}" $DOKKU_GLOBAL_BUILD_ARGS ...
# `docker commit` example
# Note that the arguments must be set as a local array
# as arrays cannot be exported in shell
local DOKKU_COMMIT_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL $DOKKU_CONTAINER_LABEL=")
"$DOCKER_BIN" commit --change "LABEL com.dokku.app-name=$APP" "${DOKKU_COMMIT_ARGS[@]}" ...
# `docker run` example
"$DOCKER_BIN" run "--label=com.dokku.app-name=${APP}" $DOKKU_GLOBAL_RUN_ARGS ...
```
## Copy files from the built image using `copy_from_image`
Avoid copying files from running containers as these files may change over time. Instead copy files from the image built during the deploy process. This can be done via the `copy_from_image` helper function. This will correctly handle various corner cases in copying files from an image.
```shell
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
local TMP_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_FILE' >/dev/null" RETURN INT TERM
local IMAGE_TAG="$(get_running_image_tag "$APP")"
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
copy_from_image "$IMAGE" "file-being-copied" "$TMP_FILE" 2>/dev/null
```
Files are copied from the `/app` directory - for images built via buildpacks - or `WORKDIR` - for images built via Dockerfile.
## Avoid calling the `dokku` binary directly
> New as of 0.6.0
Plugins should **not** call the `dokku` binary directly from within plugins because clients using the `--app` argument are potentially broken when doing so.
Plugins should instead source the `functions` file for a given plugin when attempting to call Dokku internal functions.
# Sample plugin
The below plugin is a dummy `dokku hello` plugin.
Each plugin requires a `plugin.toml` descriptor file with the following required fields:
```toml
[plugin]
description = "dokku hello plugin"
version = "0.1.0"
[plugin.config]
```
`hello/subcommands/default`
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
hello_main_cmd() {
declare desc="prints Hello \$APP"
local cmd="hello"
declare cmd="hello" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
# Support --app/$DOKKU_APP_NAME flag
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
[[ -n $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@
##
#
declare APP="$1"
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2"
local APP="$2";
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$APP"
echo "Hello $APP"
}
@@ -63,23 +257,14 @@ hello_main_cmd "$@"
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
hello_world_cmd() {
declare desc="prints Hello World"
local cmd="hello:world"
# Support --app/$DOKKU_APP_NAME flag
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@")
declare desc="prints Hello world"
declare cmd="hello:world" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
[[ -n $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@
##
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2"
local APP="$2";
echo "Hello world"
}
@@ -91,7 +276,8 @@ hello_world_cmd "$@"
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
case "$1" in
help | hello:help)
@@ -126,58 +312,3 @@ help_content
esac
```
Each plugin requires a `plugin.toml` descriptor file with the following required fields:
```toml
[plugin]
description = "dokku hello plugin"
version = "0.1.0"
[plugin.config]
```
# A few notes:
- Remember to `chmod +x` your executable files
- Always support `DOKKU_TRACE` as per the 2nd line of the above example
- If your command depends on an application, include a check for whether that application exists (see the above example)
- You must implement a `help` command, though you may leave it empty. Also, you must use commas (`,`) in the command syntax to support output in columns
- Commands **should** be namespaced
- As of 0.3.3, a catch-all should be implemented that exits with a `DOKKU_NOT_IMPLEMENTED_EXIT` code. This allows Dokku to output a `command not found` message.
- Consider whether you want to include the `set -eo pipefail` option. Look at the following example :
```shell
IMAGE=$(docker images | grep "user/repo" | awk '{print $3}')
if [[ -z $IMAGE ]]; then
dokku_log_fail "user/repo image not found... Did you run 'dokku plugin:install'?"
fi
```
If `user/repo` doesn't exist, Dokku exits just before the `awk` command and the `dokku_log_fail` message will never go to `STDOUT`. printed with echo. You would want to use `set -e` in this case.
Here is the `help` entry for `set`:
```
help set
Options:
-e Exit immediately if a command exits with a non-zero status.
-o option-name
pipefail the return value of a pipeline is the status of
the last command to exit with a non-zero status,
or zero if no command exited with a non-zero status
```
- In the case that your plugin needs to set application configuration settings and you want to avoid having to restart (default Heroku-style behavior) these "internal" commands provide this functionality:
```shell
dokku config:set --no-restart node-js-app KEY1=VALUE1 [KEY2=VALUE2 ...]
dokku config:unset --no-restart node-js-app KEY1 [KEY2 ...]
```
- If you want to allow other plugins access to (some of) your plugin's functionality, you can expose this by including a `functions` file in your plugin for others to source
- You should consider all functions in that file to be publicly accessible by other plugins
- Any functions you want to keep private should reside in your plugin's `trigger/` or `commands/` directories
- As of 0.4.0, Dokku allows image tagging and deployment of tagged images
- This means hard-coding the `$IMAGE` as `dokku/$APP` is no longer sufficient
- You should now use `get_running_image_tag()` and `get_app_image_name()` as sourced from `common/functions` (see the [plugin triggers](/docs/development/plugin-triggers.md) doc for examples). **Note:** This is only for plugins that are not `pre/post-build-*` plugins
- As of 0.5.0, we use container labels to help cleanup intermediate containers with `dokku cleanup
- This means that if you manually call `docker run`, you should include `$DOKKU_GLOBAL_RUN_ARGS` to ensure your intermediate containers are labeled correctly
- As of 0.6.0, you should not **not** call the `dokku` binary directly from within plugins because clients using the `--app` argument are potentially broken when doing so (as well as other issues)
- You should instead source the `functions` file for a given plugin when attempting to call Dokku internal functions

View File

@@ -29,6 +29,21 @@ The following plugin triggers describe those available to a Dokku installation.
> The example plugin trigger code is not guaranteed to be implemented as in within dokku, and are merely simplified examples. Please look at the Dokku source for larger, more in-depth examples.
### `app-restart`
- Description: Triggers an app restart
- Invoked by: `dokku config:clear`, `dokku config:set`, `dokku config:unset`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `app-urls`
- Description: Allows you to change the urls Dokku reports for an application. Will override any auto-detected urls.
@@ -53,6 +68,66 @@ case "$URL_TYPE" in
esac
```
### `builder-build`
- Description: Triggers the artifact build process
- Invoked by: `dokku deploy`
- Arguments: `$BUILDER_TYPE` `$APP` `$SOURCECODE_WORK_DIR`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `builder-create-dokku-image`
- Description: Allows modification of the configured dokku-image
- Invoked by: `dokku deploy`
- Arguments: `$BUILDER_TYPE` `$APP` `$SOURCECODE_WORK_DIR` `$DOKKU_IMAGE`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `builder-dokku-image`
- Description: Allows modification of the used dokku-image.
- Invoked by: `dokku deploy`
- Arguments: `$BUILDER_TYPE` `$APP` `$SOURCECODE_WORK_DIR` `$DOKKU_IMAGE`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `builder-release`
- Description: Triggers the artifact release process
- Invoked by: `dokku deploy`
- Arguments: `$BUILDER_TYPE` `$APP` `$IMAGE_TAG`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `check-deploy`
- Description: Allows you to run checks on a deploy before Dokku allows the container to handle requests.
@@ -291,26 +366,6 @@ verify_app_name "$APP"
# TODO
```
### `docker-args-run`
> Warning: Deprecated, please use `docker-args-process-run` instead
- Description:
- Invoked by: `dokku run`
- Arguments: `$APP $IMAGE_TAG`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
# TODO
```
### `docker-args-process-build`
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options.
@@ -365,6 +420,26 @@ verify_app_name "$APP"
# TODO
```
### `docker-args-run`
> Warning: Deprecated, please use `docker-args-process-run` instead
- Description:
- Invoked by: `dokku run`
- Arguments: `$APP $IMAGE_TAG`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
# TODO
```
### `git-post-pull`
- Description:
@@ -670,7 +745,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
- Description: Allows you to run commands after the build image is create for a given app. Only applies to apps using buildpacks.
- Invoked by: `internal function dokku_build() (build phase)`
- Arguments: `$APP`
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
- Example:
```shell
@@ -840,6 +915,7 @@ REV="$3" # optional, may not be sent for tar-based builds
pushd "$TMP_WORK_DIR" >/dev/null
touch Procfile
echo "clock: some-command" >> Procfile
popd >/dev/null
```
### `post-proxy-ports-update`
@@ -884,9 +960,10 @@ CMD="cat > gm && \
dpkg -s CONTAINER_PACKAGE >/dev/null 2>&1 || \
(apt-get update && apt-get install -y CONTAINER_PACKAGE && apt-get clean)"
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE >/dev/null
CID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
test $(docker wait $CID) -eq 0
DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
docker commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" $CID $IMAGE >/dev/null
```
### `post-release-dockerfile`
@@ -929,7 +1006,7 @@ dokku config:set --no-restart $APP MANUALLY_STOPPED=1
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using buildpacks.
- Invoked by: `internal function dokku_build() (build phase)`
- Arguments: `$APP`
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
- Example:
```shell
@@ -973,7 +1050,7 @@ APP="$1"; GULP_CACHE_DIR="$DOKKU_ROOT/$APP/gulp"; IMAGE=$(get_app_image_name $AP
verify_app_name "$APP"
if [[ -d $GULP_CACHE_DIR ]]; then
docker run $DOKKU_GLOBAL_RUN_ARGS --rm -v "$GULP_CACHE_DIR:/gulp" "$IMAGE" find /gulp -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
docker run "${DOCKER_COMMIT_LABEL_ARGS[@]}" --rm -v "$GULP_CACHE_DIR:/gulp" "$IMAGE" find /gulp -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
fi
```
@@ -994,10 +1071,10 @@ APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
dokku_log_info1 "Running gulp"
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $IMAGE /bin/bash -c "cd /app && gulp default")
test $(docker wait $id) -eq 0
docker commit $id $IMAGE >/dev/null
dokku_log_info1 "Building UI Complete"
CID=$(docker run "${DOCKER_COMMIT_LABEL_ARGS[@]}" -d $IMAGE /bin/bash -c "cd /app && gulp default")
test $(docker wait $CID) -eq 0
DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
docker commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" $CID $IMAGE >/dev/null
```
### `pre-disable-vhost`
@@ -1075,9 +1152,10 @@ CMD="cat > gm && \
dpkg -s graphicsmagick >/dev/null 2>&1 || \
(apt-get update && apt-get install -y graphicsmagick && apt-get clean)"
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE >/dev/null
CID=$(docker run "${DOCKER_COMMIT_LABEL_ARGS[@]}" -i -a stdin $IMAGE /bin/bash -c "$CMD")
DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
test $(docker wait $CID) -eq 0
docker commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" $CID $IMAGE >/dev/null
```
### `pre-release-dockerfile`
@@ -1162,9 +1240,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `proxy-enable`
### `proxy-disable`
- Description: Enables the configured proxy implementation for an app
- Description: Disables the configured proxy implementation for an app
- Invoked by: `internally triggered by ps:restore`
- Arguments: `$APP`
- Example:
@@ -1177,9 +1255,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `proxy-disable`
### `proxy-enable`
- Description: Disables the configured proxy implementation for an app
- Description: Enables the configured proxy implementation for an app
- Invoked by: `internally triggered by ps:restore`
- Arguments: `$APP`
- Example:
@@ -1234,6 +1312,22 @@ fi
plugn trigger receive-app $APP $newrev
```
### `report`
- Description: Allows you to report on any custom configuration in use by your application
- Invoked by: `dokku report`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1";
# TODO
```
### `resource-get-property`
- Description: Fetches a given resource property value
@@ -1267,18 +1361,21 @@ APP="$1"; HOSTNAME=$(hostname -s)
mail -s "$APP containers on $HOSTNAME failed to retire" ops@dokku.me
```
### `report`
### `scheduler-app-status`
- Description: Allows you to report on any custom configuration in use by your application
- Invoked by: `dokku report`
- Arguments: `$APP`
> Warning: The scheduler plugin trigger apis are under development and may change
> between minor releases until the 1.0 release.
- Description: Fetch the status of an app
- Invoked by: `dokku ps:report`
- Arguments: `$DOKKU_SCHEDULER $APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1";
DOKKU_SCHEDULER="$1"; APP="$2";
# TODO
```
@@ -1396,6 +1493,25 @@ DOKKU_SCHEDULER="$1"; APP="$2";
# TODO
```
### `scheduler-post-delete`
> Warning: The scheduler plugin trigger apis are under development and may change
> between minor releases until the 1.0 release.
- Description: Allows you to run scheduler commands when an app is deleted
- Invoked by: `dokku apps:destroy`
- Arguments: `$DOKKU_SCHEDULER $APP $IMAGE_TAG`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
DOKKU_SCHEDULER="$1"; APP="$2"; IMAGE_TAG="$3";
# TODO
```
### `scheduler-retire`
> Warning: The scheduler plugin trigger apis are under development and may change

View File

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

View File

@@ -1,6 +1,6 @@
# Dokku test suite
# Running Tests
Dokku has a full test suite to assist in quick iterating development. These tests include a linter using [shellcheck](https://github.com/koalaman/shellcheck), functional unit tests using the [bats testing framework](https://github.com/sstephenson/bats), and a deployment suite of example apps that use the most popular languages and frameworks.
Dokku has a full test suite to assist in quick iterating development. These tests include a linter using [shellcheck](https://github.com/koalaman/shellcheck), functional unit tests using the [Bats testing framework](https://github.com/bats-core/bats-core), and a deployment suite of example apps that use the most popular languages and frameworks.
We maintain the Dokku test harness within the `tests` directory:
@@ -11,13 +11,13 @@ We maintain the Dokku test harness within the `tests` directory:
All pull requests have tests run against them on [CircleCI](https://circleci.com/), a continuous integration platform that provides Docker support for Ubuntu Trusty 14.04.
If you wish to skip tests for a particular commit - e.g. Documentation changes - you may add the `[ci skip]` designator to your commit message. Commits that *should* be tested but have the above designator will not be merged.
If you wish to skip tests for a particular commit, e.g. documentation changes, you may add the `[ci skip]` designator to your commit message. Commits that _should_ be tested but have the above designator will not be merged.
While we do provide official packages for a variety of platforms, as our test suite currently runs on Ubuntu Trusty 14.04, we only provide official installation support for that platform.
## Local Test Execution
- Setup Dokku in a [vagrant vm](/docs/getting-started/install/vagrant.md)
- Setup Dokku in a [Vagrant VM](/docs/getting-started/install/vagrant.md).
- Run the following to setup tests and execute them:
```shell
@@ -29,11 +29,8 @@ While we do provide official packages for a variety of platforms, as our test su
# execute the entire test suite (linter, bats tests, and app deployment tests)
make test
# run linter & update vagrant Dokku install from local git clone
make lint copyfiles
# build a specific plugin
make go-build-plugin copyplugin PLUGIN_NAME=apps
# run linter
make lint
# execute all bats tests
make unit-tests
@@ -42,6 +39,16 @@ While we do provide official packages for a variety of platforms, as our test su
make deploy-tests
```
After making changes to your local Dokku clone, don't forget to update the Vagrant Dokku install.
```shell
# update vagrant dokku install from local git clone
make copyfiles
# build a specific plugin
make go-build-plugin copyplugin PLUGIN_NAME=apps
```
Additionally you may run a specific app deployment tests with a target similar to:
```shell
@@ -66,7 +73,7 @@ bats tests/unit/10_apps.bats tests/unit/10_certs.bats
## Executing a single test
In order to increase testing velocity, a wrapper script around bats is available that can be used to run a single testcase within a suite.
In order to increase testing velocity, a wrapper script around Bats is available that can be used to run a single test case within a suite.
Tests within a suite may be listed by specifying the suite as a parameter to the `tests/bats-exec-test-single` script.
@@ -80,7 +87,7 @@ A single test can be specified as a second parameter. The test is selected by fu
tests/bats-exec-test-single tests/unit/10_apps.bats clone
```
Some special characters are translated in the test listing - specifically the characters `( ) :` - while others are not. The fuzzy matching happens on the test names listed when no second character is invoked, so executing a test with a more specific name will work as expected.
Some special characters are translated in the test listing, specifically the characters `( ) :`, while others are not. The fuzzy matching happens on test names as listed by this script, so executing a test with a more specific name will work as expected.
```shell
tests/bats-exec-test-single tests/unit/10_apps.bats clone_-2d-2dskip-2ddeploy

View File

@@ -1,4 +1,4 @@
# Microsoft Azure
# Microsoft Azure Installation Notes
1. If you don't already have one [generate an SSH key pair](https://help.github.com/articles/generating-ssh-keys/).

View File

@@ -1,4 +1,4 @@
# DigitalOcean Droplet
# 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.

View File

@@ -0,0 +1,54 @@
# Docker Installation Notes
Pull the dokku/dokku image:
```shell
docker pull dokku/dokku:0.18.2
```
Next, run the image.
```shell
docker run \
--env DOKKU_HOSTNAME=dokku.me \
--name dokku \
--publish 3022:22 \
--publish 8080:80 \
--publish 8443:443 \
--volume /var/lib/dokku:/mnt/dokku \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:0.18.2
```
Dokku is run with the following options:
- The global hostname is set to `dokku.me` on boot.
- The container name is dokku.
- Container SSH port 22 is exposed on the host as 3022.
- Container HTTP port 80 is exposed on the host as 8080.
- Container HTTPS port 443 is exposed on the host as 8443.
- Data within the container is stored on the host within the `/var/lib/dokku` directory.
- The docker socket is mounted into container
Application repositories, plugin config, and plugin data is persisted to disk within the specified host directory for `/var/lib/dokku`.
To install custom plugins, create a `plugin-list` file in the host's `/var/lib/dokku` directory. The plugins listed herein will be automatically installed by Dokku on container boot. This file should be the following format:
```yaml
plugin_name: repository_url
```
An example for installing the postgres and redis plugins follows:
```yaml
postgres: https://github.com/dokku/dokku-postgres.git
redis: https://github.com/dokku/dokku-redis.git
```
To initialize ssh-keys within the container, use `docker exec` to enter the container and run the appropriate ssh-keys commands.
```shell
docker exec -it dokku bash
```
Please see the [user management documentation](/docs/deployment/user-management.md) for more information.

View File

@@ -1,4 +1,4 @@
# Install Dokku on DreamHost Cloud Server with cloud-init
# DreamHost Cloud Server Installation Notes
Cloud-init script can be used to automate installation of Dokku on
Dreamhost (or any other OpenStack-compatible cloud with minimal

View File

@@ -1,4 +1,4 @@
# Install Dokku using Vagrant
# Vagrant Installation Notes
1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads).

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.17.7/bootstrap.sh;
sudo DOKKU_TAG=v0.17.7 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.18.2/bootstrap.sh;
sudo DOKKU_TAG=v0.18.2 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.
@@ -54,6 +54,7 @@ For various reasons, certain hosting providers may have other steps that should
As well, you may wish to customize your installation in some other fashion. or experiment with Vagrant. The guides below should get you started:
- [Debian Package Installation Notes](/docs/getting-started/install/debian.md)
- [Docker-based Installation Notes](/docs/getting-started/install/docker.md)
- [RPM Package Installation Notes](/docs/getting-started/install/rpm.md)
- [Vagrant Installation Notes](/docs/getting-started/install/vagrant.md)
- [Advanced Install Customization](/docs/getting-started/advanced-installation.md)

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

View File

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

15
dokku
View File

@@ -56,12 +56,14 @@ export DOKKU_SYSTEM_USER=${DOKKU_SYSTEM_USER:="dokku"}
export DOKKU_API_VERSION=1
export DOKKU_NOT_IMPLEMENTED_EXIT=10
export DOKKU_VALID_EXIT=0
export DOKKU_PID="$BASHPID"
export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"}
export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="$DOKKU_LOGS_DIR/events.log"}
export DOKKU_CONTAINER_LABEL=dokku
export DOKKU_GLOBAL_RUN_ARGS="--label=$DOKKU_CONTAINER_LABEL"
export DOKKU_GLOBAL_BUILD_ARGS="--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=$DOKKU_CONTAINER_LABEL"
export DOKKU_GLOBAL_RUN_ARGS="--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=$DOKKU_CONTAINER_LABEL"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
@@ -137,7 +139,7 @@ execute_dokku_cmd() {
deploy | delete | ls | run | cleanup)
local PLUGIN_NAME="00_dokku-standard"
;;
trace | url | urls | report)
url | urls | report)
local PLUGIN_NAME="00_dokku-standard"
;;
esac
@@ -242,8 +244,13 @@ case "$1" in
;;
version | -v | --version)
test -f "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version"
DOKKU_VERSION=$(cat "${DOKKU_ROOT}/VERSION")
if [[ -f "$DOKKU_LIB_ROOT/STABLE_VERSION" ]]; then
DOKKU_VERSION=$(cat "${DOKKU_LIB_ROOT}/STABLE_VERSION")
elif [[ -f "$DOKKU_LIB_ROOT/VERSION" ]]; then
DOKKU_VERSION=$(cat "${DOKKU_LIB_ROOT}/VERSION")
else
dokku_log_fail "Unable to determine dokku's version"
fi
echo "dokku version ${DOKKU_VERSION}"
;;

View File

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

View File

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

View File

@@ -17,7 +17,7 @@ dokku_report_cmd() {
"$DOCKER_BIN" -D info | sed "s/^/ /"
dokku_log_info1 "sigil version: $(sigil -v)"
dokku_log_info1 "herokuish version: "
"$DOCKER_BIN" run --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
"$DOCKER_BIN" run $DOKKU_GLOBAL_RUN_ARGS --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
dokku_log_info1 "dokku version: $(dokku version)"
dokku_log_info1 "dokku plugins: "
dokku plugin:list | sed "s/^/ /"

View File

@@ -0,0 +1 @@
hook

1
plugins/20_events/app-urls Symbolic link
View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -38,7 +38,14 @@ fi
if [[ -d "$DOKKU_RSYSLOG_FILTER_DIR" && ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then
cat >"$DOKKU_RSYSLOG_FILTER" <<EOF
:syslogtag, contains, "dokku" $DOKKU_EVENTS_LOGFILE
:syslogtag, contains, "dokku-event" $DOKKU_EVENTS_LOGFILE
EOF
flag_rsyslog_needs_restart=y
fi
if [[ -f "$DOKKU_RSYSLOG_FILTER" ]] && ! grep -q "dokku-event" "$DOKKU_RSYSLOG_FILTER"; then
cat >"$DOKKU_RSYSLOG_FILTER" <<EOF
:syslogtag, contains, "dokku-event" $DOKKU_EVENTS_LOGFILE
EOF
flag_rsyslog_needs_restart=y
fi

View File

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

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -8,11 +8,10 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
get_phase_script() {
declare desc="extracts app.json from app image and returns the appropriate json key/value"
declare IMAGE_TAG="$1" PHASE_SCRIPT_KEY="$2"
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
trap "rm -rf '$GET_PHASE_SCRIPT_TMP_WORK_DIR' >/dev/null" RETURN INT TERM
local APP_JSON_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$APP_JSON_FILE' >/dev/null" RETURN INT TERM
copy_from_image "$IMAGE" "app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true
copy_from_image "$IMAGE" "app.json" "$APP_JSON_FILE" 2>/dev/null || true
if [[ ! -f "$APP_JSON_FILE" ]]; then
return 0
@@ -36,6 +35,9 @@ execute_script() {
declare APP="$1" IMAGE_TAG="$2" PHASE_SCRIPT_KEY="$3"
local IMAGE id SCRIPT_CMD
local DOCKER_COMMIT_LABEL_ARGS=("--change" "\"LABEL org.label-schema.schema-version=1.0\"" "--change" "\"LABEL org.label-schema.vendor=dokku\"" "--change" "\"LABEL com.dokku.app-name=$APP\"")
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
if [[ "$PHASE_SCRIPT_KEY" == "release" ]]; then
SCRIPT_CMD=$(get_release_cmd "$APP" "$IMAGE_TAG" 2>/dev/null || true)
@@ -96,7 +98,7 @@ execute_script() {
DOKKU_APP_SHELL="$(config_get "$APP" DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")"
[[ -z "$DOKKU_APP_SHELL" ]] && DOKKU_APP_SHELL="/bin/bash"
id=$("$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -e DOKKU_TRACE="$DOKKU_TRACE" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_HOST_DIR:/cache" "${ARG_ARRAY[@]}" "$IMAGE" "$DOKKU_APP_SHELL" -c "$COMMAND")
id=$("$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -e DOKKU_TRACE="$DOKKU_TRACE" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_HOST_DIR:/cache" "${ARG_ARRAY[@]}" "$IMAGE" "$DOKKU_APP_SHELL" -c "$COMMAND")
if test "$("$DOCKER_BIN" wait "$id")" -ne 0; then
dokku_container_log_verbose_quiet "$id"
dokku_log_fail "execution of '$SCRIPT_CMD' failed!"
@@ -119,6 +121,5 @@ execute_script() {
local DOCKER_COMMIT_ARGS="$DOCKER_COMMIT_ENTRYPOINT_CHANGE_ARG $DOCKER_COMMIT_CMD_CHANGE_ARG"
fi
# shellcheck disable=SC2086
eval "$DOCKER_BIN" commit $DOCKER_COMMIT_ARGS "$id" "$IMAGE" >/dev/null
eval "$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "${DOCKER_COMMIT_ARGS[@]}" "$id" "$IMAGE" >/dev/null
}

View File

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

View File

@@ -42,6 +42,7 @@ apps_destroy() {
plugn trigger scheduler-stop "$DOKKU_SCHEDULER" "$APP" "$REMOVE_CONTAINERS"
plugn trigger scheduler-post-delete "$DOKKU_SCHEDULER" "$APP" "$IMAGE_TAG"
plugn trigger post-delete "$APP" "$IMAGE_TAG"
docker_cleanup "$APP" "true"
}
apps_exists() {

View File

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

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
apps_pre_delete() {
declare desc="apps pre-delete plugin trigger"
local trigger="apps_pre_delete"
local APP="$1"
local IMAGE_TAG="$2"
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
local CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$APP/cache"
verify_app_name "$APP"
if ! is_image_herokuish_based "$IMAGE"; then
return
fi
if [[ -d $CACHE_DIR ]]; then
"$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_HOST_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
fi
}
apps_pre_delete "$@"

View File

@@ -22,6 +22,8 @@ apps_clone_cmd() {
OLD_APP="$1" NEW_APP="$2"
[[ -z "$OLD_APP" ]] && dokku_log_fail "Please specify an app to run the command on"
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$NEW_APP"
is_valid_app_name "$OLD_APP"
is_valid_app_name "$NEW_APP"
apps_exists "$OLD_APP" >/dev/null 2>&1 || dokku_log_fail "App does not exist"
@@ -44,7 +46,7 @@ apps_clone_cmd() {
plugn trigger post-app-clone-setup "$OLD_APP" "$NEW_APP"
if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then
"$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
"$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi
rm -rf "$NEW_CACHE_DIR"

View File

@@ -15,8 +15,10 @@ apps_rename_cmd() {
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache"
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$OLD_APP"
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" >/dev/null 2>&1; then
"$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
"$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi
rm -rf "$OLD_CACHE_DIR"
apps_create "$NEW_APP"
@@ -28,6 +30,7 @@ apps_rename_cmd() {
[[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
ps_rebuild "$NEW_APP"
plugn trigger post-app-rename "$OLD_APP" "$NEW_APP"
docker_cleanup "$OLD_APP" "true"
echo "Renaming $OLD_APP to $NEW_APP... done"
}

View File

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

View File

@@ -1,32 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
build_env_pre_build_buildpack() {
declare desc="build-env pre-build-buildpack plugin trigger"
local trigger="build_env_pre_build_buildpack"
local APP="$1"
local IMAGE id
verify_app_name "$APP"
IMAGE=$(get_app_image_name "$APP")
[[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=90
[[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=600
dokku_log_info1 "Adding BUILD_ENV to build environment..."
# create build env files for use in buildpacks like this:
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
id=$(config_bundle --merged "$APP" | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env")
test "$("$DOCKER_BIN" wait "$id")" -eq 0
"$DOCKER_BIN" commit "$id" "$IMAGE" >/dev/null
# create build env for 'old style' buildpacks and dokku plugins
id=$(config_export app "$APP" --format envfile --merged | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env")
test "$("$DOCKER_BIN" wait "$id")" -eq 0
"$DOCKER_BIN" commit "$id" "$IMAGE" >/dev/null
}
build_env_pre_build_buildpack "$@"

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/config/functions"
trigger-builder-build-builder-dockerfile() {
declare desc="builder-dockerfile builder-build plugin trigger"
declare trigger="trigger-builder-build-builder-dockerfile"
declare BUILDER_TYPE="$1" APP="$2" SOURCECODE_WORK_DIR="$3"
if [[ "$BUILDER_TYPE" != "dockerfile" ]]; then
return
fi
local IMAGE=$(get_app_image_name "$APP")
local DOCKER_BUILD_LABEL_ARGS="--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.app-name=$APP"
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
# extract first port from Dockerfile
local DOCKERFILE_PORTS=$(get_dockerfile_exposed_ports Dockerfile)
[[ -n "$DOCKERFILE_PORTS" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_PORTS="$DOCKERFILE_PORTS"
# extract ENTRYPOINT/CMD from Dockerfile
local DOCKERFILE_ENTRYPOINT=$(extract_directive_from_dockerfile Dockerfile ENTRYPOINT)
[[ -n "$DOCKERFILE_ENTRYPOINT" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_ENTRYPOINT="$DOCKERFILE_ENTRYPOINT"
local DOCKERFILE_CMD=$(extract_directive_from_dockerfile Dockerfile CMD)
[[ -n "$DOCKERFILE_CMD" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_CMD="$DOCKERFILE_CMD"
plugn trigger pre-build-dockerfile "$APP"
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$BUILDER_TYPE")
# strip --volume and -v args from DOCKER_ARGS
local DOCKER_ARGS=$(sed -e "s/--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
"$DOCKER_BIN" build "${DOCKER_BUILD_LABEL_ARGS[@]}" $DOKKU_GLOBAL_BUILD_ARGS "${ARG_ARRAY[@]}" "${DOKKU_DOCKER_BUILD_OPTS[@]}" -t $IMAGE .
plugn trigger post-build-dockerfile "$APP"
}
trigger-builder-build-builder-dockerfile "$@"

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-builder-release-builder-dockerfile() {
declare desc="builder-dockerfile builder-release plugin trigger"
declare trigger="trigger-builder-release-builder-dockerfile"
declare BUILDER_TYPE="$1" APP="$2" IMAGE_TAG="$3"
if [[ "$BUILDER_TYPE" != "herokuish" ]]; then
return
fi
# buildstep plugins don't necessarily make sense for dockerfiles. call the new breed!!!
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
}
trigger-builder-release-builder-dockerfile "$@"

View File

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

View File

@@ -0,0 +1,54 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/config/functions"
trigger-builder-build-builder-herokuish() {
declare desc="builder-herokuish builder-build plugin trigger"
declare trigger="trigger-builder-build-builder-herokuish"
declare BUILDER_TYPE="$1" APP="$2" SOURCECODE_WORK_DIR="$3"
if [[ "$BUILDER_TYPE" != "herokuish" ]]; then
return
fi
local IMAGE=$(get_app_image_name "$APP")
local DOKKU_APP_CACHE_DIR="$DOKKU_ROOT/$APP/cache"
local DOKKU_APP_HOST_CACHE_DIR="$DOKKU_HOST_ROOT/$APP/cache"
local DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
local CID
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
eval "$(config_export app "$APP")"
DOKKU_IMAGE="$(config_get "$APP" DOKKU_IMAGE || echo "$DOKKU_IMAGE")"
plugn trigger builder-create-dokku-image "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR" "$DOKKU_IMAGE"
NEW_DOKKU_IMAGE=$(plugn trigger builder-dokku-image "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR" "$DOKKU_IMAGE")
[[ -n "$NEW_DOKKU_IMAGE" ]] && DOKKU_IMAGE="$NEW_DOKKU_IMAGE"
CID=$(tar -c . | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$DOKKU_IMAGE" /bin/bash -c "mkdir -p /app && tar -xC /app")
test "$("$DOCKER_BIN" wait "$CID")" -eq 0
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
[[ -d $DOKKU_APP_CACHE_DIR ]] || mkdir -p "$DOKKU_APP_CACHE_DIR"
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$BUILDER_TYPE")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
# shellcheck disable=SC2086
CID=$("$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -d -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
"$DOCKER_BIN" attach "$CID"
test "$("$DOCKER_BIN" wait "$CID")" -eq 0
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
plugn trigger post-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
}
trigger-builder-build-builder-herokuish "$@"

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/config/functions"
trigger-builder-release-builder-herokuish() {
declare desc="builder-herokuish builder-release plugin trigger"
declare trigger="trigger-builder-release-builder-herokuish"
declare BUILDER_TYPE="$1" APP="$2" IMAGE_TAG="$3"
if [[ "$BUILDER_TYPE" != "herokuish" ]]; then
return
fi
local CID
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
local DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then
CID=$(config_export global | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
test "$("$DOCKER_BIN" wait "$CID")" -eq 0
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
fi
if [[ -n $(config_export app "$APP") ]]; then
CID=$(config_export app "$APP" | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
test "$("$DOCKER_BIN" wait "$CID")" -eq 0
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
fi
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
}
trigger-builder-release-builder-herokuish "$@"

View File

@@ -3,7 +3,9 @@ set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/config/functions"
app_user_docker_args() {
trigger-docker-args-builder-herokuish() {
declare desc="builder-herokuish docker-args plugin trigger"
declare trigger="trigger-docker-args-builder-herokuish"
local APP="$1"
local STDIN
local DOKKU_APP_TYPE
@@ -23,4 +25,4 @@ app_user_docker_args() {
echo -n "$docker_args"
}
app_user_docker_args "$@"
trigger-docker-args-builder-herokuish "$@"

View File

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

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
trigger-pre-build-buildpack-builder-herokuish() {
declare desc="builder-herokuish pre-build-buildpack plugin trigger"
declare trigger="trigger-pre-build-buildpack-builder-herokuish"
declare APP="$1"
local IMAGE CID
local DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
verify_app_name "$APP"
IMAGE=$(get_app_image_name "$APP")
[[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=90
[[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=600
dokku_log_info1 "Adding BUILD_ENV to build environment..."
# create build env files for use in buildpacks like this:
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
CID=$(config_bundle --merged "$APP" | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env")
test "$("$DOCKER_BIN" wait "$CID")" -eq 0
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
# create build env for 'old style' buildpacks and dokku plugins
CID=$(config_export app "$APP" --format envfile --merged | "$DOCKER_BIN" run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env")
test "$("$DOCKER_BIN" wait "$CID")" -eq 0
"$DOCKER_BIN" commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
}
trigger-pre-build-buildpack-builder-herokuish "$@"

View File

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

View File

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

View File

@@ -42,7 +42,7 @@ certs_set() {
# importing from file
true
elif is_tar_import; then
local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
pushd "$CERTS_SET_TMP_WORK_DIR" &>/dev/null
trap "popd &>/dev/null || true; rm -rf '$CERTS_SET_TMP_WORK_DIR' >/dev/null" RETURN
tar xvf - <&0

View File

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

View File

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

View File

@@ -135,8 +135,8 @@ func DirectoryExists(filePath string) bool {
}
// DockerInspect runs an inspect command with a given format against a container id
func DockerInspect(containerID, format string) (output string, err error) {
b, err := sh.Command(DockerBin(), "inspect", "--format", format, containerID).Output()
func DockerInspect(containerOrImageID, format string) (output string, err error) {
b, err := sh.Command(DockerBin(), "inspect", "--format", format, containerOrImageID).Output()
if err != nil {
return "", err
}
@@ -246,25 +246,11 @@ func IsDeployed(appName string) bool {
// IsImageHerokuishBased returns true if app image is based on herokuish
func IsImageHerokuishBased(image string) bool {
// circleci can't support --rm as they run lxc in lxc
dockerArgs := ""
if !FileExists("/home/ubuntu/.circlerc") {
dockerArgs = "--rm"
output, err := DockerInspect(image, "{{range .Config.Env}}{{if eq . \"USER=herokuishuser\" }}{{println .}}{{end}}{{end}}")
if err != nil {
return false
}
dockerGlobalArgs := os.Getenv("DOKKU_GLOBAL_RUN_ARGS")
parts := []string{DockerBin(), "run", dockerGlobalArgs, "--entrypoint=\"/bin/sh\"", dockerArgs, image, "-c", "\"test -f /exec\""}
var dockerCmdParts []string
for _, str := range parts {
if str != "" {
dockerCmdParts = append(dockerCmdParts, str)
}
}
dockerCmd := NewShellCmd(strings.Join(dockerCmdParts, " "))
dockerCmd.ShowOutput = false
return dockerCmd.Execute()
return output != ""
}
// MustGetEnv returns env variable or fails if it's not set

View File

@@ -152,7 +152,7 @@ dokku_log_fail() {
dokku_log_event() {
declare desc="log dokku events"
logger -t dokku -i -- "$@"
logger -t dokku-event -i -- "$@"
}
dokku_log_plugn_trigger_call() {
@@ -264,6 +264,10 @@ get_app_scheduler() {
declare APP="$1"
local DOKKU_APP_SCHEDULER DOKKU_GLOBAL_SCHEDULER DOKKU_SCHEDULER
if [[ "$APP" == "--global" ]]; then
APP=""
fi
source "$PLUGIN_AVAILABLE_PATH/config/functions"
[[ -n "$APP" ]] && DOKKU_APP_SCHEDULER="$(config_get "$APP" DOKKU_SCHEDULER || true)"
DOKKU_GLOBAL_SCHEDULER="$(config_get --global DOKKU_SCHEDULER || true)"
@@ -367,10 +371,12 @@ parse_args() {
copy_from_image() {
declare desc="copy file from named image to destination"
declare IMAGE="$1" SRC_FILE="$2" DST_DIR="$3"
declare IMAGE="$1" SRC_FILE="$2" DST_FILE="$3"
local WORK_DIR=""
verify_app_name "$APP"
local DOCKER_CREATE_LABEL_ARGS="--label=com.dokku.app-name=$APP"
if verify_image "$IMAGE"; then
if ! is_abs_path "$SRC_FILE"; then
if is_image_herokuish_based "$IMAGE"; then
@@ -383,12 +389,28 @@ copy_from_image() {
SRC_FILE="${WORKDIR}/${SRC_FILE}"
fi
fi
local CID=$("$DOCKER_BIN" create "$DOKKU_GLOBAL_RUN_ARGS" "$IMAGE")
if ! "$DOCKER_BIN" cp "$CID:$SRC_FILE" "$DST_DIR"; then
"$DOCKER_BIN" rm -f "$CID" &>/dev/null
TMP_FILE_COMMAND_OUTPUT=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_FILE_COMMAND_OUTPUT' >/dev/null 2>&1 || true" RETURN
local CID=$("$DOCKER_BIN" create "${DOCKER_CREATE_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS "$IMAGE")
"$DOCKER_BIN" cp "$CID:$SRC_FILE" "$TMP_FILE_COMMAND_OUTPUT" 2>/dev/null || true
"$DOCKER_BIN" rm -f "$CID" &>/dev/null
# docker cp exits with status 1 when run as non-root user when it tries to chown the file
# after successfully copying the file. Thus, we suppress stderr.
# ref: https://github.com/dotcloud/docker/issues/3986
if [[ ! -s "$TMP_FILE_COMMAND_OUTPUT" ]]; then
return 1
fi
"$DOCKER_BIN" rm -f "$CID" &>/dev/null
# workaround for CHECKS file when owner is root. seems to only happen when running inside docker
dos2unix -l <"$TMP_FILE_COMMAND_OUTPUT" >"$DST_FILE"
# add trailing newline for certain places where file parsing depends on it
if [[ "$(tail -c1 "$DST_FILE")" != "" ]]; then
echo "" >>"$DST_FILE"
fi
else
return 1
fi
@@ -511,117 +533,17 @@ is_app_running() {
dokku_build() {
declare desc="build phase"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
declare APP="$1" IMAGE_SOURCE_TYPE="$2" SOURCECODE_WORK_DIR="$3"
local APP="$1"
local IMAGE_SOURCE_TYPE="$2"
local TMP_WORK_DIR="$3"
local IMAGE=$(get_app_image_name "$APP")
local cid
verify_app_name "$APP"
local DOKKU_APP_CACHE_DIR="$DOKKU_ROOT/$APP/cache"
local DOKKU_APP_HOST_CACHE_DIR="$DOKKU_HOST_ROOT/$APP/cache"
eval "$(config_export app "$APP")"
pushd "$TMP_WORK_DIR" &>/dev/null
case "$IMAGE_SOURCE_TYPE" in
herokuish)
DOKKU_IMAGE="$(config_get "$APP" DOKKU_IMAGE || echo "$DOKKU_IMAGE")"
cid=$(tar -c . | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$DOKKU_IMAGE" /bin/bash -c "mkdir -p /app && tar -xC /app")
test "$("$DOCKER_BIN" wait "$cid")" -eq 0
"$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
[[ -d $DOKKU_APP_CACHE_DIR ]] || mkdir -p "$DOKKU_APP_CACHE_DIR"
plugn trigger pre-build-buildpack "$APP"
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
local IMAGE_SOURCE_TYPE="herokuish"
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
# shellcheck disable=SC2086
cid=$("$DOCKER_BIN" run $DOKKU_GLOBAL_RUN_ARGS -d -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
"$DOCKER_BIN" attach "$cid"
test "$("$DOCKER_BIN" wait "$cid")" -eq 0
"$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
plugn trigger post-build-buildpack "$APP"
;;
dockerfile)
# extract first port from Dockerfile
local DOCKERFILE_PORTS=$(get_dockerfile_exposed_ports Dockerfile)
[[ -n "$DOCKERFILE_PORTS" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_PORTS="$DOCKERFILE_PORTS"
# extract ENTRYPOINT/CMD from Dockerfile
local DOCKERFILE_ENTRYPOINT=$(extract_directive_from_dockerfile Dockerfile ENTRYPOINT)
[[ -n "$DOCKERFILE_ENTRYPOINT" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_ENTRYPOINT="$DOCKERFILE_ENTRYPOINT"
local DOCKERFILE_CMD=$(extract_directive_from_dockerfile Dockerfile CMD)
[[ -n "$DOCKERFILE_CMD" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_CMD="$DOCKERFILE_CMD"
plugn trigger pre-build-dockerfile "$APP"
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
local IMAGE_SOURCE_TYPE="dockerfile"
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
# strip --volume and -v args from DOCKER_ARGS
local DOCKER_ARGS=$(sed -e "s/--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
# shellcheck disable=SC2086
"$DOCKER_BIN" build "${ARG_ARRAY[@]}" $DOKKU_DOCKER_BUILD_OPTS -t $IMAGE .
plugn trigger post-build-dockerfile "$APP"
;;
*)
dokku_log_fail "Building image source type $IMAGE_SOURCE_TYPE not supported!"
;;
esac
plugn trigger builder-build "$IMAGE_SOURCE_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
}
dokku_release() {
declare desc="release phase"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
declare APP="$1" IMAGE_SOURCE_TYPE="$2" IMAGE_TAG="$3"
local APP="$1"
local IMAGE_SOURCE_TYPE="$2"
local IMAGE_TAG="$3"
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
local cid
verify_app_name "$APP"
case "$IMAGE_SOURCE_TYPE" in
herokuish)
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then
cid=$(config_export global | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
test "$("$DOCKER_BIN" wait "$cid")" -eq 0
"$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
fi
if [[ -n $(config_export app "$APP") ]]; then
cid=$(config_export app "$APP" | "$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
test "$("$DOCKER_BIN" wait "$cid")" -eq 0
"$DOCKER_BIN" commit "$cid" "$IMAGE" >/dev/null
fi
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
;;
dockerfile)
# buildstep plugins don't necessarily make sense for dockerfiles. call the new breed!!!
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
;;
*)
dokku_log_fail "Releasing image source type $IMAGE_SOURCE_TYPE not supported!"
;;
esac
plugn trigger builder-release "$IMAGE_SOURCE_TYPE" "$APP" "$IMAGE_TAG"
}
dokku_deploy_cmd() {
@@ -709,19 +631,41 @@ docker_cleanup() {
dokku_log_info1 "Cleaning up..."
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
if [[ "$APP" == "--global" ]]; then
APP=""
fi
plugn trigger scheduler-docker-cleanup "$DOKKU_SCHEDULER" "$APP" "$FORCE_CLEANUP"
# delete all non-running containers
# shellcheck disable=SC2046
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=exited" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
if [[ -n "$APP" ]]; then
# delete all non-running containers
# shellcheck disable=SC2046
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=exited" -f "label=$DOKKU_CONTAINER_LABEL" -f "label=com.dokku.app-name=$APP" -q) &>/dev/null || true
# delete all dead containers
# shellcheck disable=SC2046
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=dead" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
# delete all dead containers
# shellcheck disable=SC2046
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=dead" -f "label=$DOKKU_CONTAINER_LABEL" -f "label=com.dokku.app-name=$APP" -q) &>/dev/null || true
# delete unused images
# shellcheck disable=SC2046
"$DOCKER_BIN" rmi $("$DOCKER_BIN" images -f 'dangling=true' -q) &>/dev/null &
# delete danging images
# shellcheck disable=SC2046
"$DOCKER_BIN" rmi $("$DOCKER_BIN" images -f 'dangling=true' -f "label=com.dokku.app-name=$APP" -q) &>/dev/null || true
# delete unused images
"$DOCKER_BIN" image prune --all --filter "label=com.dokku.app-name=$APP" --force &>/dev/null || true
else
# delete all non-running containers
# shellcheck disable=SC2046
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=exited" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
# delete all dead containers
# shellcheck disable=SC2046
"$DOCKER_BIN" rm $("$DOCKER_BIN" ps -a -f "status=dead" -f "label=$DOKKU_CONTAINER_LABEL" -q) &>/dev/null || true
# delete danging images
# shellcheck disable=SC2046
"$DOCKER_BIN" rmi $("$DOCKER_BIN" images -f 'dangling=true' -q) &>/dev/null || true
fi
}
get_available_port() {
@@ -741,6 +685,12 @@ dokku_auth() {
declare desc="calls user-auth plugin trigger"
export SSH_USER=${SSH_USER:=$USER}
export SSH_NAME=${NAME:="default"}
# this plugin trigger exists in the core `20_events` plugin
if [[ $(find "$PLUGIN_PATH"/enabled/*/user-auth 2>/dev/null | wc -l) == 1 ]]; then
return 0
fi
if ! plugn trigger user-auth "$SSH_USER" "$SSH_NAME" "$@"; then
return 1
fi
@@ -1079,7 +1029,7 @@ release_advisory_lock() {
suppress_output() {
declare desc="suppress all output from a given command unless there is an error"
local TMP_COMMAND_OUTPUT
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_COMMAND_OUTPUT' >/dev/null" RETURN
"$@" >"$TMP_COMMAND_OUTPUT" 2>&1 || {

View File

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

View File

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

View File

@@ -62,6 +62,9 @@ func CommandClear(args []string, global bool, noRestart bool) {
//CommandUnset implements config:unset
func CommandUnset(args []string, global bool, noRestart bool) {
appName, keys := getCommonArgs(global, args)
if len(keys) == 0 {
common.LogFail("At least one key must be given")
}
err := UnsetMany(appName, keys, !noRestart)
if err != nil {
common.LogFail(err.Error())
@@ -71,6 +74,9 @@ func CommandUnset(args []string, global bool, noRestart bool) {
//CommandSet implements config:set
func CommandSet(args []string, global bool, noRestart bool, encoded bool) {
appName, pairs := getCommonArgs(global, args)
if len(pairs) == 0 {
common.LogFail("At least one env pair must be given")
}
updated := make(map[string]string)
for _, e := range pairs {
parts := strings.SplitN(e, "=", 2)

View File

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

View File

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

View File

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

View File

@@ -31,7 +31,7 @@ git_build_app_repo() {
verify_app_name "$APP"
# clean up after ourselves
local GIT_BUILD_APP_REPO_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local GIT_BUILD_APP_REPO_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$GIT_BUILD_APP_REPO_TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
local TMP_TAG="dokku/$REV"
@@ -143,12 +143,12 @@ git_hook_cmd() {
# shellcheck disable=SC2086
git_receive_app "$APP" "$newrev"
else
if [[ $(find "$PLUGIN_PATH"/enabled/*/receive-branch 2>/dev/null | wc -l) != 0 ]]; then
if [[ $(find "$PLUGIN_PATH"/enabled/*/receive-branch 2>/dev/null | wc -l) != 1 ]]; then
# shellcheck disable=SC2086
plugn trigger receive-branch $APP $newrev $refname
else
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\//}:master'"
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to ${DOKKU_DEPLOY_BRANCH}."
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\//}:${DOKKU_DEPLOY_BRANCH}'"
fi
fi
done

View File

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

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