Compare commits
203 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f2136af09 | ||
|
|
634a399748 | ||
|
|
325e686b16 | ||
|
|
d702fae491 | ||
|
|
eaaa73e642 | ||
|
|
aa0f7ccfa7 | ||
|
|
b1254b3edc | ||
|
|
887633a3a3 | ||
|
|
e2d7f7ea35 | ||
|
|
513bc74c55 | ||
|
|
5b9eff6114 | ||
|
|
49a9d84342 | ||
|
|
5ca4c769db | ||
|
|
ab6dd96c50 | ||
|
|
b7cc027a04 | ||
|
|
eb804bfbbd | ||
|
|
366a3cee81 | ||
|
|
cb3b5bdc28 | ||
|
|
6b35cc3131 | ||
|
|
0fbbb10307 | ||
|
|
82bf74d7c9 | ||
|
|
dd30525c27 | ||
|
|
ae8f614a81 | ||
|
|
cf834f8ac8 | ||
|
|
ea2e9fe348 | ||
|
|
4b8e70075f | ||
|
|
068d83629f | ||
|
|
54d577a038 | ||
|
|
2e41cb36de | ||
|
|
a468b3b17b | ||
|
|
07d64909a9 | ||
|
|
769cff23fd | ||
|
|
cf996b4a87 | ||
|
|
34efbbd570 | ||
|
|
f83aba565f | ||
|
|
c1b47dd248 | ||
|
|
ec47b1bcc7 | ||
|
|
deeaf6dc41 | ||
|
|
8a9c77a061 | ||
|
|
d9fca6ac47 | ||
|
|
38ed9bff39 | ||
|
|
14a1050a26 | ||
|
|
48842fc2f6 | ||
|
|
ba4db261ba | ||
|
|
1c24585093 | ||
|
|
e16a7b5fe3 | ||
|
|
ea2443a7c2 | ||
|
|
15a2b7cbce | ||
|
|
44d8eb4cb7 | ||
|
|
fd8d27d837 | ||
|
|
059d3dc159 | ||
|
|
05240c56b6 | ||
|
|
6f2e2d6aad | ||
|
|
f992156dcf | ||
|
|
aee8b8b659 | ||
|
|
5e06583055 | ||
|
|
cb0ad13278 | ||
|
|
d63f1cc158 | ||
|
|
64c6437e4e | ||
|
|
2ec99bc853 | ||
|
|
81935a8f31 | ||
|
|
01a4440f39 | ||
|
|
0abc40ecca | ||
|
|
7f6688c01a | ||
|
|
0d776ec2c8 | ||
|
|
95292bfcba | ||
|
|
0292c4ee3b | ||
|
|
afd101034d | ||
|
|
b6fe31f9cb | ||
|
|
c924bdef04 | ||
|
|
2db8f93507 | ||
|
|
aeeb2e138f | ||
|
|
d156cff7e4 | ||
|
|
2d1b11bd8c | ||
|
|
58fcb01e08 | ||
|
|
66948b9de4 | ||
|
|
9aeee8189b | ||
|
|
b67a695e9e | ||
|
|
c84304b33c | ||
|
|
c441e7ec2c | ||
|
|
ed190527ce | ||
|
|
fabb18c55c | ||
|
|
31adb13bde | ||
|
|
2102160cdb | ||
|
|
5ddb7eb983 | ||
|
|
b904895a61 | ||
|
|
be0c315a12 | ||
|
|
c55bfb650c | ||
|
|
84227b972b | ||
|
|
9d15ef9395 | ||
|
|
16e4bc8f60 | ||
|
|
a0cb2d932a | ||
|
|
70f522ecdd | ||
|
|
be941a7375 | ||
|
|
b812637fe1 | ||
|
|
194d5c995b | ||
|
|
7a8dd39ee8 | ||
|
|
09762cb35a | ||
|
|
e2e263c783 | ||
|
|
7349c30cd9 | ||
|
|
53c5d548f1 | ||
|
|
aec7b6f7fb | ||
|
|
1831848f89 | ||
|
|
f80b152c9b | ||
|
|
db29029653 | ||
|
|
87ee233636 | ||
|
|
cf99ac9a2c | ||
|
|
1538dc5dcb | ||
|
|
ec34b35a7f | ||
|
|
f7169bf417 | ||
|
|
f173c2f1c2 | ||
|
|
78f467852e | ||
|
|
8b932971df | ||
|
|
66b2fb602f | ||
|
|
df834f41f3 | ||
|
|
b0ac10bc11 | ||
|
|
b75547cff8 | ||
|
|
e8265ac642 | ||
|
|
029de873d7 | ||
|
|
2679bf3709 | ||
|
|
6fb4adf87f | ||
|
|
c9de100dd9 | ||
|
|
f6fc32a074 | ||
|
|
019e80d60a | ||
|
|
06f8237196 | ||
|
|
8fa869fab2 | ||
|
|
ed744d05e1 | ||
|
|
0023b6135a | ||
|
|
2b709fb8e8 | ||
|
|
3bc5e780da | ||
|
|
2fa7a1ab5f | ||
|
|
f34a16846f | ||
|
|
a2177ef57f | ||
|
|
28619164c4 | ||
|
|
ab376f0f1a | ||
|
|
44cb90eff1 | ||
|
|
2584d958e9 | ||
|
|
161d877e8b | ||
|
|
b98154e410 | ||
|
|
7cb0d7fb58 | ||
|
|
c77d323f1f | ||
|
|
3ae416955f | ||
|
|
7480fd51ee | ||
|
|
730e8f73d4 | ||
|
|
d3118b4d07 | ||
|
|
fb79d0f2e8 | ||
|
|
1bbde8fd94 | ||
|
|
ee8bdd4886 | ||
|
|
e36db73864 | ||
|
|
a3a50f193c | ||
|
|
7d917589a4 | ||
|
|
aad283a981 | ||
|
|
047626909c | ||
|
|
5ab170a60a | ||
|
|
ddd5526fed | ||
|
|
b716b61099 | ||
|
|
cadf876d37 | ||
|
|
088608d160 | ||
|
|
4f9b00dfcb | ||
|
|
1d9479e532 | ||
|
|
93eb8be806 | ||
|
|
31d4851089 | ||
|
|
e98d54f0bc | ||
|
|
f7474347b6 | ||
|
|
640f78a23c | ||
|
|
136c868904 | ||
|
|
1587b32a30 | ||
|
|
cb7b1f4ebd | ||
|
|
6df62d052a | ||
|
|
c7ce9dc89c | ||
|
|
5da8bcc3b5 | ||
|
|
aca8df1b09 | ||
|
|
87e9bea6da | ||
|
|
aed99f6193 | ||
|
|
f115815ced | ||
|
|
900e4ac94d | ||
|
|
855090c9e7 | ||
|
|
9b41f7a74e | ||
|
|
8d07ffe775 | ||
|
|
e47f6e5803 | ||
|
|
436574a9ad | ||
|
|
8ac04392f0 | ||
|
|
5bfb43222b | ||
|
|
7ee87c7aa5 | ||
|
|
172779f3d6 | ||
|
|
75ea7862cc | ||
|
|
6ea86f2714 | ||
|
|
a6b047805c | ||
|
|
3ce148dacd | ||
|
|
67dcf34f7a | ||
|
|
db635841f5 | ||
|
|
970b6806c7 | ||
|
|
1dfa02924d | ||
|
|
380e8affba | ||
|
|
725dd8b2a6 | ||
|
|
ff27908dfd | ||
|
|
e6762f2439 | ||
|
|
954d20bd1e | ||
|
|
792b36d5cc | ||
|
|
28f76c5ae0 | ||
|
|
6b78375cdc | ||
|
|
9087664667 | ||
|
|
418ecf67c2 |
@@ -7,3 +7,4 @@ docs
|
|||||||
tests
|
tests
|
||||||
!contrib/dokku-installer.py
|
!contrib/dokku-installer.py
|
||||||
!contrib/dokku-update
|
!contrib/dokku-update
|
||||||
|
!contrib/bash-completion
|
||||||
172
HISTORY.md
172
HISTORY.md
@@ -1,5 +1,177 @@
|
|||||||
# History
|
# History
|
||||||
|
|
||||||
|
## 0.13.2
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.2/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.13.2 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3329: @josegonzalez Avoid parsing missing file when retiring containers
|
||||||
|
- #3325: @wcalandro Add "--global" to dokku cleanup on dokku update
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3326: @josegonzalez Add note to release on how to upgrade via the bootstrap script
|
||||||
|
|
||||||
|
## 0.13.1
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.1/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.13.1 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3324: @josegonzalez Add missing source of config functions
|
||||||
|
|
||||||
|
## 0.13.0
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3312: @josegonzalez fix: keep track of failed containers regardless of docker kill output
|
||||||
|
- #3299: @josegonzalez Wrap script_bin in double-quotes
|
||||||
|
- #3295: @alexquick Sort config:show by key name
|
||||||
|
- #3288: @josegonzalez Wrap script binary in single quotes during executable check
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3302: @josegonzalez Add ability to check on app lock status via apps:locked command
|
||||||
|
- #3315: @aokon Upgrade herokuish to 0.4.5 version
|
||||||
|
- #3236: @josegonzalez Retire old containers
|
||||||
|
- #3307: @josegonzalez Add support for docker.io package
|
||||||
|
- #3301: @josegonzalez Add ability to sync packages to a new version of ubuntu
|
||||||
|
- #3286: @josegonzalez Sanitize docker inspect output with ps:inspect
|
||||||
|
- #3240: @josegonzalez Refactor Procfile handling to use go-procfile-util
|
||||||
|
- #3282: @josegonzalez Use create instead of run for faster and more reliable file copy from docker images
|
||||||
|
- #3280: @josegonzalez Better scheduler support
|
||||||
|
- #3259: @josegonzalez Check if script is executable when a full path is specified
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3314: @royklutman Remove reference to non-existent DigitalOcean hosting plan
|
||||||
|
- #3313: @morenoh149 Indicate to user to specify hostname
|
||||||
|
- #3310: @josegonzalez Add a note to our issue template begging for money
|
||||||
|
- #3281: @josegonzalez Add documentation on custom error pages
|
||||||
|
|
||||||
|
## 0.12.13
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3257: @josegonzalez Suppress output in git plugin during builds
|
||||||
|
- #3254: @michaelshobbs Update herokuish to 0.4.4
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3270: @alexymik Correct typo in git documentation
|
||||||
|
- #3268: @josegonzalez Correct notice on ubuntu support
|
||||||
|
- #3247: @mimischi Fix typo in ps:stopall
|
||||||
|
- #3246: @dv Change DISABLE_CHOWN to disable-chown
|
||||||
|
|
||||||
|
## 0.12.12
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3244: @josegonzalez Allow disabling chown for persistent storage in scheduler-docker-local
|
||||||
|
|
||||||
|
## 0.12.11
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3238: @josegonzalez Handle proxy issues in app renaming
|
||||||
|
- #3234: @mashrikt Unset GIT_QUARANTINE_PATH when updating repo submodule
|
||||||
|
- #3223: @josegonzalez Get the global scheduler if no app is specified
|
||||||
|
- #3218: @wcalandro Fix error text when using "dokku plugin:uninstall"
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3242: @josegonzalez Upgrade herokuish to 0.4.3
|
||||||
|
- #3241: @josegonzalez Add a subcommand for retrieving failed app deploy logs
|
||||||
|
- #3237: @josegonzalez Support --quiet header when showing all environment variables
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3235: @josegonzalez Switch from ps:rebuild to ps:restart
|
||||||
|
- #3221: @josegonzalez Better callout for why env vars do not get applied to dockerfile builds
|
||||||
|
|
||||||
|
## 0.12.10
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3214: @josegonzalez Add net-tools as a dependency to debian installs
|
||||||
|
|
||||||
|
## 0.12.9
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3212: @josegonzalez Add missing config source
|
||||||
|
|
||||||
|
## 0.12.8
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3211: @josegonzalez Add missing source of config/functions
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3204: @znz Add `--no-restart` to `config:unset` of `config:help`
|
||||||
|
- #3203: @josegonzalez Clarify issue template
|
||||||
|
|
||||||
|
## 0.12.7
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3200: @josegonzalez fix: correct bash-completion integration
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3199: @josegonzalez Update herokuish to 0.4.2
|
||||||
|
- #3198: @josegonzalez Cleanup temporary changes during betafish releases
|
||||||
|
|
||||||
|
## 0.12.6
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3193: @josegonzalez Install bash-completion files correctly
|
||||||
|
- #3179: @josegonzalez Ignore issues with popd when OS versions with stricter security
|
||||||
|
- #3177: @philm ensure dokku-redeploy runs when docker is stopped then started
|
||||||
|
- #3176: @josegonzalez Detect mixed running status on service start
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3195: @josegonzalez Allow lower versions of docker-engine
|
||||||
|
- #3181: @malixsys Adding support for `http2_push_preload` to nginx 1.13.9+ configuration
|
||||||
|
- #3183: @josegonzalez Unskip initial herokuish test
|
||||||
|
- #3175: @josegonzalez Implement bash-completion for commands
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3197: @josegonzalez Add a tutorial for deploying applications via gitlab ci
|
||||||
|
- #3194: @josegonzalez Clarify why dokku report information is useful
|
||||||
|
- #3189: @josegonzalez Correct issue with adding a user remotely
|
||||||
|
|
||||||
|
## 0.12.5
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3173: @josegonzalez fix: do not output error message twice
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3172: @josegonzalez feat: Add the ability to ignore existing applications during a git clone
|
||||||
|
- #3171: @josegonzalez Allow users to override the reported app url
|
||||||
|
- #3170: @josegonzalez Add ps:startall command
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3159: @zuck Improve docs for default site with HTTPS
|
||||||
|
|
||||||
## 0.12.4
|
## 0.12.4
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,13 +1,37 @@
|
|||||||
|
> If you're using Dokku - especially for commercial purposes - consider donating to project development via [OpenCollective](https://opencollective.com/dokku) or [Patreon](https://www.patreon.com/dokku). Funds go to general development, support, and infrastructure costs.
|
||||||
|
>
|
||||||
> If you need help figuring out how to use a specific buildpack, or are having issues using multiple buildpacks, please see our [irc or slack channels](http://dokku.viewdocs.io/dokku/getting-started/where-to-get-help/#the-irc-and-slack-channels). Issues pertaining to buildpacks may be closed and locked.
|
> If you need help figuring out how to use a specific buildpack, or are having issues using multiple buildpacks, please see our [irc or slack channels](http://dokku.viewdocs.io/dokku/getting-started/where-to-get-help/#the-irc-and-slack-channels). Issues pertaining to buildpacks may be closed and locked.
|
||||||
|
|
||||||
Description of problem:
|
## Description of problem
|
||||||
|
|
||||||
|
### How reproducible
|
||||||
|
|
||||||
Output of the following commands
|
### Steps to Reproduce
|
||||||
|
|
||||||
- `dokku report APP_NAME`
|
1.
|
||||||
- `docker inspect CONTAINER_ID` (if applicable):
|
2.
|
||||||
(BEWARE: `docker inspect` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
|
3.
|
||||||
|
|
||||||
|
#### Actual Results
|
||||||
|
|
||||||
|
#### Expected Results
|
||||||
|
|
||||||
|
## Environment Information
|
||||||
|
|
||||||
|
### `dokku report APP_NAME` output
|
||||||
|
|
||||||
|
> This is required! Issues missing this information may be closed.
|
||||||
|
>
|
||||||
|
> For problems affecting all applications, the report output for a broken application is useful for our debugging.
|
||||||
|
> You may also run `dokku report` without any arguments to display the top-level reporting information.
|
||||||
|
|
||||||
|
### How (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
|
||||||
|
|
||||||
|
### Additional information
|
||||||
|
|
||||||
|
- Container Inspect Output (if applicable):
|
||||||
|
- 0.13.0+: `dokku inspect APP_NAME`
|
||||||
|
- <0.13.0: `docker inspect CONTAINER_ID`: WARNING, `docker inspect` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX.
|
||||||
- `cat /home/dokku/<app>/nginx.conf` (if applicable):
|
- `cat /home/dokku/<app>/nginx.conf` (if applicable):
|
||||||
- Link to the exact repository being deployed (if possible/applicable):
|
- Link to the exact repository being deployed (if possible/applicable):
|
||||||
- If a deploy is failing or behaving unexpectedly:
|
- If a deploy is failing or behaving unexpectedly:
|
||||||
@@ -18,23 +42,3 @@ Output of the following commands
|
|||||||
- If it exists, the contents of your `Procfile`.
|
- If it exists, the contents of your `Procfile`.
|
||||||
- Output of failing Dokku commands after running `dokku trace on`
|
- Output of failing Dokku commands after running `dokku trace on`
|
||||||
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
|
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
|
||||||
|
|
||||||
Environment details (AWS, VirtualBox, physical, etc.):
|
|
||||||
|
|
||||||
How was Dokku installed?:
|
|
||||||
|
|
||||||
How reproducible:
|
|
||||||
|
|
||||||
|
|
||||||
Steps to Reproduce:
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
|
|
||||||
Actual Results:
|
|
||||||
|
|
||||||
|
|
||||||
Expected Results:
|
|
||||||
|
|
||||||
|
|
||||||
Additional info:
|
|
||||||
|
|||||||
13
Makefile
13
Makefile
@@ -1,6 +1,7 @@
|
|||||||
DOKKU_VERSION ?= master
|
DOKKU_VERSION ?= master
|
||||||
|
|
||||||
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand
|
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand
|
||||||
|
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v0.4.0/procfile-util_0.4.0_linux_x86_64.tgz
|
||||||
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_linux_x86_64.tgz
|
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_linux_x86_64.tgz
|
||||||
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz
|
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz
|
||||||
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
|
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
|
||||||
@@ -26,7 +27,7 @@ endif
|
|||||||
|
|
||||||
include common.mk
|
include common.mk
|
||||||
|
|
||||||
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies sshcommand plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build
|
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies sshcommand procfile-util plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build
|
||||||
|
|
||||||
include tests.mk
|
include tests.mk
|
||||||
include deb.mk
|
include deb.mk
|
||||||
@@ -109,13 +110,13 @@ else
|
|||||||
echo $(DOKKU_VERSION) > ~dokku/VERSION
|
echo $(DOKKU_VERSION) > ~dokku/VERSION
|
||||||
endif
|
endif
|
||||||
|
|
||||||
plugin-dependencies: plugn
|
plugin-dependencies: plugn procfile-util
|
||||||
sudo -E dokku plugin:install-dependencies --core
|
sudo -E dokku plugin:install-dependencies --core
|
||||||
|
|
||||||
plugins: plugn docker
|
plugins: plugn procfile-util docker
|
||||||
sudo -E dokku plugin:install --core
|
sudo -E dokku plugin:install --core
|
||||||
|
|
||||||
dependencies: apt-update sshcommand plugn docker help2man man-db sigil
|
dependencies: apt-update sshcommand plugn procfile-util docker help2man man-db sigil
|
||||||
$(MAKE) -e stack
|
$(MAKE) -e stack
|
||||||
|
|
||||||
apt-update:
|
apt-update:
|
||||||
@@ -132,6 +133,10 @@ sshcommand:
|
|||||||
chmod +x /usr/local/bin/sshcommand
|
chmod +x /usr/local/bin/sshcommand
|
||||||
sshcommand create dokku /usr/local/bin/dokku
|
sshcommand create dokku /usr/local/bin/dokku
|
||||||
|
|
||||||
|
procfile-util:
|
||||||
|
wget -qO /tmp/procfile-util_latest.tgz ${PROCFILE_UTIL_URL}
|
||||||
|
tar xzf /tmp/procfile-util_latest.tgz -C /usr/local/bin
|
||||||
|
|
||||||
plugn:
|
plugn:
|
||||||
wget -qO /tmp/plugn_latest.tgz ${PLUGN_URL}
|
wget -qO /tmp/plugn_latest.tgz ${PLUGN_URL}
|
||||||
tar xzf /tmp/plugn_latest.tgz -C /usr/local/bin
|
tar xzf /tmp/plugn_latest.tgz -C /usr/local/bin
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -1,5 +1,5 @@
|
|||||||
# Dokku
|
# Dokku
|
||||||
[](https://circleci.com/gh/dokku/dokku/tree/master)
|
[](https://circleci.com/gh/dokku/dokku/tree/master)
|
||||||
[](https://packagecloud.io/dokku/dokku)
|
[](https://packagecloud.io/dokku/dokku)
|
||||||
[](https://aur.archlinux.org/packages/dokku/)
|
[](https://aur.archlinux.org/packages/dokku/)
|
||||||
[](https://webchat.freenode.net/?channels=dokku)
|
[](https://webchat.freenode.net/?channels=dokku)
|
||||||
@@ -88,9 +88,8 @@ Support us with a monthly donation and help us continue our activities. [[Become
|
|||||||
|
|
||||||
A fresh VM running any of the following operating systems:
|
A fresh VM running any of the following operating systems:
|
||||||
|
|
||||||
- Ubuntu 16.04 x64
|
- Ubuntu x64 - Any currently supported release
|
||||||
- Ubuntu 14.04 x64
|
- Debian 8.2+ x64
|
||||||
- Debian 8.2 x64
|
|
||||||
- CentOS 7 x64 *(experimental)*
|
- CentOS 7 x64 *(experimental)*
|
||||||
- Arch Linux x64 *(experimental)*
|
- Arch Linux x64 *(experimental)*
|
||||||
|
|
||||||
@@ -99,8 +98,8 @@ A fresh VM running any of the following operating systems:
|
|||||||
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.12.4/bootstrap.sh
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.2/bootstrap.sh
|
||||||
sudo DOKKU_TAG=v0.12.4 bash bootstrap.sh
|
sudo DOKKU_TAG=v0.13.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.
|
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ install-dokku-from-deb-package() {
|
|||||||
[[ -n $DOKKU_HOSTNAME ]] && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | sudo debconf-set-selections
|
[[ -n $DOKKU_HOSTNAME ]] && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | sudo debconf-set-selections
|
||||||
[[ -n $DOKKU_SKIP_KEY_FILE ]] && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | sudo debconf-set-selections
|
[[ -n $DOKKU_SKIP_KEY_FILE ]] && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | sudo debconf-set-selections
|
||||||
[[ -n $DOKKU_KEY_FILE ]] && echo "dokku dokku/key_file string $DOKKU_KEY_FILE" | sudo debconf-set-selections
|
[[ -n $DOKKU_KEY_FILE ]] && echo "dokku dokku/key_file string $DOKKU_KEY_FILE" | sudo debconf-set-selections
|
||||||
|
[[ -n $DOKKU_NGINX_ENABLE ]] && echo "dokku dokku/nginx_enable string $DOKKU_NGINX_ENABLE" | sudo debconf-set-selections
|
||||||
|
|
||||||
if [[ -n $DOKKU_CHECKOUT ]]; then
|
if [[ -n $DOKKU_CHECKOUT ]]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
|||||||
31
contrib/bash-completion
Normal file
31
contrib/bash-completion
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# bash completion for dd -*- shell-script -*-
|
||||||
|
|
||||||
|
_dokku_complete_verify() {
|
||||||
|
declare desc="shows bash completion"
|
||||||
|
declare COMMAND="$1"
|
||||||
|
local COMMANDS=""
|
||||||
|
|
||||||
|
_dokku_complete_goals=$(cat "/var/cache/dokku-completion")
|
||||||
|
|
||||||
|
while read -r fn; do
|
||||||
|
if [[ -z "$COMMAND" ]] || [[ "$fn" == $COMMAND* ]]; then
|
||||||
|
COMMANDS="${COMMANDS};${fn}"
|
||||||
|
fi
|
||||||
|
done <<< "$_dokku_complete_goals"
|
||||||
|
|
||||||
|
echo "${COMMANDS#";"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
_dokku() {
|
||||||
|
local cur prev
|
||||||
|
_get_comp_words_by_ref -n : cur
|
||||||
|
|
||||||
|
if [[ ! -f "/var/cache/dokku-completion" ]] || [[ ! -s "/var/cache/dokku-completion" ]]; then
|
||||||
|
dokku --quiet help --all | awk '/^ /{ print $1 }' | sort > "/var/cache/dokku-completion"
|
||||||
|
fi
|
||||||
|
|
||||||
|
opts=$(_dokku_complete_verify "${cur}")
|
||||||
|
COMPREPLY=($(IFS=";" compgen -W "$opts" -- "$cur"))
|
||||||
|
__ltrim_colon_completions "$cur"
|
||||||
|
} &&
|
||||||
|
complete -F _dokku dokku
|
||||||
51
contrib/copy-packages
Normal file
51
contrib/copy-packages
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env python2.7
|
||||||
|
import os
|
||||||
|
import requests
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
from requests.auth import HTTPBasicAuth
|
||||||
|
|
||||||
|
PACKAGECLOUD_API_TOKEN = os.getenv('DOKKU_PACKAGECLOUD_API_TOKEN')
|
||||||
|
|
||||||
|
|
||||||
|
def download_file(filename, url):
|
||||||
|
r = requests.get(url, stream=True)
|
||||||
|
with open(filename, 'wb') as f:
|
||||||
|
shutil.copyfileobj(r.raw, f)
|
||||||
|
|
||||||
|
|
||||||
|
def upload_file(filename):
|
||||||
|
versions = [
|
||||||
|
"bionic",
|
||||||
|
]
|
||||||
|
cmd_template = "package_cloud push dokku/dokku/ubuntu/{0} {1}"
|
||||||
|
for version in versions:
|
||||||
|
cmd = cmd_template.format(version, filename)
|
||||||
|
subprocess.call(cmd, shell=True)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
auth = HTTPBasicAuth(PACKAGECLOUD_API_TOKEN, '')
|
||||||
|
base = requests.get('https://packagecloud.io/api/v1/repos/dokku/dokku/packages/deb/ubuntu/trusty.json',
|
||||||
|
auth=auth)
|
||||||
|
data = base.json()
|
||||||
|
urls = []
|
||||||
|
for package in data:
|
||||||
|
urls.append(package['versions_url'])
|
||||||
|
|
||||||
|
download_urls = {}
|
||||||
|
for url in urls:
|
||||||
|
base = requests.get('https://packagecloud.io{0}'.format(url),
|
||||||
|
auth=auth)
|
||||||
|
data = base.json()
|
||||||
|
for version in data:
|
||||||
|
download_urls['downloads/' + version['filename']] = version['download_url']
|
||||||
|
|
||||||
|
for filename, download_url in download_urls.items():
|
||||||
|
print "downloading", filename
|
||||||
|
download_file(filename, download_url)
|
||||||
|
upload_file(filename)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -10,7 +10,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
VERSION = 'v0.12.4'
|
VERSION = 'v0.13.2'
|
||||||
|
|
||||||
hostname = ''
|
hostname = ''
|
||||||
try:
|
try:
|
||||||
@@ -120,6 +120,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||||||
proc.stdin.close()
|
proc.stdin.close()
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
||||||
|
set_debconf_selection('boolean', 'nginx_enable', 'true')
|
||||||
set_debconf_selection('boolean', 'skip_key_file', 'true')
|
set_debconf_selection('boolean', 'skip_key_file', 'true')
|
||||||
set_debconf_selection('boolean', 'vhost_enable', vhost_enable)
|
set_debconf_selection('boolean', 'vhost_enable', vhost_enable)
|
||||||
set_debconf_selection('boolean', 'web_config', 'false')
|
set_debconf_selection('boolean', 'web_config', 'false')
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ main() {
|
|||||||
dokku-log-info "Waiting for old containers to stop"
|
dokku-log-info "Waiting for old containers to stop"
|
||||||
sleep 120
|
sleep 120
|
||||||
dokku-log-info "Cleaning up"
|
dokku-log-info "Cleaning up"
|
||||||
dokku cleanup
|
dokku cleanup --global
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ main() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
[[ " apps certs help ls nginx shell storage trace version " == *" $CMD "* ]] && unset APP
|
[[ " apps certs help ls nginx shell storage trace version " == *" $CMD "* ]] && unset APP
|
||||||
[[ " certs:chain domains:add-global domains:remove-global domains:set-global ps:rebuildall ps:restartall ps:restore " == *" $CMD "* ]] && unset APP
|
[[ " certs:chain domains:add-global domains:remove-global domains:set-global ps:rebuildall ps:restartall ps:restore ps:startall ps:stopall " == *" $CMD "* ]] && unset APP
|
||||||
[[ "$CMD" =~ events*|plugin*|ssh-keys* ]] && unset APP
|
[[ "$CMD" =~ events*|plugin*|ssh-keys* ]] && unset APP
|
||||||
[[ -n "$APP_ARG" ]] && [[ "$APP_ARG" == "--global" ]] && unset APP
|
[[ -n "$APP_ARG" ]] && [[ "$APP_ARG" == "--global" ]] && unset APP
|
||||||
[[ -n "$@" ]] && [[ -n "$APP" ]] && app_arg="--app $APP"
|
[[ -n "$@" ]] && [[ -n "$APP" ]] && app_arg="--app $APP"
|
||||||
|
|||||||
19
contrib/herokuish-build.Dockerfile
Normal file
19
contrib/herokuish-build.Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
FROM ubuntu:14.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||||
|
RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||||
|
|
||||||
|
ARG WORKDIR=/go/src/github.com/dokku/dokku
|
||||||
|
|
||||||
|
WORKDIR ${WORKDIR}
|
||||||
|
|
||||||
|
COPY . ${WORKDIR}
|
||||||
|
|
||||||
|
RUN make deb-herokuish rpm-herokuish
|
||||||
|
|
||||||
|
RUN mkdir -p /data \
|
||||||
|
&& cp /tmp/*.deb /data \
|
||||||
|
&& cp /tmp/*.rpm /data \
|
||||||
|
&& ls -lha /data/
|
||||||
@@ -267,6 +267,11 @@ fn-repo-update-history-and-commit() {
|
|||||||
|
|
||||||
HISTORY="# History"
|
HISTORY="# History"
|
||||||
HISTORY="${HISTORY}"$'\n\n'"## ${NEXT_VERSION}"
|
HISTORY="${HISTORY}"$'\n\n'"## ${NEXT_VERSION}"
|
||||||
|
HISTORY="${HISTORY}"$'\n\n'"Install/update via the bootstrap script:"
|
||||||
|
HISTORY="${HISTORY}"$'\n\n'"\`\`\`shell"
|
||||||
|
HISTORY="${HISTORY}"$'\n'"wget https://raw.githubusercontent.com/dokku/dokku/v${NEXT_VERSION}/bootstrap.sh"
|
||||||
|
HISTORY="${HISTORY}"$'\n'"sudo DOKKU_TAG=v${NEXT_VERSION} bash bootstrap.sh"
|
||||||
|
HISTORY="${HISTORY}"$'\n'"\`\`\`"
|
||||||
|
|
||||||
if [[ "$HISTORY_BUG" ]]; then
|
if [[ "$HISTORY_BUG" ]]; then
|
||||||
HISTORY="${HISTORY}"$'\n\n'"### Bug Fixes"
|
HISTORY="${HISTORY}"$'\n\n'"### Bug Fixes"
|
||||||
@@ -346,6 +351,10 @@ main() {
|
|||||||
fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
|
fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
|
||||||
|
|
||||||
fn-repo-push-tags "$IS_RELEASE"
|
fn-repo-push-tags "$IS_RELEASE"
|
||||||
|
if [[ "$IS_RELEASE" != "true" ]]; then
|
||||||
|
git reset -q HEAD plugins/*/plugin.toml
|
||||||
|
git checkout -- plugins/*/plugin.toml
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ fn-publish-package() {
|
|||||||
declare desc="Publishes a package to packagecloud"
|
declare desc="Publishes a package to packagecloud"
|
||||||
declare IS_RELEASE="$1" RELEASE_TYPE="$2" PACKAGE_NAME="$3"
|
declare IS_RELEASE="$1" RELEASE_TYPE="$2" PACKAGE_NAME="$3"
|
||||||
local REPOSITORY=dokku/dokku-betafish DIST=ubuntu
|
local REPOSITORY=dokku/dokku-betafish DIST=ubuntu
|
||||||
local OS_ID ex
|
local OS_ID ex EXIT_CODE=0
|
||||||
|
|
||||||
[[ "$IS_RELEASE" == "true" ]] && REPOSITORY=dokku/dokku
|
[[ "$IS_RELEASE" == "true" ]] && REPOSITORY=dokku/dokku
|
||||||
[[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7
|
[[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7
|
||||||
|
|||||||
156
contrib/release-herokuish
Executable file
156
contrib/release-herokuish
Executable file
@@ -0,0 +1,156 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
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 DOKKU_GIT_REV="$(git rev-parse HEAD)"
|
||||||
|
|
||||||
|
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN INT TERM EXIT
|
||||||
|
|
||||||
|
log-info() {
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
declare desc="Log info formatter"
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
log-error() {
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
declare desc="Log error formatter"
|
||||||
|
echo "! $*" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
log-fail() {
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
declare desc="Log fail formatter"
|
||||||
|
log-error "$*"
|
||||||
|
exit -1
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-build-dokku() {
|
||||||
|
declare desc="Builds dokku packages within a docker container"
|
||||||
|
|
||||||
|
pushd "$ROOT_DIR" >/dev/null
|
||||||
|
docker build \
|
||||||
|
-f "contrib/herokuish-build.Dockerfile" \
|
||||||
|
-t herokuish:build .
|
||||||
|
return "$?"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-extract-package() {
|
||||||
|
declare desc="Extract packages from a docker container to the root directory"
|
||||||
|
declare PACKAGE_NAME="$1"
|
||||||
|
|
||||||
|
if [[ -z "$PACKAGE_NAME" ]]; then
|
||||||
|
log-error "Invalid deb file specified"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path"
|
||||||
|
docker run --rm --entrypoint cat herokuish:build "/data/${PACKAGE_NAME}" > "${ROOT_DIR}/${PACKAGE_NAME}"
|
||||||
|
return "$?"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-publish-package() {
|
||||||
|
declare desc="Publishes a package to packagecloud"
|
||||||
|
declare IS_RELEASE="$1" RELEASE_TYPE="$2" PACKAGE_NAME="$3"
|
||||||
|
local REPOSITORY=dokku/dokku-betafish DIST=ubuntu
|
||||||
|
local OS_ID ex EXIT_CODE=0
|
||||||
|
|
||||||
|
[[ "$IS_RELEASE" == "true" ]] && REPOSITORY=dokku/dokku
|
||||||
|
[[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7
|
||||||
|
|
||||||
|
if [[ "$DIST" == "ubuntu" ]]; then
|
||||||
|
OS_IDS=("trusty" "utopic" "vivid" "wily" "xenial" "yakkety" "zesty" "artful" "bionic")
|
||||||
|
for OS_ID in "${OS_IDS[@]}"; do
|
||||||
|
log-info "(release-herokuish) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}"
|
||||||
|
package_cloud push "${REPOSITORY}/${DIST}/${OS_ID}" "$PACKAGE_NAME"
|
||||||
|
ex="$?"
|
||||||
|
if [[ "$ex" -ne "0" ]]; then
|
||||||
|
EXIT_CODE="$ex"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
DIST=debian
|
||||||
|
OS_IDS=("wheezy" "jessie" "stretch" "buster")
|
||||||
|
for OS_ID in "${OS_IDS[@]}"; do
|
||||||
|
log-info "(release-herokuish) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}"
|
||||||
|
package_cloud push "${REPOSITORY}/${DIST}/${OS_ID}" "$PACKAGE_NAME"
|
||||||
|
ex="$?"
|
||||||
|
if [[ "$ex" -ne "0" ]]; then
|
||||||
|
EXIT_CODE="$ex"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
log-info "(release-herokuish) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}"
|
||||||
|
package_cloud push "${REPOSITORY}/${DIST}" "$PACKAGE_NAME"
|
||||||
|
EXIT_CODE="$?"
|
||||||
|
fi
|
||||||
|
return "$EXIT_CODE"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-in-array() {
|
||||||
|
declare desc="return true if value ($1) is in list (all other arguments)"
|
||||||
|
|
||||||
|
local e
|
||||||
|
for e in "${@:2}"; do
|
||||||
|
[[ "$e" == "$1" ]] && return 0
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-is-release() {
|
||||||
|
declare desc="Checks if a given run is a release run"
|
||||||
|
declare RELEASE="$1"
|
||||||
|
local IS_RELEASE=false
|
||||||
|
if [[ "$RELEASE" == "major" ]] || [[ "$RELEASE" == "minor" ]] || [[ "$RELEASE" == "patch" ]]; then
|
||||||
|
IS_RELEASE=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$IS_RELEASE"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-require-bin() {
|
||||||
|
declare desc="Checks that a binary exists"
|
||||||
|
declare BINARY="$1"
|
||||||
|
if ! command -v "$BINARY" &>/dev/null; then
|
||||||
|
log-fail "Missing ${BINARY}, please install it"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
declare RELEASE="$1"
|
||||||
|
local NEXT_VERSION
|
||||||
|
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish")
|
||||||
|
|
||||||
|
if [[ "$RELEASE" == '--trace' ]]; then
|
||||||
|
shift 1
|
||||||
|
RELEASE="$1"
|
||||||
|
TRACE=1 && set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$RELEASE" ]]; then
|
||||||
|
log-fail "Argument 1 must be one of [major, minor, patch, betafish], none given"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! fn-in-array "$RELEASE" "${VALID_RELEASE_LEVELS[@]}"; then
|
||||||
|
log-fail "Argument 1 must be one of [major, minor, patch, betafish], '${RELEASE}' given"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fn-require-bin "docker"
|
||||||
|
fn-require-bin "package_cloud"
|
||||||
|
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable"
|
||||||
|
|
||||||
|
NEXT_VERSION="$(grep HEROKUISH_VERSION deb.mk | head -n1 | cut -d'=' -f2 | xargs)"
|
||||||
|
IS_RELEASE="$(fn-is-release "$RELEASE")"
|
||||||
|
|
||||||
|
fn-build-dokku || log-fail "Error building package"
|
||||||
|
|
||||||
|
fn-extract-package "herokuish_${NEXT_VERSION}_amd64.deb" || log-fail "Error extracting deb package"
|
||||||
|
fn-extract-package "herokuish-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
|
||||||
|
|
||||||
|
fn-publish-package "$IS_RELEASE" "deb" "herokuish_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
|
||||||
|
fn-publish-package "$IS_RELEASE" "rpm" "herokuish-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
4
deb.mk
4
deb.mk
@@ -1,6 +1,6 @@
|
|||||||
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
|
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
|
||||||
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
|
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
|
||||||
HEROKUISH_VERSION ?= 0.4.0
|
HEROKUISH_VERSION ?= 0.4.5
|
||||||
HEROKUISH_ARCHITECTURE = amd64
|
HEROKUISH_ARCHITECTURE = amd64
|
||||||
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
|
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
|
||||||
|
|
||||||
@@ -117,6 +117,7 @@ deb-dokku:
|
|||||||
mkdir -p /tmp/tmp /tmp/build
|
mkdir -p /tmp/tmp /tmp/build
|
||||||
|
|
||||||
cp -r debian /tmp/build/DEBIAN
|
cp -r debian /tmp/build/DEBIAN
|
||||||
|
mkdir -p /tmp/build/usr/share/bash-completion/completions
|
||||||
mkdir -p /tmp/build/usr/bin
|
mkdir -p /tmp/build/usr/bin
|
||||||
mkdir -p /tmp/build/usr/share/doc/dokku
|
mkdir -p /tmp/build/usr/share/doc/dokku
|
||||||
mkdir -p /tmp/build/usr/share/dokku/contrib
|
mkdir -p /tmp/build/usr/share/dokku/contrib
|
||||||
@@ -126,6 +127,7 @@ deb-dokku:
|
|||||||
|
|
||||||
cp dokku /tmp/build/usr/bin
|
cp dokku /tmp/build/usr/bin
|
||||||
cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
|
cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
|
||||||
|
cp contrib/bash-completion /tmp/build/usr/share/bash-completion/completions/dokku
|
||||||
find . -name ".DS_Store" -depth -exec rm {} \;
|
find . -name ".DS_Store" -depth -exec rm {} \;
|
||||||
$(MAKE) go-build
|
$(MAKE) go-build
|
||||||
cp common.mk /tmp/build/var/lib/dokku/core-plugins/common.mk
|
cp common.mk /tmp/build/var/lib/dokku/core-plugins/common.mk
|
||||||
|
|||||||
1
debian/config
vendored
1
debian/config
vendored
@@ -17,6 +17,7 @@ if [ $RET = "true" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
db_input "high" "dokku/nginx_enable" || true
|
||||||
db_input "high" "dokku/hostname" || true
|
db_input "high" "dokku/hostname" || true
|
||||||
db_input "high" "dokku/vhost_enable" || true
|
db_input "high" "dokku/vhost_enable" || true
|
||||||
if [ "$ACTION" != "reconfigure" ]; then
|
if [ "$ACTION" != "reconfigure" ]; then
|
||||||
|
|||||||
4
debian/control
vendored
4
debian/control
vendored
@@ -1,9 +1,9 @@
|
|||||||
Package: dokku
|
Package: dokku
|
||||||
Version: 0.12.4
|
Version: 0.13.2
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
Depends: locales, git, make, curl, gcc, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1) | docker-io (>= 1.9.1) | docker-ce | docker-ee, software-properties-common, python-software-properties | python3-software-properties, rsyslog
|
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
|
||||||
Recommends: herokuish (>= 0.3.4), parallel, dokku-update
|
Recommends: herokuish (>= 0.3.4), parallel, dokku-update
|
||||||
Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python2.7, debconf
|
Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python2.7, debconf
|
||||||
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||||
|
|||||||
6
debian/postinst
vendored
6
debian/postinst
vendored
@@ -59,9 +59,13 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
db_get "dokku/nginx_enable"
|
||||||
echo "Enabling all core plugins"
|
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
|
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
||||||
if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
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;
|
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}/core-plugins plugn enable $plugin
|
||||||
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
|
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
|
||||||
|
|||||||
5
debian/postrm
vendored
5
debian/postrm
vendored
@@ -21,7 +21,10 @@ main() {
|
|||||||
rm -f /etc/systemd/system/dokku-redeploy.service
|
rm -f /etc/systemd/system/dokku-redeploy.service
|
||||||
rm -f /etc/update-motd.d/99-dokku
|
rm -f /etc/update-motd.d/99-dokku
|
||||||
|
|
||||||
(nginx -t && service nginx reload) || true
|
db_get "dokku/nginx_enable"
|
||||||
|
if [ "$RET" = "true" ]; then
|
||||||
|
(nginx -t && service nginx reload) || true
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "purge" ]]; then
|
if [[ "$1" == "purge" ]]; then
|
||||||
rm -f /etc/nginx/conf.d/dokku.conf
|
rm -f /etc/nginx/conf.d/dokku.conf
|
||||||
|
|||||||
5
debian/templates
vendored
5
debian/templates
vendored
@@ -22,3 +22,8 @@ Template: dokku/key_file
|
|||||||
Description: Keyfile for initial user:
|
Description: Keyfile for initial user:
|
||||||
Type: string
|
Type: string
|
||||||
Default: /root/.ssh/id_rsa.pub
|
Default: /root/.ssh/id_rsa.pub
|
||||||
|
|
||||||
|
Template: dokku/nginx_enable
|
||||||
|
Description: Enable nginx-vhosts plugin?
|
||||||
|
Type: boolean
|
||||||
|
Default: true
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Once you have mounted persistent storage, you will also need to restart the appl
|
|||||||
[process scaling documentation](/docs/deployment/process-management.md) for more information.
|
[process scaling documentation](/docs/deployment/process-management.md) for more information.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku ps:rebuild app-name
|
dokku ps:restart app-name
|
||||||
```
|
```
|
||||||
|
|
||||||
A more complete workflow may require making a custom directory for your application and mounting it within your `/app/storage` directory instead. The mount point is *not* relative to your application's working directory, and is instead relative to the root of the container.
|
A more complete workflow may require making a custom directory for your application and mounting it within your `/app/storage` directory instead. The mount point is *not* relative to your application's working directory, and is instead relative to the root of the container.
|
||||||
@@ -132,7 +132,7 @@ Your app may have services that are running in memory and need to be backed up l
|
|||||||
By default, Dokku will only bind storage mounts during the deploy and run phases. Under certain conditions, one might want to bind a storage mount during the build phase. This can be accomplished by using the `docker-options` plugin directly.
|
By default, Dokku will only bind storage mounts during the deploy and run phases. Under certain conditions, one might want to bind a storage mount during the build phase. This can be accomplished by using the `docker-options` plugin directly.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku docker-options:add <app> build "-v /tmp/python-test:/opt/test"
|
dokku docker-options:add node-js-app build "-v /tmp/python-test:/opt/test"
|
||||||
```
|
```
|
||||||
|
|
||||||
You cannot use mounted volumes during the build phase of a Dockerfile deploy. This is because Docker does not support volumes when executing `docker build`.
|
You cannot use mounted volumes during the build phase of a Dockerfile deploy. This is because Docker does not support volumes when executing `docker build`.
|
||||||
@@ -147,4 +147,4 @@ By default, Dokku will execute your buildpack application processes as the `hero
|
|||||||
|
|
||||||
> NOTE: this user must exist in your herokuish image.
|
> NOTE: this user must exist in your herokuish image.
|
||||||
|
|
||||||
Additionally, Dokku will ensure your storage mounts are owned by either `herokuishuser` or the overridden value you have set in `DOKKU_APP_USER`.
|
Additionally, the default `docker-local` scheduler that comes with Dokku will ensure your storage mounts are owned by either `herokuishuser` or the overridden value you have set in `DOKKU_APP_USER`. See the [scheduler-docker-local documentation](/docs/advanced-usage/schedulers/docker-local.md#disabling-chown-of-persistent-storage) docs for more information.
|
||||||
|
|||||||
@@ -31,31 +31,31 @@ dokku plugin
|
|||||||
|
|
||||||
```
|
```
|
||||||
plugn: dev
|
plugn: dev
|
||||||
00_dokku-standard 0.12.4 enabled dokku core standard plugin
|
00_dokku-standard 0.13.2 enabled dokku core standard plugin
|
||||||
20_events 0.12.4 enabled dokku core events logging plugin
|
20_events 0.13.2 enabled dokku core events logging plugin
|
||||||
apps 0.12.4 enabled dokku core apps plugin
|
apps 0.13.2 enabled dokku core apps plugin
|
||||||
build-env 0.12.4 enabled dokku core build-env plugin
|
build-env 0.13.2 enabled dokku core build-env plugin
|
||||||
certs 0.12.4 enabled dokku core certificate management plugin
|
certs 0.13.2 enabled dokku core certificate management plugin
|
||||||
checks 0.12.4 enabled dokku core checks plugin
|
checks 0.13.2 enabled dokku core checks plugin
|
||||||
common 0.12.4 enabled dokku core common plugin
|
common 0.13.2 enabled dokku core common plugin
|
||||||
config 0.12.4 enabled dokku core config plugin
|
config 0.13.2 enabled dokku core config plugin
|
||||||
docker-options 0.12.4 enabled dokku core docker-options plugin
|
docker-options 0.13.2 enabled dokku core docker-options plugin
|
||||||
domains 0.12.4 enabled dokku core domains plugin
|
domains 0.13.2 enabled dokku core domains plugin
|
||||||
enter 0.12.4 enabled dokku core enter plugin
|
enter 0.13.2 enabled dokku core enter plugin
|
||||||
git 0.12.4 enabled dokku core git plugin
|
git 0.13.2 enabled dokku core git plugin
|
||||||
logs 0.12.4 enabled dokku core logs plugin
|
logs 0.13.2 enabled dokku core logs plugin
|
||||||
named-containers 0.12.4 enabled dokku core named containers plugin
|
named-containers 0.13.2 enabled dokku core named containers plugin
|
||||||
network 0.12.4 enabled dokku core network plugin
|
network 0.13.2 enabled dokku core network plugin
|
||||||
nginx-vhosts 0.12.4 enabled dokku core nginx-vhosts plugin
|
nginx-vhosts 0.13.2 enabled dokku core nginx-vhosts plugin
|
||||||
plugin 0.12.4 enabled dokku core plugin plugin
|
plugin 0.13.2 enabled dokku core plugin plugin
|
||||||
proxy 0.12.4 enabled dokku core proxy plugin
|
proxy 0.13.2 enabled dokku core proxy plugin
|
||||||
ps 0.12.4 enabled dokku core ps plugin
|
ps 0.13.2 enabled dokku core ps plugin
|
||||||
repo 0.12.4 enabled dokku core repo plugin
|
repo 0.13.2 enabled dokku core repo plugin
|
||||||
shell 0.12.4 enabled dokku core shell plugin
|
shell 0.13.2 enabled dokku core shell plugin
|
||||||
ssh-keys 0.12.4 enabled dokku core ssh-keys plugin
|
ssh-keys 0.13.2 enabled dokku core ssh-keys plugin
|
||||||
storage 0.12.4 enabled dokku core storage plugin
|
storage 0.13.2 enabled dokku core storage plugin
|
||||||
tags 0.12.4 enabled dokku core tags plugin
|
tags 0.13.2 enabled dokku core tags plugin
|
||||||
tar 0.12.4 enabled dokku core tar plugin
|
tar 0.13.2 enabled dokku core tar plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.
|
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# Docker Local Scheduler
|
# Docker Local Scheduler
|
||||||
|
|
||||||
|
> Subcommands new as of 0.12.12
|
||||||
|
|
||||||
|
```
|
||||||
|
scheduler-docker-local:report [<app>] [<flag>] # Displays a scheduler-docker-local report for one or more apps
|
||||||
|
scheduler-docker-local:set <app> <key> (<value>) # Set or clear a scheduler-docker-local property for an app
|
||||||
|
```
|
||||||
|
|
||||||
> New as of 0.12.0
|
> New as of 0.12.0
|
||||||
|
|
||||||
Dokku natively includes functionality to manage application lifecycles for a single server using the `scheduler-docker-local` plugin. It is the default scheduler, but as with all schedulers, it is set on a per-application basis. The scheduler can currently be overridden by running the following command:
|
Dokku natively includes functionality to manage application lifecycles for a single server using the `scheduler-docker-local` plugin. It is the default scheduler, but as with all schedulers, it is set on a per-application basis. The scheduler can currently be overridden by running the following command:
|
||||||
@@ -14,6 +21,22 @@ As it is the default, unsetting the `DOCKER_SCHEDULER` config variable is also a
|
|||||||
dokku config:unset node-js-app DOCKER_SCHEDULER
|
dokku config:unset node-js-app DOCKER_SCHEDULER
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Disabling chown of persistent storage
|
||||||
|
|
||||||
|
The `scheduler-docker-local` plugin will ensure your storage mounts are owned by either `herokuishuser` or the overridden value you have set in `DOKKU_APP_USER`. You may disable this by running the following `scheduler-docker-local:set` command for your application:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku scheduler-docker-local:set node-js-app disable-chown true
|
||||||
|
```
|
||||||
|
|
||||||
|
Once set, you may re-enable it by setting a blank value for `disable-chown`:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku scheduler-docker-local:set node-js-app disable-chown
|
||||||
|
```
|
||||||
|
|
||||||
## Implemented Triggers
|
## Implemented Triggers
|
||||||
|
|
||||||
This plugin implements various functionality through `plugn` triggers to integrate with Docker for running apps on a single server. The following functionality is supported by the `scheduler-docker-local` plugin.
|
This plugin implements various functionality through `plugn` triggers to integrate with Docker for running apps on a single server. The following functionality is supported by the `scheduler-docker-local` plugin.
|
||||||
@@ -25,6 +48,7 @@ This plugin implements various functionality through `plugn` triggers to integra
|
|||||||
- `pre-restore`
|
- `pre-restore`
|
||||||
- `scheduler-deploy`
|
- `scheduler-deploy`
|
||||||
- `scheduler-docker-cleanup`
|
- `scheduler-docker-cleanup`
|
||||||
|
- `scheduler-logs-failed`
|
||||||
- `scheduler-run`
|
- `scheduler-run`
|
||||||
- `scheduler-stop`
|
- `scheduler-stop`
|
||||||
- `scheduler-tags-create`
|
- `scheduler-tags-create`
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<browserconfig>
|
<browserconfig>
|
||||||
<msapplication>
|
<msapplication>
|
||||||
<tile>
|
<tile>
|
||||||
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/mstile-70x70.png"/>
|
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/mstile-70x70.png"/>
|
||||||
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/mstile-150x150.png"/>
|
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/mstile-150x150.png"/>
|
||||||
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/mstile-310x310.png"/>
|
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/mstile-310x310.png"/>
|
||||||
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/mstile-310x150.png"/>
|
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/mstile-310x150.png"/>
|
||||||
<TileColor>#da532c</TileColor>
|
<TileColor>#da532c</TileColor>
|
||||||
</tile>
|
</tile>
|
||||||
</msapplication>
|
</msapplication>
|
||||||
|
|||||||
@@ -2,37 +2,37 @@
|
|||||||
"name": "Dokku",
|
"name": "Dokku",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.4\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.2\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||||
"sizes": "36x36",
|
"sizes": "36x36",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "0.75"
|
"density": "0.75"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.4\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.2\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||||
"sizes": "48x48",
|
"sizes": "48x48",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.0"
|
"density": "1.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.4\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.2\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||||
"sizes": "72x72",
|
"sizes": "72x72",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.5"
|
"density": "1.5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.4\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.2\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||||
"sizes": "96x96",
|
"sizes": "96x96",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "2.0"
|
"density": "2.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.4\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.2\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||||
"sizes": "144x144",
|
"sizes": "144x144",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "3.0"
|
"density": "3.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.4\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "4.0"
|
"density": "4.0"
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ h1 {
|
|||||||
font-size: 1.6em;
|
font-size: 1.6em;
|
||||||
}
|
}
|
||||||
.header .navbar-brand a {
|
.header .navbar-brand a {
|
||||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/dokku.png);
|
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/dokku.png);
|
||||||
text-indent: 40px;
|
text-indent: 40px;
|
||||||
}
|
}
|
||||||
.blurb {
|
.blurb {
|
||||||
color: #424242;
|
color: #424242;
|
||||||
background-color: #ededed;
|
background-color: #ededed;
|
||||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/gplaypattern.png);
|
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/gplaypattern.png);
|
||||||
padding: 45px 0;
|
padding: 45px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"0.9.4",
|
"0.9.4",
|
||||||
"0.10.5",
|
"0.10.5",
|
||||||
"0.11.6",
|
"0.11.6",
|
||||||
"0.12.4"
|
"0.12.13",
|
||||||
|
"0.13.2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
106
docs/community/tutorials/deploying-with-gitlab-ci.md
Normal file
106
docs/community/tutorials/deploying-with-gitlab-ci.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
# Deploying with Gitlab CI
|
||||||
|
|
||||||
|
Gitlab-CI can be used to automatically deploy a Dokku application using the [ilyasemenov/gitlab-ci-git-push image](https://github.com/IlyaSemenov/gitlab-ci-git-push) docker image.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Make sure you have a Gitlab account and a Dokku project hosted on Gitlab. This method works whether if you are using buildpacks or Dockerfile.
|
||||||
|
|
||||||
|
Make sure you have set up an app on the remote machine following [these instructions](http://dokku.viewdocs.io/dokku/deployment/application-deployment/) and can successfully deploy to it from the local machine.
|
||||||
|
|
||||||
|
## Deploy automatically to production
|
||||||
|
|
||||||
|
### Add a secret variable
|
||||||
|
|
||||||
|
Browse to the repository in question and visit the following path: `the Gitlab project > Settings > CI/CD.`
|
||||||
|
|
||||||
|
Click on `Secret variables > Expand` and fill in the blanks.
|
||||||
|
|
||||||
|
- Key: `SSH_PRIVATE_KEY`
|
||||||
|
- Value: paste in an SSH private key registered in Dokku:
|
||||||
|
|
||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
...
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
|
|
||||||
|
- Environment scope: `production` (This make sure that `SSH_PRIVATE_KEY` is not available on merge requests or tests)
|
||||||
|
- Protected: Do not check this checkbox unless you know what you are doing
|
||||||
|
|
||||||
|
### Add CI script
|
||||||
|
|
||||||
|
Create a file named `.gitlab-ci.yml` at the root directory of the repository with the following contents:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
stages:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
variables:
|
||||||
|
APP_NAME: node-js-app
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: ilyasemenov/gitlab-ci-git-push
|
||||||
|
stage: deploy
|
||||||
|
environment:
|
||||||
|
name: production
|
||||||
|
url: https://$APP_NAME.dokku.me/
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
script:
|
||||||
|
- git-push ssh://dokku@dokku.me:22/$APP_NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
You will need to modify the `APP_NAME` variable to the correct value for your application name.
|
||||||
|
|
||||||
|
Running `git push origin master` will now trigger a gitlab-ci pipeline that will automatically deploy your application to your Dokku server. Go to your project on Gitlab and visit "Project > Pipelines" to see the deployment log.
|
||||||
|
|
||||||
|
|
||||||
|
## Review Applications
|
||||||
|
|
||||||
|
One useful feature of gitlab is to be able to create review applications for non-production branches. This allows teams to review changes _before_ they are pushed to production. First, recreate the `SSH_PRIVATE_KEY` secret - do not delete the existing secret - but scoped to the `review/*` environment. This will allow non-production gitlab environments access to the secret.
|
||||||
|
|
||||||
|
Next, we'll need to create the `review_app` gitlab job in our `.gitlab-ci.yaml`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
review_app:
|
||||||
|
image: ilyasemenov/gitlab-ci-git-push
|
||||||
|
stage: deploy
|
||||||
|
environment:
|
||||||
|
name: review/$CI_ENVIRONMENT_SLUG
|
||||||
|
url: https://$CI_ENVIRONMENT_SLUG.dokku.me/
|
||||||
|
on_stop: stop_review_app
|
||||||
|
only:
|
||||||
|
- branches
|
||||||
|
except:
|
||||||
|
- master
|
||||||
|
script:
|
||||||
|
- mkdir -p ~/.ssh && echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||||
|
- ssh-keyscan -H 22 "dokku.me" >> ~/.ssh/known_hosts
|
||||||
|
- ssh -t dokku@dokku.me -- apps:clone --ignore-existing --skip-deploy "$APP_NAME" "$CI_ENVIRONMENT_SLUG"
|
||||||
|
- git-push ssh://dokku@dokku.me:22/$CI_ENVIRONMENT_SLUG
|
||||||
|
```
|
||||||
|
|
||||||
|
The first two lines ensure that Gitlab can talk to the Dokku server. Next, we take advantage of the `apps:clone` command, and clone the existing application and all of it's configuration to a new location. If the new application already exists, the third line of the `script` step will be ignored. We also ignore the first deploy script to speed up the cloning process. Finally, the fourth line of the `script` step will deploy the code as normal.
|
||||||
|
|
||||||
|
The above only runs for non-master branches, and will _also_ trigger an `on_stop` job called `stop_review_app`. When the branch is deleted or the code is merged, the `stop_review_app` job will be triggered.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
stop_review_app:
|
||||||
|
image: ilyasemenov/gitlab-ci-git-push
|
||||||
|
stage: deploy
|
||||||
|
environment:
|
||||||
|
name: review/$CI_ENVIRONMENT_SLUG
|
||||||
|
action: stop
|
||||||
|
when: manual
|
||||||
|
script:
|
||||||
|
- mkdir -p ~/.ssh && echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||||
|
- ssh-keyscan -H 22 "dokku.me" >> ~/.ssh/known_hosts
|
||||||
|
- ssh -t dokku@dokku.me -- --force apps:destroy "$CI_ENVIRONMENT_SLUG"
|
||||||
|
```
|
||||||
|
|
||||||
|
The `stop_review_app` step will delete the temporary application, cleaning up now unused server resources.
|
||||||
|
|
||||||
|
Going further, the following modifications can be done:
|
||||||
|
|
||||||
|
- Notify via chat whenever a review application is created/destroyed.
|
||||||
|
- Push to a separate, staging server as opposed to a production server.
|
||||||
|
- Clone a "staging" application so that review applications do not affect production datasets.
|
||||||
@@ -3,7 +3,10 @@
|
|||||||
In order to leverage cloud-provider facilities like _attachable volumes_, (_a.k.a. block storage_)
|
In order to leverage cloud-provider facilities like _attachable volumes_, (_a.k.a. block storage_)
|
||||||
the following is an easy tutorial to achieve Dokku runs on them.
|
the following is an easy tutorial to achieve Dokku runs on them.
|
||||||
|
|
||||||
|
> Warning: If the block storage is not available and attached on boot it is possible that containers will not correctly start. Please keep this in mind when considering moving Dokku and/or Docker to network attached storage.
|
||||||
|
|
||||||
## Tutorial
|
## Tutorial
|
||||||
|
|
||||||
The following is intended to be executed on the dokku host machine as `root`.
|
The following is intended to be executed on the dokku host machine as `root`.
|
||||||
Say, _for instance_, that our volume is mapped into the systems as `/dev/vdb1`.
|
Say, _for instance_, that our volume is mapped into the systems as `/dev/vdb1`.
|
||||||
|
|
||||||
|
|||||||
@@ -131,13 +131,29 @@ Create the file at `/etc/nginx/conf.d/00-default-vhost.conf`:
|
|||||||
|
|
||||||
```nginx
|
```nginx
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
listen [::]:80 default_server;
|
server_name _;
|
||||||
|
access_log off;
|
||||||
server_name _;
|
return 410;
|
||||||
return 410;
|
|
||||||
log_not_found off;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# To handle HTTPS requests, you can uncomment the following section.
|
||||||
|
#
|
||||||
|
# Please note that in order to let this work as expected, you need a valid
|
||||||
|
# SSL certificate for any domains being served. Browsers will show SSL
|
||||||
|
# errors in all other cases.
|
||||||
|
#
|
||||||
|
# Note that the key and certificate files in the below example need to
|
||||||
|
# be copied into /etc/nginx/ssl/ folder.
|
||||||
|
#
|
||||||
|
# server {
|
||||||
|
# listen 443 ssl;
|
||||||
|
# server_name _;
|
||||||
|
# ssl_certificate /etc/nginx/ssl/cert.crt;
|
||||||
|
# ssl_certificate_key /etc/nginx/ssl/cert.key;
|
||||||
|
# access_log off;
|
||||||
|
# return 410;
|
||||||
|
# }
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure to reload nginx after creating this file by running `service nginx reload`.
|
Make sure to reload nginx after creating this file by running `service nginx reload`.
|
||||||
|
|||||||
@@ -5,14 +5,17 @@ Typically an application will require some configuration to run properly. Dokku
|
|||||||
The `config` plugin provides the following commands to manage your variables:
|
The `config` plugin provides the following commands to manage your variables:
|
||||||
|
|
||||||
```
|
```
|
||||||
config (<app>|--global) Display all global or app-specific config vars
|
config (<app>|--global) Pretty-print an app or global environment
|
||||||
config:get (<app>|--global) KEY Display a global or app-specific config value
|
config:get (<app>|--global) KEY Display a global or app-specific config value
|
||||||
config:set (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
|
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
|
||||||
config:unset (<app>|--global) KEY1 [KEY2 ...] Unset one or more config vars
|
config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...] Unset one or more config vars
|
||||||
config:export [--format=FORMAT] [--merged] (<app>|--global) Export all global or app-specific configuration
|
config:export (<app>|--global) [--envfile] Export a global or app environment
|
||||||
|
config:keys (<app>|--global) [--merged] Show keys set in environment
|
||||||
|
config:bundle (<app>|--global) [--merged] Bundle environment into tarfile
|
||||||
```
|
```
|
||||||
|
> For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860).
|
||||||
|
|
||||||
The variables are available both at run time and during the application build/compilation step for buildpack-based deploys. For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860).
|
Environment variables are available both at run time and during the application build/compilation step for buildpack-based deploys.
|
||||||
|
|
||||||
For buildpack deploys, Dokku will create a `/app/.env` file that can be used for legacy buildpacks. Note that this is *not* updated when `config:set` or `config:unset` is called, and is only written during a `deploy` or `ps:rebuild`. Developers are encouraged to instead read from the application environment directly, as the proper values will be available then.
|
For buildpack deploys, Dokku will create a `/app/.env` file that can be used for legacy buildpacks. Note that this is *not* updated when `config:set` or `config:unset` is called, and is only written during a `deploy` or `ps:rebuild`. Developers are encouraged to instead read from the application environment directly, as the proper values will be available then.
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,16 @@ Your `nginx.conf` file - not to be confused with Dokku's `nginx.conf.sigil` - wo
|
|||||||
|
|
||||||
Please adjust the `Procfile` and `nginx.conf` file as appropriate.
|
Please adjust the `Procfile` and `nginx.conf` file as appropriate.
|
||||||
|
|
||||||
|
## Custom Error Pages
|
||||||
|
|
||||||
|
By default, Dokku provides custom error pages for the following three categories of errors:
|
||||||
|
|
||||||
|
- 4xx: For all non-404 errors with a 4xx response code.
|
||||||
|
- 404: For "404 Not Found" errors.
|
||||||
|
- 5xx: For all 5xx error responses
|
||||||
|
|
||||||
|
These are provided as an alternative to the generic Nginx error page, are shared for _all_ applications, and their contents are located on disk at `/var/lib/dokku/data/nginx-vhosts/dokku-errors`. To customize them for a specific app, create a custom `nginx.conf.sigil` as described above and change the paths to point elsewhere.
|
||||||
|
|
||||||
## Domains plugin
|
## Domains plugin
|
||||||
|
|
||||||
See the [domain configuration documentation](/docs/configuration/domains.md).
|
See the [domain configuration documentation](/docs/configuration/domains.md).
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Deploying to Dokku
|
# Deploying to Dokku
|
||||||
|
|
||||||
|
> Note: This document uses the hostname `dokku.me` in commands. For your server please
|
||||||
|
> substitute your server's hostname instead.
|
||||||
|
|
||||||
## Deploy tutorial
|
## Deploy tutorial
|
||||||
|
|
||||||
Once Dokku has been configured with at least one user, applications can be deployed via a `git push` command. To quickly see Dokku deployment in action, you can use the Heroku Ruby on Rails example app.
|
Once Dokku has been configured with at least one user, applications can be deployed via a `git push` command. To quickly see Dokku deployment in action, you can use the Heroku Ruby on Rails example app.
|
||||||
@@ -63,6 +66,10 @@ git push dokku master
|
|||||||
> the upstream with the scheme `ssh://` like so: `ssh://dokku@dokku.me:ruby-rails-sample`
|
> the upstream with the scheme `ssh://` like so: `ssh://dokku@dokku.me:ruby-rails-sample`
|
||||||
> Please see the [Git](https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a) documentation for more details.
|
> Please see the [Git](https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a) documentation for more details.
|
||||||
|
|
||||||
|
> Note: Your private key should be registered with ssh-agent in local development. If you get a
|
||||||
|
> permission denied error when pushing you can register your private key by running
|
||||||
|
> `ssh-add -k ~/<your private key>`.
|
||||||
|
|
||||||
```
|
```
|
||||||
Counting objects: 231, done.
|
Counting objects: 231, done.
|
||||||
Delta compression using up to 8 threads.
|
Delta compression using up to 8 threads.
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ apps:create <app> # Create a new app
|
|||||||
apps:destroy <app> # Permanently destroy an app
|
apps:destroy <app> # Permanently destroy an app
|
||||||
apps:exists <app> # Checks if an app exists
|
apps:exists <app> # Checks if an app exists
|
||||||
apps:list # List your apps
|
apps:list # List your apps
|
||||||
apps:lock # Creates a '.deploy.lock' file in an application's repo
|
apps:lock <app> # Locks an app for deployment
|
||||||
|
apps:locked <app> # Checks if an app is locked for deployment
|
||||||
apps:rename <old-app> <new-app> # Rename an app
|
apps:rename <old-app> <new-app> # Rename an app
|
||||||
apps:report [<app>] [<flag>] # Display report about an app
|
apps:report [<app>] [<flag>] # Display report about an app
|
||||||
apps:unlock # Removes the '.deploy.lock' file from an application's repo
|
apps:unlock <app> # Unlocks an app for deployment
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -158,6 +159,12 @@ By default, Dokku will deploy this new application, though you can skip the depl
|
|||||||
dokku apps:clone --skip-deploy node-js-app io-js-app
|
dokku apps:clone --skip-deploy node-js-app io-js-app
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Finally, if the application already exists, you may wish to ignore errors resulting from attempting to clone over it. To do so, you can use the `--ignore-existing` flag. A warning will be emitted, but the command will return 0.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku apps:clone --ignore-existing node-js-app io-js-app
|
||||||
|
```
|
||||||
|
|
||||||
### Locking app deploys
|
### Locking app deploys
|
||||||
|
|
||||||
> New as of 0.11.6
|
> New as of 0.11.6
|
||||||
@@ -187,10 +194,25 @@ dokku apps:unlock node-js-app
|
|||||||
|
|
||||||
```
|
```
|
||||||
! A deploy may be in progress.
|
! A deploy may be in progress.
|
||||||
! Removing the application lock will not stop in progress deploys.
|
! Removing the app lock will not stop in progress deploys.
|
||||||
-----> Deploy lock removed.
|
-----> Deploy lock removed.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Checking lock status
|
||||||
|
|
||||||
|
> New as of 0.13.0
|
||||||
|
|
||||||
|
In some cases, you may wish to inspect the state of an app lock. To do so, you can issue an `apps:lock` command. This will exit non-zero if there is no app lock in place.
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku apps:locked node-js-app
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Deploy lock does not exist
|
||||||
|
```
|
||||||
|
|
||||||
### Displaying reports about an app
|
### Displaying reports about an app
|
||||||
|
|
||||||
> New as of 0.8.1
|
> New as of 0.8.1
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
# Log Management
|
# Log Management
|
||||||
|
|
||||||
```
|
```
|
||||||
logs <app> # display recent log output
|
logs <app> [-h] [-t] [-n num] [-q] [-p process] # Display recent log output
|
||||||
|
logs:failed [<app>] # Shows the last failed deploy logs
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Application Logs
|
### App Logs
|
||||||
You can easily get logs of an application using the `logs` command:
|
|
||||||
|
You can easily get logs of an app using the `logs` command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku logs node-js-app
|
dokku logs node-js-app
|
||||||
```
|
```
|
||||||
|
|
||||||
## Behavioral modifiers
|
#### Behavioral modifiers
|
||||||
|
|
||||||
Dokku also supports certain command-line arguments that augment the `log` command's behavior.
|
Dokku also supports certain command-line arguments that augment the `log` command's behavior.
|
||||||
|
|
||||||
@@ -26,8 +28,25 @@ Dokku also supports certain command-line arguments that augment the `log` comman
|
|||||||
|
|
||||||
You can use these modifiers as follows:
|
You can use these modifiers as follows:
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku logs node-js-app -t -p web
|
dokku logs node-js-app -t -p web
|
||||||
```
|
```
|
||||||
will show logs continually from the web process.
|
will show logs continually from the web process.
|
||||||
|
|
||||||
|
### Failed Deploy Logs
|
||||||
|
|
||||||
|
> Warning: The default `docker-local` scheduler will "store" these until the next deploy or until the old containers are garbage collected - whichever runs first. If you require the logs beyond this point in time, please ship the logs to a centralized log server.
|
||||||
|
|
||||||
|
In some cases, it may be useful to retrieve the logs from a previously failed deploy.
|
||||||
|
|
||||||
|
You can retrieve these logs by using the `logs:failed` command
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku logs:failed node-js-app
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also retrieve the failed logs for each app:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku logs:failed node-js-app
|
||||||
|
```
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ dokku git:set --global deploy-branch SOME_BRANCH_NAME
|
|||||||
dokku git:set node-js-app deploy-branch SOME_BRANCH_NAME
|
dokku git:set node-js-app deploy-branch SOME_BRANCH_NAME
|
||||||
```
|
```
|
||||||
|
|
||||||
Pushing multiple branches can also be supportec by creating a [receive-branch](/docs/development/plugin-triggers.md#receive-branch) plugin trigger in a custom plugin.
|
Pushing multiple branches can also be supported by creating a [receive-branch](/docs/development/plugin-triggers.md#receive-branch) plugin trigger in a custom plugin.
|
||||||
|
|
||||||
### Configuring the GIT_REV Environment Variable
|
### Configuring the GIT_REV Environment Variable
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
```
|
```
|
||||||
ps <app> # List processes running in app container(s)
|
ps <app> # List processes running in app container(s)
|
||||||
|
ps:inspect <app> # Displays a sanitized version of docker inspect for an app
|
||||||
ps:rebuild <app> # Rebuild an app from source
|
ps:rebuild <app> # Rebuild an app from source
|
||||||
ps:rebuildall # Rebuild all apps from source
|
ps:rebuildall # Rebuild all apps from source
|
||||||
ps:report [<app>] [<flag>] # Displays a process report for one or more apps
|
ps:report [<app>] [<flag>] # Displays a process report for one or more apps
|
||||||
@@ -13,6 +14,7 @@ ps:restartall # Restart all deployed app contai
|
|||||||
ps:scale <app> <proc>=<count> [<proc>=<count>] # Get/Set how many instances of a given process to run
|
ps:scale <app> <proc>=<count> [<proc>=<count>] # Get/Set how many instances of a given process to run
|
||||||
ps:set-restart-policy <app> <policy> # Sets app restart-policy
|
ps:set-restart-policy <app> <policy> # Sets app restart-policy
|
||||||
ps:start <app> # Start app container(s)
|
ps:start <app> # Start app container(s)
|
||||||
|
ps:startall # Start all deployed app containers
|
||||||
ps:stop <app> # Stop app container(s)
|
ps:stop <app> # Stop app container(s)
|
||||||
ps:stopall # Stop all app container(s)
|
ps:stopall # Stop all app container(s)
|
||||||
```
|
```
|
||||||
@@ -31,6 +33,18 @@ To find out if your application's containers are running the commands you expect
|
|||||||
dokku ps node-js-app
|
dokku ps node-js-app
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Inspecting app containers
|
||||||
|
|
||||||
|
> New as of 0.13.0
|
||||||
|
|
||||||
|
A common administrative task to perform is calling `docker inspect` on the containers that are running for an application. This can be an error-prone task to perform, and may also reveal sensitive environment variables if not done correctly. Dokku provides a wrapper around this command via the `ps:inspect` subcommand:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku ps:inspect node-js-app
|
||||||
|
```
|
||||||
|
|
||||||
|
This command will gather all the running container IDs for your application and call `docker inspect`, sanitizing the output data so it can be copy-pasted elsewhere safely.
|
||||||
|
|
||||||
### Rebuilding applications
|
### Rebuilding applications
|
||||||
|
|
||||||
There are some Dokku commands which will not automatically rebuild an application's environment, or which can be told to skip a rebuild. For instance, you may wish to run multiple `config:set` commands without a restart so as to speed up configuration. In these cases, you can ultimately trigger an application rebuild using `ps:rebuild`
|
There are some Dokku commands which will not automatically rebuild an application's environment, or which can be told to skip a rebuild. For instance, you may wish to run multiple `config:set` commands without a restart so as to speed up configuration. In these cases, you can ultimately trigger an application rebuild using `ps:rebuild`
|
||||||
@@ -114,6 +128,16 @@ All stopped containers can be started using the `ps:start` command. This is simi
|
|||||||
dokku ps:start node-js-app
|
dokku ps:start node-js-app
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Starting all applications
|
||||||
|
|
||||||
|
In some cases, it may be necessary to start all applications from scratch - eg. if all Docker containers have been manually stopped. This can be executed via the `ps:startall` command, which supports parallelism in the same manner `ps:rebuildall`, `ps:restartall`, and `ps:stopall` do.
|
||||||
|
|
||||||
|
Be aware that no action will be taken if the application containers are running.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku ps:startall
|
||||||
|
```
|
||||||
|
|
||||||
## Restart Policies
|
## Restart Policies
|
||||||
|
|
||||||
> New as of 0.7.0
|
> New as of 0.7.0
|
||||||
|
|||||||
@@ -50,20 +50,13 @@ b7:76:27:4f:30:90:21:ae:d4:1e:70:20:35:3f:06:d6
|
|||||||
|
|
||||||
> `KEY_NAME` is a unique name which is used to identify public keys. Attempting to re-use a key name will result in an error. The ssh (git) user is *always* `dokku`, as this is the system user that the `dokku` binary uses to perform all it's actions.
|
> `KEY_NAME` is a unique name which is used to identify public keys. Attempting to re-use a key name will result in an error. The ssh (git) user is *always* `dokku`, as this is the system user that the `dokku` binary uses to perform all it's actions.
|
||||||
|
|
||||||
Admin users and root can also add keys remotely:
|
Admin users and root can add keys remotely by specifying the `dokku` bin on their `ssh` command:
|
||||||
|
|
||||||
```shell
|
|
||||||
cat ~/.ssh/id_rsa.pub | ssh dokku@dokku.me ssh-keys:add KEY_NAME
|
|
||||||
```
|
|
||||||
|
|
||||||
If you are using an ssh user other than `dokku`, then you'll also need to specify the `dokku` bin:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cat ~/.ssh/id_rsa.pub | ssh root@dokku.me dokku ssh-keys:add KEY_NAME
|
cat ~/.ssh/id_rsa.pub | ssh root@dokku.me dokku ssh-keys:add KEY_NAME
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you are using the vagrant installation, you can also use the `make vagrant-acl-add` target to add your public key to Dokku (it will use your host username as the `USER`):
|
||||||
Finally, if you are using the vagrant installation, you can also use the `make vagrant-acl-add` target to add your public key to Dokku (it will use your host username as the `USER`):
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
|
cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
|
||||||
|
|||||||
@@ -29,6 +29,30 @@ 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.
|
> 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-urls`
|
||||||
|
|
||||||
|
- Description: Allows you to change the urls Dokku reports for an application. Will override any auto-detected urls.
|
||||||
|
- Invoked by: `dokku deploy`, `dokku url`, and `dokku urls`
|
||||||
|
- Arguments: `$APP $URL_TYPE`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Sets the domain to `internal.tld`
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
APP="$1"; URL_TYPE="$2"
|
||||||
|
case "$URL_TYPE" in
|
||||||
|
url)
|
||||||
|
echo "https://internal.tld/${APP}/"
|
||||||
|
;;
|
||||||
|
urls)
|
||||||
|
echo "https://internal.tld/${APP}/"
|
||||||
|
echo "http://internal.tld/${APP}/"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
```
|
||||||
|
|
||||||
### `check-deploy`
|
### `check-deploy`
|
||||||
|
|
||||||
- Description: Allows you to run checks on a deploy before Dokku allows the container to handle requests.
|
- Description: Allows you to run checks on a deploy before Dokku allows the container to handle requests.
|
||||||
@@ -349,6 +373,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `network-clear-config`
|
||||||
|
|
||||||
|
- Description: Clears network configuration
|
||||||
|
- Invoked by: `internally triggered by proxy-clear-config within proxy implementations`
|
||||||
|
- Arguments: `$APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
### `network-compute-ports`
|
### `network-compute-ports`
|
||||||
|
|
||||||
- Description: Computes the ports for a given app container
|
- Description: Computes the ports for a given app container
|
||||||
@@ -1016,6 +1055,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `proxy-clear-config`
|
||||||
|
|
||||||
|
- Description: Clears the proxy implementation configuration for a given app
|
||||||
|
- Invoked by: `internally triggered by apps:rename`
|
||||||
|
- Arguments: `$APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
### `proxy-enable`
|
### `proxy-enable`
|
||||||
|
|
||||||
- Description: Enables the configured proxy implementation for an app
|
- Description: Enables the configured proxy implementation for an app
|
||||||
@@ -1123,9 +1177,12 @@ APP="$1";
|
|||||||
|
|
||||||
### `scheduler-deploy`
|
### `scheduler-deploy`
|
||||||
|
|
||||||
|
> 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 deployed
|
- Description: Allows you to run scheduler commands when an app is deployed
|
||||||
- Invoked by: `dokku deploy`
|
- Invoked by: `dokku deploy`
|
||||||
- Arguments: `$DOKKU_SCHEDULER APP IMAGE_TAG`
|
- Arguments: `$DOKKU_SCHEDULER $APP $IMAGE_TAG`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -1139,9 +1196,12 @@ DOKKU_SCHEDULER="$1"; APP="$2"; IMAGE_TAG="$3";
|
|||||||
|
|
||||||
### `scheduler-docker-cleanup`
|
### `scheduler-docker-cleanup`
|
||||||
|
|
||||||
|
> 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 dokku cleanup is invoked
|
- Description: Allows you to run scheduler commands when dokku cleanup is invoked
|
||||||
- Invoked by: `dokku deploy, dokku cleanup`
|
- Invoked by: `dokku deploy, dokku cleanup`
|
||||||
- Arguments: `$DOKKU_SCHEDULER APP FORCE_CLEANUP`
|
- Arguments: `$DOKKU_SCHEDULER $APP $FORCE_CLEANUP`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -1153,11 +1213,52 @@ DOKKU_SCHEDULER="$1"; APP="$2"; FORCE_CLEANUP="$3";
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `scheduler-inspect`
|
||||||
|
|
||||||
|
> 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 inspect commands for all containers for a given app
|
||||||
|
- Invoked by: `dokku ps:inspect`
|
||||||
|
- Arguments: `$DOKKU_SCHEDULER $APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
DOKKU_SCHEDULER="$1"; APP="$2";
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
|
### `scheduler-logs-failed`
|
||||||
|
|
||||||
|
> 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 retrieving failed container logs
|
||||||
|
- Invoked by: `dokku logs:failed`
|
||||||
|
- Arguments: `$DOKKU_SCHEDULER $APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
DOKKU_SCHEDULER="$1"; APP="$2"; ARGS="${@:3}";
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
### `scheduler-run`
|
### `scheduler-run`
|
||||||
|
|
||||||
|
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||||
|
> between minor releases until the 1.0 release.
|
||||||
|
|
||||||
- Description: Allows you to run scheduler commands when a command is executed for your app
|
- Description: Allows you to run scheduler commands when a command is executed for your app
|
||||||
- Invoked by: `dokku run`
|
- Invoked by: `dokku run`
|
||||||
- Arguments: `$DOKKU_SCHEDULER APP ...ARGS`
|
- Arguments: `$DOKKU_SCHEDULER $APP ...ARGS`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -1171,9 +1272,12 @@ DOKKU_SCHEDULER="$1"; APP="$2"; ARGS="${@:3}";
|
|||||||
|
|
||||||
### `scheduler-stop`
|
### `scheduler-stop`
|
||||||
|
|
||||||
|
> 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 a tag is destroyed
|
- Description: Allows you to run scheduler commands when a tag is destroyed
|
||||||
- Invoked by: `dokku apps:destroy, dokku ps:stop`
|
- Invoked by: `dokku apps:destroy, dokku ps:stop`
|
||||||
- Arguments: `$DOKKU_SCHEDULER APP REMOVE_CONTAINERS`
|
- Arguments: `$DOKKU_SCHEDULER $APP $REMOVE_CONTAINERS`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -1187,9 +1291,12 @@ DOKKU_SCHEDULER="$1"; APP="$2"; REMOVE_CONTAINERS="$3";
|
|||||||
|
|
||||||
### `scheduler-tags-create`
|
### `scheduler-tags-create`
|
||||||
|
|
||||||
|
> 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 a tag is created
|
- Description: Allows you to run scheduler commands when a tag is created
|
||||||
- Invoked by: `dokku tags:create`
|
- Invoked by: `dokku tags:create`
|
||||||
- Arguments: `$DOKKU_SCHEDULER APP SOURCE_IMAGE TARGET_IMAGE`
|
- Arguments: `$DOKKU_SCHEDULER $APP $SOURCE_IMAGE $TARGET_IMAGE`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -1203,9 +1310,12 @@ DOKKU_SCHEDULER="$1" APP="$2" SOURCE_IMAGE="$3" TARGET_IMAGE="$4"
|
|||||||
|
|
||||||
### `scheduler-tags-destroy`
|
### `scheduler-tags-destroy`
|
||||||
|
|
||||||
|
> 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 a tag is destroyed
|
- Description: Allows you to run scheduler commands when a tag is destroyed
|
||||||
- Invoked by: `dokku tags:destroy`
|
- Invoked by: `dokku tags:destroy`
|
||||||
- Arguments: `$DOKKU_SCHEDULER APP IMAGE_REPO IMAGE_TAG`
|
- Arguments: `$DOKKU_SCHEDULER $APP $IMAGE_REPO $IMAGE_TAG`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ The workflow looks like this:
|
|||||||
```shell
|
```shell
|
||||||
# having dokku-arch in ../dokku-arch
|
# having dokku-arch in ../dokku-arch
|
||||||
vagrant up build-arch
|
vagrant up build-arch
|
||||||
# wait for "==> build-arch: ==> Finished making: dokku 0.12.4-2 (Mon Feb 22 23:20:37 CET 2016)"
|
# wait for "==> build-arch: ==> Finished making: dokku 0.13.2-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||||
cd ../dokku-arch
|
cd ../dokku-arch
|
||||||
git add PKGBUILD .SRCINFO
|
git add PKGBUILD .SRCINFO
|
||||||
git commit -m 'Update to dokku 0.9.9'
|
git commit -m 'Update to dokku 0.9.9'
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ Follow the [user management documentation](/docs/deployment/user-management.md)
|
|||||||
|
|
||||||
## VMs with less than 1GB of memory
|
## VMs with less than 1GB of memory
|
||||||
|
|
||||||
Having less than 1GB of system memory available for Dokku and its containers, for example Digital Ocean's small 512MB machines, might result in unexpected errors, such as **! [remote rejected] master -> master (pre-receive hook declined)** during installation of NPM dependencies (https://github.com/npm/npm/issues/3867).
|
Having less than 1GB of system memory available for Dokku and its containers may result in unexpected errors, such as **! [remote rejected] master -> master (pre-receive hook declined)** during installation of NPM dependencies (https://github.com/npm/npm/issues/3867).
|
||||||
|
|
||||||
To work around this issue, it might suffice to augment the linux swap file size to a maximum of twice the physical memory size.
|
To work around this issue, it might suffice to augment the linux swap file size to a maximum of twice the physical memory size.
|
||||||
|
|
||||||
@@ -80,4 +80,5 @@ free
|
|||||||
|
|
||||||
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
|
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
|
||||||
```
|
```
|
||||||
Reference: https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps
|
|
||||||
|
[Reference](https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps)
|
||||||
|
|||||||
@@ -41,3 +41,4 @@ After setting the desired options, proceed with the installation as described ab
|
|||||||
| dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
|
| dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
|
||||||
| dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. |
|
| dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. |
|
||||||
| dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) |
|
| dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) |
|
||||||
|
| dokku/nginx_enable | boolean | true | Enable nginx-vhosts plugin |
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ To install the latest stable version of dokku, you can run the following shell c
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# for debian systems, installs Dokku via apt-get
|
# for debian systems, installs Dokku via apt-get
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.12.4/bootstrap.sh;
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.2/bootstrap.sh;
|
||||||
sudo DOKKU_TAG=v0.12.4 bash bootstrap.sh
|
sudo DOKKU_TAG=v0.13.2 bash bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||||
|
|||||||
@@ -10,30 +10,30 @@
|
|||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
||||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-57x57.png">
|
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-60x60.png">
|
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-72x72.png">
|
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-76x76.png">
|
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-114x114.png">
|
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-120x120.png">
|
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-144x144.png">
|
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-152x152.png">
|
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/manifest.json">
|
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/manifest.json">
|
||||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon.ico">
|
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<meta name="msapplication-TileColor" content="#da532c">
|
||||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/mstile-144x144.png">
|
||||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/browserconfig.xml">
|
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/browserconfig.xml">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/style.css" rel="stylesheet">
|
<link href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/style.css" rel="stylesheet">
|
||||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
@@ -98,12 +98,12 @@
|
|||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</span>
|
<span class="prompt">$</span>
|
||||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.12.4/bootstrap.sh</span>
|
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.13.2/bootstrap.sh</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</span>
|
<span class="prompt">$</span>
|
||||||
<span class="command">sudo DOKKU_TAG=v0.12.4 bash bootstrap.sh</span>
|
<span class="command">sudo DOKKU_TAG=v0.13.2 bash bootstrap.sh</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<footer>
|
<footer>
|
||||||
<p>© 2013-2017 Dokku</p>
|
<p>© 2013-2018 Dokku</p>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -9,26 +9,26 @@
|
|||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-57x57.png">
|
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-60x60.png">
|
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-72x72.png">
|
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-76x76.png">
|
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-114x114.png">
|
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-120x120.png">
|
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-144x144.png">
|
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-152x152.png">
|
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/manifest.json">
|
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/manifest.json">
|
||||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/favicon.ico">
|
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<meta name="msapplication-TileColor" content="#da532c">
|
||||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/mstile-144x144.png">
|
||||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/favicons/browserconfig.xml">
|
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/browserconfig.xml">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.12.4/docs/assets/style.css" rel="stylesheet">
|
<link href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/style.css" rel="stylesheet">
|
||||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
@@ -174,6 +174,7 @@
|
|||||||
<a href="/{{NAME}}/community/plugins/" class="list-group-item">Plugins</a>
|
<a href="/{{NAME}}/community/plugins/" class="list-group-item">Plugins</a>
|
||||||
|
|
||||||
<a href="#" class="list-group-item disabled">Community Tutorials</a>
|
<a href="#" class="list-group-item disabled">Community Tutorials</a>
|
||||||
|
<a href="/{{NAME}}/community/tutorials/deploying-with-gitlab-ci/" class="list-group-item">Deploying with Gitlab CI</a>
|
||||||
<a href="/{{NAME}}/community/tutorials/run-on-external-volume/" class="list-group-item">Run on External Volume</a>
|
<a href="/{{NAME}}/community/tutorials/run-on-external-volume/" class="list-group-item">Run on External Volume</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
26
dokku
26
dokku
@@ -42,6 +42,8 @@ export PLUGIN_ENABLED_PATH=${PLUGIN_ENABLED_PATH:="$PLUGIN_PATH/enabled"}
|
|||||||
export PLUGIN_CORE_PATH=${PLUGIN_CORE_PATH:="$DOKKU_LIB_ROOT/core-plugins"}
|
export PLUGIN_CORE_PATH=${PLUGIN_CORE_PATH:="$DOKKU_LIB_ROOT/core-plugins"}
|
||||||
export PLUGIN_CORE_AVAILABLE_PATH=${PLUGIN_CORE_AVAILABLE_PATH:="$PLUGIN_CORE_PATH/available"}
|
export PLUGIN_CORE_AVAILABLE_PATH=${PLUGIN_CORE_AVAILABLE_PATH:="$PLUGIN_CORE_PATH/available"}
|
||||||
export PLUGIN_CORE_ENABLED_PATH=${PLUGIN_CORE_ENABLED_PATH:="$PLUGIN_CORE_PATH/enabled"}
|
export PLUGIN_CORE_ENABLED_PATH=${PLUGIN_CORE_ENABLED_PATH:="$PLUGIN_CORE_PATH/enabled"}
|
||||||
|
export DOKKU_SYSTEM_GROUP=${DOKKU_SYSTEM_GROUP:="dokku"}
|
||||||
|
export DOKKU_SYSTEM_USER=${DOKKU_SYSTEM_USER:="dokku"}
|
||||||
|
|
||||||
export DOKKU_API_VERSION=1
|
export DOKKU_API_VERSION=1
|
||||||
export DOKKU_NOT_IMPLEMENTED_EXIT=10
|
export DOKKU_NOT_IMPLEMENTED_EXIT=10
|
||||||
@@ -191,20 +193,20 @@ case "$1" in
|
|||||||
done
|
done
|
||||||
|
|
||||||
# New lines are blank echos for readability
|
# New lines are blank echos for readability
|
||||||
echo "Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]"
|
dokku_log_quiet "Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]"
|
||||||
echo ""
|
dokku_log_quiet ""
|
||||||
echo "Primary help options, type \"dokku COMMAND:help\" for more details, or dokku help --all to see all commands."
|
dokku_log_quiet "Primary help options, type \"dokku COMMAND:help\" for more details, or dokku help --all to see all commands."
|
||||||
echo ""
|
dokku_log_quiet ""
|
||||||
echo "Commands:"
|
dokku_log_quiet "Commands:"
|
||||||
echo ""
|
dokku_log_quiet ""
|
||||||
|
|
||||||
if [[ "$2" == "--all" ]] ; then
|
if [[ "$2" == "--all" ]] ; then
|
||||||
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
|
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
|
||||||
$core_plugin_command help
|
$core_plugin_command help
|
||||||
done | sort | column -c2 -t -s,
|
done | sort | column -c2 -t -s,
|
||||||
echo ""
|
dokku_log_quiet ""
|
||||||
echo "Community plugin commands:"
|
dokku_log_quiet "Community plugin commands:"
|
||||||
echo ""
|
dokku_log_quiet ""
|
||||||
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
|
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
|
||||||
$community_plugin_command help
|
$community_plugin_command help
|
||||||
done | sort | column -c2 -t -s,
|
done | sort | column -c2 -t -s,
|
||||||
@@ -214,9 +216,9 @@ case "$1" in
|
|||||||
# When done, sort, sed cuts arugments out of strings and colum make it pretty
|
# When done, sort, sed cuts arugments out of strings and colum make it pretty
|
||||||
done | sort | sed -e '/^.*:/d' -e 's/\s[\[\<\-\(].*,/,/' | column -c2 -t -s,
|
done | sort | sed -e '/^.*:/d' -e 's/\s[\[\<\-\(].*,/,/' | column -c2 -t -s,
|
||||||
if [[ -n "$COMMUNITY_PLUGIN_COMMANDS" ]]; then
|
if [[ -n "$COMMUNITY_PLUGIN_COMMANDS" ]]; then
|
||||||
echo ""
|
dokku_log_quiet ""
|
||||||
echo "Community plugin commands:"
|
dokku_log_quiet "Community plugin commands:"
|
||||||
echo ""
|
dokku_log_quiet ""
|
||||||
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
|
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
|
||||||
$community_plugin_command help
|
$community_plugin_command help
|
||||||
done | sort | column -c2 -t -s,
|
done | sort | column -c2 -t -s,
|
||||||
|
|||||||
@@ -44,6 +44,15 @@ execute_script() {
|
|||||||
COMMAND+=" rm -rf /tmp/cache ; "
|
COMMAND+=" rm -rf /tmp/cache ; "
|
||||||
COMMAND+=" ln -sf /cache /tmp/cache ; "
|
COMMAND+=" ln -sf /cache /tmp/cache ; "
|
||||||
COMMAND+=" fi ; "
|
COMMAND+=" fi ; "
|
||||||
|
|
||||||
|
if [[ "$SCRIPT_CMD" == /* ]]; then
|
||||||
|
local SCRIPT_BIN="$(echo "$SCRIPT_CMD" | cut -d' ' -f1)"
|
||||||
|
COMMAND+=" if [[ ! -x \"$SCRIPT_BIN\" ]]; then "
|
||||||
|
COMMAND+=" echo specified binary is not executable ; "
|
||||||
|
COMMAND+=" exit 1 ; "
|
||||||
|
COMMAND+=" fi "
|
||||||
|
fi
|
||||||
|
|
||||||
COMMAND+=" $SCRIPT_CMD || exit 1;"
|
COMMAND+=" $SCRIPT_CMD || exit 1;"
|
||||||
COMMAND+=" if [[ -d '/cache' ]]; then "
|
COMMAND+=" if [[ -d '/cache' ]]; then "
|
||||||
COMMAND+=" echo removing installation cache... ; "
|
COMMAND+=" echo removing installation cache... ; "
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
|
|||||||
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dokku_path=$(which dokku)
|
dokku_path="$(which dokku)"
|
||||||
|
|
||||||
# temporary hack for https://github.com/dokku/dokku/issues/82
|
# temporary hack for https://github.com/dokku/dokku/issues/82
|
||||||
# redeploys all apps after a reboot
|
# redeploys all apps after a reboot
|
||||||
@@ -39,10 +39,10 @@ User=dokku
|
|||||||
ExecStart=$dokku_path ps:restore
|
ExecStart=$dokku_path ps:restore
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=docker.service
|
||||||
EOF
|
EOF
|
||||||
if command -v systemctl &>/dev/null; then
|
if command -v systemctl &>/dev/null; then
|
||||||
systemctl enable dokku-redeploy
|
systemctl reenable dokku-redeploy
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core standard plugin"
|
description = "dokku core standard plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ dokku_run_cmd() {
|
|||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
shift 2
|
shift 2
|
||||||
|
|
||||||
local DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local")
|
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "$@"
|
plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
plugins/20_events/network-clear-config
Symbolic link
1
plugins/20_events/network-clear-config
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
hook
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core events logging plugin"
|
description = "dokku core events logging plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
1
plugins/20_events/proxy-clear-config
Symbolic link
1
plugins/20_events/proxy-clear-config
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
hook
|
||||||
@@ -16,8 +16,10 @@ apps_create() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apps_destroy() {
|
apps_destroy() {
|
||||||
local APP="$1"; local IMAGE_TAG=$(get_running_image_tag "$APP")
|
declare desc="destroys an app"
|
||||||
|
declare APP="$1";
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
local IMAGE_TAG=$(get_running_image_tag "$APP")
|
||||||
|
|
||||||
if [[ -z "$DOKKU_APPS_FORCE_DELETE" ]]; then
|
if [[ -z "$DOKKU_APPS_FORCE_DELETE" ]]; then
|
||||||
dokku_log_warn "WARNING: Potentially Destructive Action"
|
dokku_log_warn "WARNING: Potentially Destructive Action"
|
||||||
@@ -34,7 +36,7 @@ apps_destroy() {
|
|||||||
echo "Destroying $APP (including all add-ons)"
|
echo "Destroying $APP (including all add-ons)"
|
||||||
plugn trigger pre-delete "$APP" "$IMAGE_TAG"
|
plugn trigger pre-delete "$APP" "$IMAGE_TAG"
|
||||||
|
|
||||||
local DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local")
|
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
local REMOVE_CONTAINERS="true"
|
local REMOVE_CONTAINERS="true"
|
||||||
plugn trigger scheduler-stop "$DOKKU_SCHEDULER" "$APP" "$REMOVE_CONTAINERS"
|
plugn trigger scheduler-stop "$DOKKU_SCHEDULER" "$APP" "$REMOVE_CONTAINERS"
|
||||||
plugn trigger post-delete "$APP" "$IMAGE_TAG"
|
plugn trigger post-delete "$APP" "$IMAGE_TAG"
|
||||||
|
|||||||
@@ -85,10 +85,11 @@ apps_help_content_func() {
|
|||||||
apps:create <app>, Create a new app
|
apps:create <app>, Create a new app
|
||||||
apps:destroy <app>, Permanently destroy an app
|
apps:destroy <app>, Permanently destroy an app
|
||||||
apps:list, List your apps
|
apps:list, List your apps
|
||||||
apps:lock <app>, Creates a '.deploy.lock' file in an application's repo
|
apps:lock <app>, Locks an app for deployment
|
||||||
|
apps:locked <app>, Checks if an app is locked for deployment
|
||||||
apps:rename <old-app> <new-app>, Rename an app
|
apps:rename <old-app> <new-app>, Rename an app
|
||||||
apps:report [<app>] [<flag>], Display report about an app
|
apps:report [<app>] [<flag>], Display report about an app
|
||||||
apps:unlock <app>, Removes the '.deploy.lock' file from an application's repo
|
apps:unlock <app>, Unlocks an app for deployment
|
||||||
help_content
|
help_content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core apps plugin"
|
description = "dokku core apps plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -6,18 +6,32 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
|||||||
|
|
||||||
apps_clone_cmd() {
|
apps_clone_cmd() {
|
||||||
declare desc="clones an app"
|
declare desc="clones an app"
|
||||||
declare OLD_APP="$2" NEW_APP="$3"
|
declare cmd="apps:clone" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
local cmd="apps:clone"
|
declare OLD_APP="$1" NEW_APP="$2"
|
||||||
|
local IGNORE_EXISTING=false
|
||||||
local SKIP_REBUILD=false
|
local SKIP_REBUILD=false
|
||||||
|
|
||||||
if [[ "$2" == "--skip-deploy" ]]; then
|
for arg in "$@"; do
|
||||||
SKIP_REBUILD=true
|
[[ "$arg" == "--skip-deploy" ]] && shift 1 && SKIP_REBUILD=true
|
||||||
OLD_APP="$3"
|
[[ "$arg" == "--ignore-existing" ]] && shift 1 && IGNORE_EXISTING=true
|
||||||
NEW_APP="$4"
|
[[ "$arg" =~ ^--.* ]] || break
|
||||||
|
done
|
||||||
|
|
||||||
|
OLD_APP="$1" NEW_APP="$2"
|
||||||
|
[[ -z "$OLD_APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
|
|
||||||
|
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"
|
||||||
|
if apps_exists "$NEW_APP" > /dev/null 2>&1; then
|
||||||
|
if [[ "$IGNORE_EXISTING" == true ]]; then
|
||||||
|
dokku_log_warn "Name is already taken"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
dokku_log_fail "Name is already taken"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -z "$OLD_APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
|
||||||
[[ -d "$DOKKU_ROOT/$NEW_APP" ]] && dokku_log_fail "Name is already taken"
|
|
||||||
local NEW_CACHE_DIR="$DOKKU_ROOT/$NEW_APP/cache"
|
local NEW_CACHE_DIR="$DOKKU_ROOT/$NEW_APP/cache"
|
||||||
local NEW_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$NEW_APP/cache"
|
local NEW_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$NEW_APP/cache"
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
apps_lock_cmd() {
|
apps_lock_cmd() {
|
||||||
declare desc="creates a '.deploy.lock' file in an application's repo"
|
declare desc="locks an app for deployment"
|
||||||
declare cmd="apps:lock"
|
declare cmd="apps:lock"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
declare APP="$1"; verify_app_name "$APP"
|
declare APP="$1"; verify_app_name "$APP"
|
||||||
|
|||||||
20
plugins/apps/subcommands/locked
Executable file
20
plugins/apps/subcommands/locked
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
|
apps_locked_cmd() {
|
||||||
|
declare desc="checks if an app is locked for deployment"
|
||||||
|
declare cmd="apps:locked"
|
||||||
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
|
declare APP="$1"; verify_app_name "$APP"
|
||||||
|
local LOCKED="$(apps_is_locked "$APP")"
|
||||||
|
|
||||||
|
if [[ "$LOCKED" != "true" ]] ; then
|
||||||
|
dokku_log_fail_quiet "Deploy lock does not exist"
|
||||||
|
fi
|
||||||
|
|
||||||
|
dokku_log_quiet "Deploy lock exists"
|
||||||
|
}
|
||||||
|
|
||||||
|
apps_locked_cmd "$@"
|
||||||
@@ -14,12 +14,13 @@ apps_rename_cmd() {
|
|||||||
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
|
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
|
||||||
local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache"
|
local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache"
|
||||||
|
|
||||||
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR"; then
|
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" > /dev/null 2>&1; then
|
||||||
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
|
||||||
fi
|
fi
|
||||||
rm -rf "$OLD_CACHE_DIR"
|
rm -rf "$OLD_CACHE_DIR"
|
||||||
apps_create "$NEW_APP"
|
apps_create "$NEW_APP"
|
||||||
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
|
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
|
||||||
|
plugn trigger proxy-clear-config "$NEW_APP"
|
||||||
DOKKU_APPS_FORCE_DELETE=1 apps_destroy "$OLD_APP"
|
DOKKU_APPS_FORCE_DELETE=1 apps_destroy "$OLD_APP"
|
||||||
[[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
|
[[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
|
||||||
[[ -f "$DOKKU_ROOT/$NEW_APP/VHOST" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST"
|
[[ -f "$DOKKU_ROOT/$NEW_APP/VHOST" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST"
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||||
|
|
||||||
apps_unlock_cmd() {
|
apps_unlock_cmd() {
|
||||||
declare desc="removes the '.deploy.lock' file from an application's repo"
|
declare desc="unlocks an app for deployment"
|
||||||
declare cmd="apps:unlock"
|
declare cmd="apps:unlock"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
declare APP="$1"; verify_app_name "$APP"
|
declare APP="$1"; verify_app_name "$APP"
|
||||||
|
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/.deploy.lock" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/.deploy.lock" ]]; then
|
||||||
dokku_log_warn "A deploy may be in progress."
|
dokku_log_warn "A deploy may be in progress."
|
||||||
dokku_log_warn "Removing the application lock will not stop in progress deploys."
|
dokku_log_warn "Removing the app lock will not stop in progress deploys."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to remove deploy lock"
|
rm -f "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to remove deploy lock"
|
||||||
|
|
||||||
dokku_log_info1 "Deploy lock removed."
|
dokku_log_info1 "Deploy lock removed"
|
||||||
}
|
}
|
||||||
|
|
||||||
apps_unlock_cmd "$@"
|
apps_unlock_cmd "$@"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core build-env plugin"
|
description = "dokku core build-env plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core certificate management plugin"
|
description = "dokku core certificate management plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core checks plugin"
|
description = "dokku core checks plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ dokku_apps() {
|
|||||||
[[ $INSTALLED_APPS ]] && echo "$INSTALLED_APPS"
|
[[ $INSTALLED_APPS ]] && echo "$INSTALLED_APPS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dokku_log_quiet() {
|
||||||
|
declare desc="log quiet formatter"
|
||||||
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
|
echo "$*"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
dokku_log_info1() {
|
dokku_log_info1() {
|
||||||
declare desc="log info1 formatter"
|
declare desc="log info1 formatter"
|
||||||
echo "-----> $*"
|
echo "-----> $*"
|
||||||
@@ -30,8 +37,6 @@ dokku_log_info1_quiet() {
|
|||||||
declare desc="log info1 formatter (with quiet option)"
|
declare desc="log info1 formatter (with quiet option)"
|
||||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
echo "-----> $*"
|
echo "-----> $*"
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,8 +44,6 @@ dokku_log_info2_quiet() {
|
|||||||
declare desc="log info2 formatter (with quiet option)"
|
declare desc="log info2 formatter (with quiet option)"
|
||||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
echo "=====> $*"
|
echo "=====> $*"
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,8 +56,6 @@ dokku_col_log_info1_quiet() {
|
|||||||
declare desc="columnar log info1 formatter (with quiet option)"
|
declare desc="columnar log info1 formatter (with quiet option)"
|
||||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
printf "%-6s %-18s %-25s %-25s %-25s\n" "----->" "$@"
|
printf "%-6s %-18s %-25s %-25s %-25s\n" "----->" "$@"
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,8 +68,6 @@ dokku_col_log_info2_quiet() {
|
|||||||
declare desc="columnar log info2 formatter (with quiet option)"
|
declare desc="columnar log info2 formatter (with quiet option)"
|
||||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
printf "%-6s %-18s %-25s %-25s %-25s\n" "=====>" "$@"
|
printf "%-6s %-18s %-25s %-25s %-25s\n" "=====>" "$@"
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,8 +80,6 @@ dokku_col_log_msg_quiet() {
|
|||||||
declare desc="columnar log formatter (with quiet option)"
|
declare desc="columnar log formatter (with quiet option)"
|
||||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
printf "%-25s %-25s %-25s %-25s\n" "$@"
|
printf "%-25s %-25s %-25s %-25s\n" "$@"
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,8 +87,6 @@ dokku_log_verbose_quiet() {
|
|||||||
declare desc="log verbose formatter (with quiet option)"
|
declare desc="log verbose formatter (with quiet option)"
|
||||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
echo " $*"
|
echo " $*"
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,11 +95,26 @@ dokku_log_verbose() {
|
|||||||
echo " $*"
|
echo " $*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dokku_log_warn_quiet() {
|
||||||
|
declare desc="log warning formatter"
|
||||||
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
|
echo " ! $*" 1>&2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
dokku_log_warn() {
|
dokku_log_warn() {
|
||||||
declare desc="log warning formatter"
|
declare desc="log warning formatter"
|
||||||
echo " ! $*" 1>&2
|
echo " ! $*" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dokku_log_fail_quiet() {
|
||||||
|
declare desc="log fail formatter"
|
||||||
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
|
echo "$@" 1>&2
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
dokku_log_fail() {
|
dokku_log_fail() {
|
||||||
declare desc="log fail formatter"
|
declare desc="log fail formatter"
|
||||||
echo "$@" 1>&2
|
echo "$@" 1>&2
|
||||||
@@ -214,6 +224,22 @@ get_app_image_name() {
|
|||||||
echo "$IMAGE"
|
echo "$IMAGE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_app_scheduler() {
|
||||||
|
declare desc="fetch the scheduler for a given application"
|
||||||
|
declare APP="$1"
|
||||||
|
local DOKKU_SCHEDULER
|
||||||
|
|
||||||
|
DOKKU_APP_SCHEDULER="$(config_get "$APP" DOKKU_SCHEDULER || true)"
|
||||||
|
DOKKU_GLOBAL_SCHEDULER="$(config_get --global DOKKU_SCHEDULER || true)"
|
||||||
|
|
||||||
|
DOKKU_SCHEDULER=${DOKKU_APP_SCHEDULER:="$DOKKU_GLOBAL_SCHEDULER"}
|
||||||
|
if [[ -z "$DOKKU_SCHEDULER" ]]; then
|
||||||
|
DOKKU_SCHEDULER="docker-local"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$DOKKU_SCHEDULER"
|
||||||
|
}
|
||||||
|
|
||||||
get_running_image_tag() {
|
get_running_image_tag() {
|
||||||
declare desc="retrieve current image tag for a given app. returns empty string if no deployed containers are found"
|
declare desc="retrieve current image tag for a given app. returns empty string if no deployed containers are found"
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
@@ -302,7 +328,7 @@ copy_from_image() {
|
|||||||
[[ -z "$WORKDIR" ]] && local WORKDIR=/app
|
[[ -z "$WORKDIR" ]] && local WORKDIR=/app
|
||||||
local SRC_FILE="$WORKDIR/$SRC_FILE"
|
local SRC_FILE="$WORKDIR/$SRC_FILE"
|
||||||
fi
|
fi
|
||||||
local CID=$(docker run "$DOKKU_GLOBAL_RUN_ARGS" -d "$IMAGE" bash)
|
local CID=$(docker create "$DOKKU_GLOBAL_RUN_ARGS" "$IMAGE")
|
||||||
docker cp "$CID:$SRC_FILE" "$DST_DIR"
|
docker cp "$CID:$SRC_FILE" "$DST_DIR"
|
||||||
docker rm -f "$CID" &> /dev/null
|
docker rm -f "$CID" &> /dev/null
|
||||||
else
|
else
|
||||||
@@ -369,25 +395,6 @@ get_app_running_container_types() {
|
|||||||
echo "$CONTAINER_TYPES"
|
echo "$CONTAINER_TYPES"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cmd_from_procfile() {
|
|
||||||
declare desc="parse cmd from app Procfile"
|
|
||||||
local APP=$1; local PROC_TYPE=$2; local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
|
||||||
verify_app_name "$APP"
|
|
||||||
|
|
||||||
if [[ -f $DOKKU_PROCFILE ]]; then
|
|
||||||
local line; local name; local command
|
|
||||||
while read -r line || [[ -n "$line" ]]; do
|
|
||||||
if [[ -z "$line" ]] || [[ "$line" == "#"* ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
line=$(strip_inline_comments "$line")
|
|
||||||
name="${line%%:*}"
|
|
||||||
command="${line#*:[[:space:]]}"
|
|
||||||
[[ "$name" == "$PROC_TYPE" ]] && echo "$command" && break
|
|
||||||
done < "$DOKKU_PROCFILE"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
is_deployed() {
|
is_deployed() {
|
||||||
declare desc="return 0 if given app has a running container"
|
declare desc="return 0 if given app has a running container"
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
@@ -401,14 +408,17 @@ is_deployed() {
|
|||||||
is_container_running() {
|
is_container_running() {
|
||||||
declare desc="return 0 if given docker container id is in running state"
|
declare desc="return 0 if given docker container id is in running state"
|
||||||
declare deprecated=true
|
declare deprecated=true
|
||||||
local CID=$1
|
declare CID="$1"
|
||||||
local CONTAINER_STATUS=$(docker inspect -f '{{.State.Running}}' "$CID" || true)
|
local CONTAINER_STATUS
|
||||||
|
|
||||||
|
dokku_log_warn "Deprecated: common#is_container_status"
|
||||||
|
CONTAINER_STATUS=$(docker inspect -f '{{.State.Running}}' "$CID" || true)
|
||||||
|
|
||||||
if [[ "$CONTAINER_STATUS" == "true" ]]; then
|
if [[ "$CONTAINER_STATUS" == "true" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
is_container_status() {
|
is_container_status() {
|
||||||
@@ -419,14 +429,17 @@ is_container_status() {
|
|||||||
|
|
||||||
if [[ "$CONTAINER_STATUS" == "true" ]]; then
|
if [[ "$CONTAINER_STATUS" == "true" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
is_app_running() {
|
is_app_running() {
|
||||||
declare desc="return 0 if given app has a running container"
|
declare desc="return 0 if given app has a running container"
|
||||||
|
declare deprecated=true
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
|
|
||||||
|
dokku_log_warn "Deprecated: ps#fn-is-app-running"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
local APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids "$APP")
|
local APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids "$APP")
|
||||||
@@ -544,8 +557,9 @@ dokku_release() {
|
|||||||
dokku_deploy_cmd() {
|
dokku_deploy_cmd() {
|
||||||
declare desc="deploy phase"
|
declare desc="deploy phase"
|
||||||
declare APP="$1" IMAGE_TAG="$2"
|
declare APP="$1" IMAGE_TAG="$2"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
local DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local")
|
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
plugn trigger scheduler-deploy "$DOKKU_SCHEDULER" "$APP" "$IMAGE_TAG"
|
plugn trigger scheduler-deploy "$DOKKU_SCHEDULER" "$APP" "$IMAGE_TAG"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -619,8 +633,7 @@ docker_cleanup() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
dokku_log_info1 "Cleaning up..."
|
dokku_log_info1 "Cleaning up..."
|
||||||
local DOKKU_SCHEDULER="docker-local"
|
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
[[ -n "$APP" ]] && DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local")
|
|
||||||
plugn trigger scheduler-docker-cleanup "$DOKKU_SCHEDULER" "$APP" "$FORCE_CLEANUP"
|
plugn trigger scheduler-docker-cleanup "$DOKKU_SCHEDULER" "$APP" "$FORCE_CLEANUP"
|
||||||
|
|
||||||
# delete all non-running containers
|
# delete all non-running containers
|
||||||
@@ -764,13 +777,27 @@ get_container_ports() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_app_urls() {
|
get_app_urls() {
|
||||||
|
declare desc="print an app's available urls"
|
||||||
|
declare URL_TYPE="$1" APP="$2"
|
||||||
|
local urls
|
||||||
|
|
||||||
|
verify_app_name "$APP"
|
||||||
|
urls=$(plugn trigger app-urls "$APP" "$URL_TYPE")
|
||||||
|
if [[ -n "$urls" ]]; then
|
||||||
|
echo "$urls" | sort
|
||||||
|
else
|
||||||
|
internal_get_app_urls "$URL_TYPE" "$APP"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
internal_get_app_urls() {
|
||||||
declare desc="print an app's available urls"
|
declare desc="print an app's available urls"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||||
|
|
||||||
local APP="$2"; verify_app_name "$APP"
|
local APP="$2"
|
||||||
local RAW_TCP_PORTS="$(get_app_raw_tcp_ports "$APP")"
|
local RAW_TCP_PORTS="$(get_app_raw_tcp_ports "$APP")"
|
||||||
local URLS_FILE="$DOKKU_ROOT/$APP/URLS"
|
local URLS_FILE="$DOKKU_ROOT/$APP/URLS"
|
||||||
local DOKKU_PROXY_PORT_MAP=$(config_get "$APP" DOKKU_PROXY_PORT_MAP || true)
|
local DOKKU_PROXY_PORT_MAP=$(config_get "$APP" DOKKU_PROXY_PORT_MAP || true)
|
||||||
@@ -919,15 +946,30 @@ acquire_app_deploy_lock() {
|
|||||||
declare desc="acquire advisory lock for use in git/tar deploys"
|
declare desc="acquire advisory lock for use in git/tar deploys"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"; verify_app_name "$APP"
|
||||||
local LOCK_TYPE="${2:-waiting}"
|
local LOCK_TYPE="${2:-waiting}"
|
||||||
local APP_DEPLOY_LOCK_FD="200"
|
|
||||||
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
||||||
local LOCK_WAITING_MSG="$APP currently has a deploy lock in place. Waiting..."
|
local LOCK_WAITING_MSG="$APP currently has a deploy lock in place. Waiting..."
|
||||||
local LOCK_FAILED_MSG="$APP currently has a deploy lock in place. Exiting..."
|
local LOCK_FAILED_MSG="$APP currently has a deploy lock in place. Exiting..."
|
||||||
|
|
||||||
|
acquire_advisory_lock "$APP_DEPLOY_LOCK_FILE" "$LOCK_TYPE" "$LOCK_WAITING_MSG" "$LOCK_FAILED_MSG"
|
||||||
|
}
|
||||||
|
|
||||||
|
release_app_deploy_lock() {
|
||||||
|
declare desc="release advisory lock used in git/tar deploys"
|
||||||
|
local APP="$1"; verify_app_name "$APP"
|
||||||
|
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
||||||
|
|
||||||
|
release_advisory_lock "$APP_DEPLOY_LOCK_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
acquire_advisory_lock() {
|
||||||
|
declare desc="acquire advisory lock"
|
||||||
|
local LOCK_FILE="$1" LOCK_TYPE="$2" LOCK_WAITING_MSG="$3" LOCK_FAILED_MSG="$4"
|
||||||
|
local LOCK_FD="200"
|
||||||
local SHOW_MSG=true
|
local SHOW_MSG=true
|
||||||
|
|
||||||
eval "exec $APP_DEPLOY_LOCK_FD>$APP_DEPLOY_LOCK_FILE"
|
eval "exec $LOCK_FD>$LOCK_FILE"
|
||||||
if [[ "$LOCK_TYPE" == "waiting" ]]; then
|
if [[ "$LOCK_TYPE" == "waiting" ]]; then
|
||||||
while [[ $(flock -n "$APP_DEPLOY_LOCK_FD" &>/dev/null ; echo $?) -ne 0 ]]; do
|
while [[ $(flock -n "$LOCK_FD" &>/dev/null ; echo $?) -ne 0 ]]; do
|
||||||
if [[ "$SHOW_MSG" == "true" ]]; then
|
if [[ "$SHOW_MSG" == "true" ]]; then
|
||||||
echo "$LOCK_WAITING_MSG"
|
echo "$LOCK_WAITING_MSG"
|
||||||
SHOW_MSG=false
|
SHOW_MSG=false
|
||||||
@@ -935,17 +977,16 @@ acquire_app_deploy_lock() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
flock -n "$APP_DEPLOY_LOCK_FD" &>/dev/null || dokku_log_fail "$LOCK_FAILED_MSG"
|
flock -n "$LOCK_FD" &>/dev/null || dokku_log_fail "$LOCK_FAILED_MSG"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
release_app_deploy_lock() {
|
release_advisory_lock() {
|
||||||
declare desc="release advisory lock used in git/tar deploys"
|
declare desc="release advisory lock"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local LOCK_FILE="$1"
|
||||||
local APP_DEPLOY_LOCK_FD="200"
|
local LOCK_FD="200"
|
||||||
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
|
||||||
|
|
||||||
flock -u "$APP_DEPLOY_LOCK_FD" && rm -f "$APP_DEPLOY_LOCK_FILE" &> /dev/null
|
flock -u "$LOCK_FD" && rm -f "$LOCK_FILE" &> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
suppress_output() {
|
suppress_output() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core common plugin"
|
description = "dokku core common plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -144,13 +144,6 @@ func setPermissions(path string, fileMode os.FileMode) (err error) {
|
|||||||
|
|
||||||
systemGroup := os.Getenv("DOKKU_SYSTEM_GROUP")
|
systemGroup := os.Getenv("DOKKU_SYSTEM_GROUP")
|
||||||
systemUser := os.Getenv("DOKKU_SYSTEM_USER")
|
systemUser := os.Getenv("DOKKU_SYSTEM_USER")
|
||||||
if systemGroup == "" {
|
|
||||||
systemGroup = "dokku"
|
|
||||||
}
|
|
||||||
if systemUser == "" {
|
|
||||||
systemUser = "dokku"
|
|
||||||
}
|
|
||||||
|
|
||||||
group, err := user.LookupGroup(systemGroup)
|
group, err := user.LookupGroup(systemGroup)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -67,15 +67,6 @@ fn-plugin-property-setup() {
|
|||||||
|
|
||||||
mkdir -p "${DOKKU_LIB_ROOT}/config/${PLUGIN}"
|
mkdir -p "${DOKKU_LIB_ROOT}/config/${PLUGIN}"
|
||||||
chmod 0755 "${DOKKU_LIB_ROOT}/config/${PLUGIN}"
|
chmod 0755 "${DOKKU_LIB_ROOT}/config/${PLUGIN}"
|
||||||
|
|
||||||
if [[ -z "$DOKKU_SYSTEM_GROUP" ]]; then
|
|
||||||
export DOKKU_SYSTEM_GROUP=dokku
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "$DOKKU_SYSTEM_USER" ]]; then
|
|
||||||
export DOKKU_SYSTEM_USER=dokku
|
|
||||||
fi
|
|
||||||
|
|
||||||
chown "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "${DOKKU_LIB_ROOT}/config/${PLUGIN}"
|
chown "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "${DOKKU_LIB_ROOT}/config/${PLUGIN}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,9 +240,17 @@ func prettyPrintEnvEntries(prefix string, entries map[string]string) string {
|
|||||||
colConfig := columnize.DefaultConfig()
|
colConfig := columnize.DefaultConfig()
|
||||||
colConfig.Prefix = prefix
|
colConfig.Prefix = prefix
|
||||||
colConfig.Delim = "\x00"
|
colConfig.Delim = "\x00"
|
||||||
lines := make([]string, 0, len(entries))
|
|
||||||
for k, v := range entries {
|
//some keys may be prefixes of each other so we need to sort them rather than the resulting lines
|
||||||
lines = append(lines, fmt.Sprintf("%s:\x00%s", k, v))
|
keys := make([]string, 0, len(entries))
|
||||||
|
for k := range entries {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
sort.Strings(keys)
|
||||||
|
|
||||||
|
lines := make([]string, 0, len(keys))
|
||||||
|
for _, k := range keys {
|
||||||
|
lines = append(lines, fmt.Sprintf("%s:\x00%s", k, entries[k]))
|
||||||
}
|
}
|
||||||
return columnize.Format(lines, colConfig)
|
return columnize.Format(lines, colConfig)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ func TestExport(t *testing.T) {
|
|||||||
Expect(e.Export(ExportFormatDockerArgs)).To(Equal("--env=BAR='BAZ' --env=BAZ='a\nb' --env=FOO='b'\\''ar '"))
|
Expect(e.Export(ExportFormatDockerArgs)).To(Equal("--env=BAR='BAZ' --env=BAZ='a\nb' --env=FOO='b'\\''ar '"))
|
||||||
Expect(e.Export(ExportFormatShell)).To(Equal("BAR='BAZ' BAZ='a\nb' FOO='b'\\''ar '"))
|
Expect(e.Export(ExportFormatShell)).To(Equal("BAR='BAZ' BAZ='a\nb' FOO='b'\\''ar '"))
|
||||||
Expect(e.Export(ExportFormatExports)).To(Equal("export BAR='BAZ'\nexport BAZ='a\nb'\nexport FOO='b'\\''ar '"))
|
Expect(e.Export(ExportFormatExports)).To(Equal("export BAR='BAZ'\nexport BAZ='a\nb'\nexport FOO='b'\\''ar '"))
|
||||||
|
Expect(e.Export(ExportFormatPretty)).To(Equal("BAR: BAZ\nBAZ: a\nb\nFOO: b'ar"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGet(t *testing.T) {
|
func TestGet(t *testing.T) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core config plugin"
|
description = "dokku core config plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Additional commands:`
|
|||||||
config (<app>|--global), Pretty-print an app or global environment
|
config (<app>|--global), Pretty-print an app or global environment
|
||||||
config:get (<app>|--global) KEY, Display a global or app-specific config value
|
config:get (<app>|--global) KEY, Display a global or app-specific config value
|
||||||
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...], Set one or more config vars
|
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...], Set one or more config vars
|
||||||
config:unset (<app>|--global) KEY1 [KEY2 ...], Unset one or more config vars
|
config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...], Unset one or more config vars
|
||||||
config:export (<app>|--global) [--envfile], Export a global or app environment
|
config:export (<app>|--global) [--envfile], Export a global or app environment
|
||||||
config:keys (<app>|--global) [--merged], Show keys set in environment
|
config:keys (<app>|--global) [--merged], Show keys set in environment
|
||||||
config:bundle (<app>|--global) [--merged], Bundle environment into tarfile
|
config:bundle (<app>|--global) [--merged], Bundle environment into tarfile
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ func CommandShow(args []string, global bool, shell bool, export bool, merged boo
|
|||||||
if appName != "" {
|
if appName != "" {
|
||||||
contextName = appName
|
contextName = appName
|
||||||
}
|
}
|
||||||
common.LogInfo2(contextName + " env vars")
|
common.LogInfo2Quiet(contextName + " env vars")
|
||||||
fmt.Println(env.Export(ExportFormatPretty))
|
fmt.Println(env.Export(ExportFormatPretty))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core docker-options plugin"
|
description = "dokku core docker-options plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core domains plugin"
|
description = "dokku core domains plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core enter plugin"
|
description = "dokku core enter plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ git_build_app_repo() {
|
|||||||
pushd "$DOKKU_ROOT/$APP" > /dev/null
|
pushd "$DOKKU_ROOT/$APP" > /dev/null
|
||||||
# unset the git quarantine path to allow us to use 2.13.0+
|
# unset the git quarantine path to allow us to use 2.13.0+
|
||||||
# See this issue for more information: https://github.com/dokku/dokku/issues/2796
|
# See this issue for more information: https://github.com/dokku/dokku/issues/2796
|
||||||
env -u GIT_QUARANTINE_PATH git worktree add "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" "$REV" > /dev/null
|
suppress_output env -u GIT_QUARANTINE_PATH git worktree add "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" "$REV"
|
||||||
popd > /dev/null
|
popd > /dev/null 2>&1 || pushd "/tmp" > /dev/null
|
||||||
pushd "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" > /dev/null
|
pushd "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" > /dev/null
|
||||||
else
|
else
|
||||||
# git clone - this method creates a new git repository and adds the primary
|
# git clone - this method creates a new git repository and adds the primary
|
||||||
@@ -65,13 +65,13 @@ git_build_app_repo() {
|
|||||||
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
|
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
suppress_output git submodule update --init --recursive
|
suppress_output env -u GIT_QUARANTINE_PATH git submodule update --init --recursive
|
||||||
find . -name .git -prune -exec rm -rf {} \; > /dev/null
|
find . -name .git -prune -exec rm -rf {} \; > /dev/null
|
||||||
|
|
||||||
if use_git_worktree; then
|
if use_git_worktree; then
|
||||||
pushd "$DOKKU_ROOT/$APP"
|
pushd "$DOKKU_ROOT/$APP" > /dev/null
|
||||||
git worktree prune
|
git worktree prune
|
||||||
popd
|
popd > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local DOKKU_APP_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_GLOBAL_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_DISABLE_ANSI_PREFIX_REMOVAL
|
local DOKKU_APP_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_GLOBAL_DISABLE_ANSI_PREFIX_REMOVAL DOKKU_DISABLE_ANSI_PREFIX_REMOVAL
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core git plugin"
|
description = "dokku core git plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,27 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help logs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help logs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/logs/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
usage() {
|
|
||||||
declare desc="logs specific usage"
|
|
||||||
echo "Usage: dokku logs <app>"
|
|
||||||
echo " display recent log output"
|
|
||||||
echo ""
|
|
||||||
echo " -n, --num NUM # the number of lines to display"
|
|
||||||
echo " -p, --ps PS # only display logs from the given process"
|
|
||||||
echo " -t, --tail # continually stream logs"
|
|
||||||
echo " -q, --quiet # display raw logs without colors, time and names"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
logs:help)
|
help | logs:help)
|
||||||
usage
|
cmd-logs-help "$@"
|
||||||
;;
|
|
||||||
|
|
||||||
help)
|
|
||||||
cat<<EOF
|
|
||||||
logs <app> [-h] [-t] [-n num] [-q] [-p process], Show the last logs for an application
|
|
||||||
EOF
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|||||||
38
plugins/logs/internal-functions
Executable file
38
plugins/logs/internal-functions
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
fn-logs-usage() {
|
||||||
|
declare desc="logs specific usage"
|
||||||
|
echo "Usage: dokku logs <app>"
|
||||||
|
echo " display recent log output"
|
||||||
|
echo ""
|
||||||
|
echo " -n, --num NUM # the number of lines to display"
|
||||||
|
echo " -p, --ps PS # only display logs from the given process"
|
||||||
|
echo " -t, --tail # continually stream logs"
|
||||||
|
echo " -q, --quiet # display raw logs without colors, time and names"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-logs-help-content() {
|
||||||
|
declare desc="return logs plugin help content"
|
||||||
|
cat<<help_content
|
||||||
|
logs <app> [-h] [-t] [-n num] [-q] [-p process], Display recent log output
|
||||||
|
logs:failed <app>, Show the last logs for an application
|
||||||
|
help_content
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd-logs-help() {
|
||||||
|
if [[ $1 = "logs:help" ]] ; then
|
||||||
|
echo -e 'Usage: dokku logs[:COMMAND]'
|
||||||
|
echo ''
|
||||||
|
echo 'Output app logs'
|
||||||
|
echo ''
|
||||||
|
echo 'Additional commands:'
|
||||||
|
fn-logs-help-content | sort | column -c2 -t -s,
|
||||||
|
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
|
||||||
|
fn-logs-help-content
|
||||||
|
else
|
||||||
|
cat<<help_desc
|
||||||
|
logs, Output app logs
|
||||||
|
help_desc
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core logs plugin"
|
description = "dokku core logs plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,24 +1,22 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/logs/internal-functions"
|
||||||
|
|
||||||
logs_default_cmd() {
|
logs_default_cmd() {
|
||||||
declare desc="shows the last logs for an app via command line"
|
declare desc="display recent log output"
|
||||||
local cmd="logs"
|
local cmd="logs"
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
local APP="$2"; verify_app_name "$2"
|
local APP="$2"; verify_app_name "$2"
|
||||||
local APP_ROOT="$DOKKU_ROOT/$APP"
|
local APP_ROOT="$DOKKU_ROOT/$APP"
|
||||||
local COLORS=(36 33 32 35 31)
|
local COLORS=(36 33 32 35 31)
|
||||||
|
|
||||||
if ! (is_deployed "$APP"); then
|
! (is_deployed "$APP") && dokku_log_fail "App $APP has not been deployed"
|
||||||
echo "Application's container not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
shift 2;
|
shift 2;
|
||||||
local TEMP=$(getopt -o htqn:p: --long help,tail,quiet,num:,ps: -n 'dokku logs' -- "$@")
|
local TEMP=$(getopt -o htqn:p: --long help,tail,quiet,num:,ps: -n 'dokku logs' -- "$@")
|
||||||
local EXIT_CODE="$?"
|
local EXIT_CODE="$?"
|
||||||
if [[ "$EXIT_CODE" != 0 ]]; then usage >&2 ; exit 1 ; fi
|
if [[ "$EXIT_CODE" != 0 ]]; then fn-logs-usage >&2 ; exit 1 ; fi
|
||||||
eval set -- "$TEMP"
|
eval set -- "$TEMP"
|
||||||
|
|
||||||
local DOKKU_LOGS_LINE_NUMBERS="100"
|
local DOKKU_LOGS_LINE_NUMBERS="100"
|
||||||
@@ -29,7 +27,7 @@ logs_default_cmd() {
|
|||||||
-p|--ps) local DOKKU_LOGS_ONLY_PROCESS="$2"; shift 2 ;;
|
-p|--ps) local DOKKU_LOGS_ONLY_PROCESS="$2"; shift 2 ;;
|
||||||
-q|--quiet) local DOKKU_LOGS_NO_PRETTY_PRINT="true"; shift ;;
|
-q|--quiet) local DOKKU_LOGS_NO_PRETTY_PRINT="true"; shift ;;
|
||||||
--) shift; break ;;
|
--) shift; break ;;
|
||||||
*) echo "Internal error"; exit 1;;
|
*) dokku_log_fail "Internal error";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
33
plugins/logs/subcommands/failed
Executable file
33
plugins/logs/subcommands/failed
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
cmd-logs-failed() {
|
||||||
|
declare desc="shows the last failed deploy logs"
|
||||||
|
declare cmd="logs:failed" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
|
declare APP="$1"
|
||||||
|
local DOKKU_SCHEDULER
|
||||||
|
|
||||||
|
if [[ -z "$APP" ]]; then
|
||||||
|
local INSTALLED_APPS=$(dokku_apps)
|
||||||
|
for app in $INSTALLED_APPS; do
|
||||||
|
fn-logs-failed-single "$app" | tee || true
|
||||||
|
done
|
||||||
|
else
|
||||||
|
fn-logs-failed-single "$APP"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-logs-failed-single() {
|
||||||
|
declare desc="shows the last failed deploy logs for an app"
|
||||||
|
declare APP="$1"
|
||||||
|
local DOKKU_SCHEDULER
|
||||||
|
|
||||||
|
dokku_log_info2_quiet "${APP} failed deploy logs"
|
||||||
|
DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
|
plugn trigger scheduler-logs-failed "$DOKKU_SCHEDULER" "$APP"
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd-logs-failed "$@"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core network plugin"
|
description = "dokku core network plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -191,6 +191,28 @@ is_spdy_enabled() {
|
|||||||
echo $HAS_SUPPORT
|
echo $HAS_SUPPORT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_http2_push_enabled() {
|
||||||
|
declare desc="detects whether the installed nginx version has http2 push support"
|
||||||
|
local NGINX_VERSION="$1"
|
||||||
|
local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
|
||||||
|
local HAS_SUPPORT=false
|
||||||
|
|
||||||
|
MAJOR_VERSION=$(echo "$NGINX_VERSION" | awk '{split($0,a,"."); print a[1]}')
|
||||||
|
MINOR_VERSION=$(echo "$NGINX_VERSION" | awk '{split($0,a,"."); print a[2]}')
|
||||||
|
PATCH_VERSION=$(echo "$NGINX_VERSION" | awk '{split($0,a,"."); print a[3]}')
|
||||||
|
if [[ "$MAJOR_VERSION" -ge "2" ]]; then
|
||||||
|
HAS_SUPPORT=true
|
||||||
|
elif [[ "$MAJOR_VERSION" -eq "1" ]]; then
|
||||||
|
if [[ "$MINOR_VERSION" -eq "13" ]] && [[ "$PATCH_VERSION" -ge "9" ]]; then
|
||||||
|
HAS_SUPPORT=true
|
||||||
|
elif [[ "$MINOR_VERSION" -ge "14" ]]; then
|
||||||
|
HAS_SUPPORT=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $HAS_SUPPORT
|
||||||
|
}
|
||||||
|
|
||||||
is_http2_enabled() {
|
is_http2_enabled() {
|
||||||
declare desc="detects whether the installed nginx version has http2 support"
|
declare desc="detects whether the installed nginx version has http2 support"
|
||||||
local NGINX_VERSION="$1"
|
local NGINX_VERSION="$1"
|
||||||
@@ -285,7 +307,7 @@ nginx_build_config() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local NGINX_LOCATION NGINX_VERSION SPDY_SUPPORTED HTTP2_SUPPORTED
|
local NGINX_LOCATION NGINX_VERSION SPDY_SUPPORTED HTTP2_SUPPORTED HTTP2_PUSH_SUPPORTED
|
||||||
NGINX_LOCATION=$(get_nginx_location)
|
NGINX_LOCATION=$(get_nginx_location)
|
||||||
if [[ -z "$NGINX_LOCATION" ]]; then
|
if [[ -z "$NGINX_LOCATION" ]]; then
|
||||||
exit 1;
|
exit 1;
|
||||||
@@ -293,6 +315,7 @@ nginx_build_config() {
|
|||||||
NGINX_VERSION="$("$NGINX_LOCATION" -v 2>&1 | cut -d'/' -f 2)"
|
NGINX_VERSION="$("$NGINX_LOCATION" -v 2>&1 | cut -d'/' -f 2)"
|
||||||
SPDY_SUPPORTED="$(is_spdy_enabled "$NGINX_VERSION")"
|
SPDY_SUPPORTED="$(is_spdy_enabled "$NGINX_VERSION")"
|
||||||
HTTP2_SUPPORTED="$(is_http2_enabled "$NGINX_VERSION")"
|
HTTP2_SUPPORTED="$(is_http2_enabled "$NGINX_VERSION")"
|
||||||
|
HTTP2_PUSH_SUPPORTED="$(is_http2_push_enabled "$NGINX_VERSION")"
|
||||||
|
|
||||||
PROXY_PORT_MAP=$(echo "$PROXY_PORT_MAP" | xargs) # trailing spaces mess up default template
|
PROXY_PORT_MAP=$(echo "$PROXY_PORT_MAP" | xargs) # trailing spaces mess up default template
|
||||||
|
|
||||||
@@ -304,6 +327,7 @@ nginx_build_config() {
|
|||||||
PASSED_LISTEN_IP_PORT="$PASSED_LISTEN_IP_PORT"
|
PASSED_LISTEN_IP_PORT="$PASSED_LISTEN_IP_PORT"
|
||||||
SPDY_SUPPORTED="$SPDY_SUPPORTED"
|
SPDY_SUPPORTED="$SPDY_SUPPORTED"
|
||||||
HTTP2_SUPPORTED="$HTTP2_SUPPORTED"
|
HTTP2_SUPPORTED="$HTTP2_SUPPORTED"
|
||||||
|
HTTP2_PUSH_SUPPORTED="$HTTP2_PUSH_SUPPORTED"
|
||||||
DOKKU_APP_LISTEN_PORT="$DOKKU_APP_LISTEN_PORT" DOKKU_APP_LISTEN_IP="$DOKKU_APP_LISTEN_IP"
|
DOKKU_APP_LISTEN_PORT="$DOKKU_APP_LISTEN_PORT" DOKKU_APP_LISTEN_IP="$DOKKU_APP_LISTEN_IP"
|
||||||
APP_SSL_PATH="$APP_SSL_PATH" SSL_INUSE="$SSL_INUSE" SSL_SERVER_NAME="$SSL_SERVER_NAME"
|
APP_SSL_PATH="$APP_SSL_PATH" SSL_INUSE="$SSL_INUSE" SSL_SERVER_NAME="$SSL_SERVER_NAME"
|
||||||
# @TODO: Remove this after a few versions
|
# @TODO: Remove this after a few versions
|
||||||
|
|||||||
@@ -26,3 +26,9 @@ nginx_vhosts_help_cmd() {
|
|||||||
help_desc
|
help_desc
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nginx_clear_config() {
|
||||||
|
declare desc="Remove the nginx conf file"
|
||||||
|
declare APP="$1";
|
||||||
|
rm -f "$DOKKU_ROOT/$APP/nginx.conf"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core nginx-vhosts plugin"
|
description = "dokku core nginx-vhosts plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
19
plugins/nginx-vhosts/proxy-clear-config
Executable file
19
plugins/nginx-vhosts/proxy-clear-config
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||||
|
|
||||||
|
trigger-nginx-vhosts-clear-config() {
|
||||||
|
declare desc="clear nginx config for proxy app containers from command line"
|
||||||
|
declare trigger="trigger-nginx-vhosts-clear-config"
|
||||||
|
declare APP="$1"
|
||||||
|
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
|
|
||||||
|
if [[ "$(get_app_proxy_type "$APP")" = "nginx" ]]; then
|
||||||
|
plugn trigger network-clear-config "$APP"
|
||||||
|
nginx_clear_config "$APP"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger-nginx-vhosts-clear-config "$@"
|
||||||
@@ -81,6 +81,7 @@ server {
|
|||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
|
|
||||||
proxy_pass http://{{ $.APP }}-{{ $upstream_port }};
|
proxy_pass http://{{ $.APP }}-{{ $upstream_port }};
|
||||||
|
{{ if eq $.HTTP2_PUSH_SUPPORTED "true" }}http2_push_preload on; {{ end }}
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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"
|
||||||
|
|
||||||
plugin_list_cmd() {
|
plugin_list_cmd() {
|
||||||
declare desc="lists all plugins"
|
declare desc="lists all plugins"
|
||||||
@@ -8,3 +9,10 @@ plugin_list_cmd() {
|
|||||||
plugn version
|
plugn version
|
||||||
plugn list
|
plugn list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin_prime_bash_completion() {
|
||||||
|
declare desc="primes the bash-completion cache"
|
||||||
|
|
||||||
|
dokku_log_info1_quiet "Priming bash-completion cache"
|
||||||
|
dokku --quiet help --all | awk '/^ /{ print $1 }' | sort > "/var/cache/dokku-completion"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core plugin plugin"
|
description = "dokku core plugin plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
|
||||||
|
|
||||||
plugin_disable_cmd() {
|
plugin_disable_cmd() {
|
||||||
declare desc="disables plugin via command line"
|
declare desc="disables plugin via command line"
|
||||||
@@ -9,6 +10,7 @@ plugin_disable_cmd() {
|
|||||||
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to disable"
|
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to disable"
|
||||||
local PLUGIN="$2"
|
local PLUGIN="$2"
|
||||||
disable_plugin "$PLUGIN"
|
disable_plugin "$PLUGIN"
|
||||||
|
plugin_prime_bash_completion
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_disable_cmd "$@"
|
plugin_disable_cmd "$@"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
|
||||||
|
|
||||||
plugin_enable_cmd() {
|
plugin_enable_cmd() {
|
||||||
declare desc="enables plugin via command line"
|
declare desc="enables plugin via command line"
|
||||||
@@ -9,6 +10,7 @@ plugin_enable_cmd() {
|
|||||||
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable"
|
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable"
|
||||||
local PLUGIN="$2"
|
local PLUGIN="$2"
|
||||||
enable_plugin "$PLUGIN"
|
enable_plugin "$PLUGIN"
|
||||||
|
plugin_prime_bash_completion
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_enable_cmd "$@"
|
plugin_enable_cmd "$@"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
|
||||||
|
|
||||||
plugin_install_cmd() {
|
plugin_install_cmd() {
|
||||||
declare desc="installs a plugin from URL and calls install plugin trigger via command line"
|
declare desc="installs a plugin from URL and calls install plugin trigger via command line"
|
||||||
@@ -20,6 +21,7 @@ plugin_install_cmd() {
|
|||||||
plugn trigger install
|
plugn trigger install
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
plugin_prime_bash_completion
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_install_cmd "$@"
|
plugin_install_cmd "$@"
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
|
||||||
|
|
||||||
plugin_uninstall_cmd() {
|
plugin_uninstall_cmd() {
|
||||||
declare desc="uninstalls plugin via command line"
|
declare desc="uninstalls plugin via command line"
|
||||||
local cmd="plugin:uninstall"
|
local cmd="plugin:uninstall"
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable"
|
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to uninstall"
|
||||||
local PLUGIN="$2"
|
local PLUGIN="$2"
|
||||||
uninstall_plugin "$PLUGIN"
|
uninstall_plugin "$PLUGIN"
|
||||||
|
plugin_prime_bash_completion
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_uninstall_cmd "$@"
|
plugin_uninstall_cmd "$@"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
|
||||||
|
|
||||||
plugin_update_cmd() {
|
plugin_update_cmd() {
|
||||||
declare desc="updates plugin to optional committish and calls update plugin trigger via command line"
|
declare desc="updates plugin to optional committish and calls update plugin trigger via command line"
|
||||||
@@ -10,6 +11,7 @@ plugin_update_cmd() {
|
|||||||
plugn update "$PLUGIN" "$PLUGIN_COMMITTISH"
|
plugn update "$PLUGIN" "$PLUGIN_COMMITTISH"
|
||||||
fi
|
fi
|
||||||
plugn trigger update
|
plugn trigger update
|
||||||
|
plugin_prime_bash_completion
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_update_cmd "$@"
|
plugin_update_cmd "$@"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core proxy plugin"
|
description = "dokku core proxy plugin"
|
||||||
version = "0.12.4"
|
version = "0.13.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ case "$1" in
|
|||||||
declare desc="return ps plugin help content"
|
declare desc="return ps plugin help content"
|
||||||
cat<<help_content
|
cat<<help_content
|
||||||
ps <app>, List processes running in app container(s)
|
ps <app>, List processes running in app container(s)
|
||||||
|
ps:inspect <app>, Displays a sanitized version of docker inspect for an app
|
||||||
ps:scale <app> <proc>=<count> [<proc>=<count>...], Get/Set how many instances of a given process to run
|
ps:scale <app> <proc>=<count> [<proc>=<count>...], Get/Set how many instances of a given process to run
|
||||||
ps:start <app>, Start app container(s)
|
ps:start <app>, Start app container(s)
|
||||||
|
ps:startall, Starts all apps via command line
|
||||||
ps:stop <app>, Stop app container(s)
|
ps:stop <app>, Stop app container(s)
|
||||||
ps:stopall, Stop all app container(s)
|
ps:stopall, Stop all app container(s)
|
||||||
ps:rebuild <app>, Rebuild an app from source
|
ps:rebuild <app>, Rebuild an app from source
|
||||||
|
|||||||
@@ -3,6 +3,17 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
|
get_cmd_from_procfile() {
|
||||||
|
declare desc="parse cmd from app Procfile"
|
||||||
|
declare APP="$1" PROC_TYPE="$2" PORT="$3"
|
||||||
|
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
||||||
|
local COMMAND
|
||||||
|
verify_app_name "$APP"
|
||||||
|
|
||||||
|
[[ ! -f $DOKKU_PROCFILE ]] && return
|
||||||
|
procfile-util show --procfile "$DOKKU_PROCFILE" --process-type "$PROC_TYPE" --default-port "$PORT"
|
||||||
|
}
|
||||||
|
|
||||||
print_dokku_scale_file() {
|
print_dokku_scale_file() {
|
||||||
declare desc="prints contents of DOKKU_SCALE file"
|
declare desc="prints contents of DOKKU_SCALE file"
|
||||||
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||||
@@ -23,6 +34,11 @@ extract_procfile() {
|
|||||||
copy_from_image "$IMAGE" "Procfile" "$DOKKU_PROCFILE" 2>/dev/null || true
|
copy_from_image "$IMAGE" "Procfile" "$DOKKU_PROCFILE" 2>/dev/null || true
|
||||||
if [[ -f "$DOKKU_PROCFILE" ]]; then
|
if [[ -f "$DOKKU_PROCFILE" ]]; then
|
||||||
dokku_log_info1_quiet "App Procfile file found ($DOKKU_PROCFILE)"
|
dokku_log_info1_quiet "App Procfile file found ($DOKKU_PROCFILE)"
|
||||||
|
# shellcheck disable=SC2069
|
||||||
|
PROCFILE_ERRORS="$(procfile-util check --procfile "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)"
|
||||||
|
if [[ -n "$PROCFILE_ERRORS" ]]; then
|
||||||
|
dokku_log_fail "${PROCFILE_ERRORS}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
dokku_log_info1_quiet "No Procfile found in app image"
|
dokku_log_info1_quiet "No Procfile found in app image"
|
||||||
fi
|
fi
|
||||||
@@ -71,12 +87,21 @@ generate_scale_file() {
|
|||||||
|
|
||||||
set_scale() {
|
set_scale() {
|
||||||
declare desc="sets app proc type scaling"
|
declare desc="sets app proc type scaling"
|
||||||
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
declare APP="$1"
|
||||||
|
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||||
|
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
|
extract_procfile "$APP" "$IMAGE_TAG" > /dev/null
|
||||||
|
trap 'remove_procfile $APP' RETURN INT TERM EXIT
|
||||||
|
|
||||||
local SCALE_SETTINGS=("$@")
|
local SCALE_SETTINGS=("$@")
|
||||||
for procscale in "${SCALE_SETTINGS[@]}"; do
|
for procscale in "${SCALE_SETTINGS[@]}"; do
|
||||||
local PROC_NAME=${procscale%%=*}
|
local PROC_NAME=${procscale%%=*}
|
||||||
local PROC_COUNT=${procscale#*=}
|
local PROC_COUNT=${procscale#*=}
|
||||||
|
if [[ -f "$DOKKU_PROCFILE" ]] && ! procfile-util exists --procfile "$DOKKU_PROCFILE" --process-type "$PROC_NAME" > /dev/null 2>&1; then
|
||||||
|
dokku_log_fail "${PROC_NAME} is not a valid process name"
|
||||||
|
fi
|
||||||
is_number "$PROC_COUNT" || dokku_log_fail "ps:scale $PROC_COUNT is not a number"
|
is_number "$PROC_COUNT" || dokku_log_fail "ps:scale $PROC_COUNT is not a number"
|
||||||
dokku_log_info1_quiet "Scaling $APP:$PROC_NAME to $PROC_COUNT"
|
dokku_log_info1_quiet "Scaling $APP:$PROC_NAME to $PROC_COUNT"
|
||||||
if (egrep -q "^${PROC_NAME}=" "$DOKKU_SCALE_FILE" > /dev/null 2>&1); then
|
if (egrep -q "^${PROC_NAME}=" "$DOKKU_SCALE_FILE" > /dev/null 2>&1); then
|
||||||
@@ -91,17 +116,24 @@ ps_start() {
|
|||||||
declare desc="starts app"
|
declare desc="starts app"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"; verify_app_name "$APP"
|
||||||
local IMAGE_TAG=$(get_running_image_tag "$APP");
|
local IMAGE_TAG=$(get_running_image_tag "$APP");
|
||||||
|
local RUNNING
|
||||||
|
|
||||||
if (is_deployed "$APP"); then
|
if (is_deployed "$APP"); then
|
||||||
plugn trigger pre-start "$APP"
|
plugn trigger pre-start "$APP"
|
||||||
if ! (is_app_running "$APP"); then
|
RUNNING="$(fn-ps-is-app-running "$APP")"
|
||||||
|
|
||||||
|
if [[ "$RUNNING" == "mixed" ]]; then
|
||||||
|
dokku_log_warn "App is running in mixed mode, releasing"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$RUNNING" != "true" ]]; then
|
||||||
release_and_deploy "$APP" "$IMAGE_TAG"
|
release_and_deploy "$APP" "$IMAGE_TAG"
|
||||||
else
|
else
|
||||||
echo "App $APP already running"
|
dokku_log_warn "App $APP already running"
|
||||||
fi
|
fi
|
||||||
plugn trigger proxy-build-config "$APP"
|
plugn trigger proxy-build-config "$APP"
|
||||||
else
|
else
|
||||||
echo "App $APP has not been deployed"
|
dokku_log_warn "App $APP has not been deployed"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,10 +141,10 @@ ps_stop() {
|
|||||||
declare desc="stops app"
|
declare desc="stops app"
|
||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"; verify_app_name "$APP"
|
||||||
|
|
||||||
! (is_deployed "$APP") && echo "App $APP has not been deployed" && exit 0
|
! (is_deployed "$APP") && dokku_log_warn "App $APP has not been deployed" && exit 0
|
||||||
|
|
||||||
echo "Stopping $APP ..."
|
dokku_log_quiet "Stopping $APP ..."
|
||||||
local DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local")
|
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
plugn trigger scheduler-stop "$DOKKU_SCHEDULER" "$APP"
|
plugn trigger scheduler-stop "$DOKKU_SCHEDULER" "$APP"
|
||||||
plugn trigger post-stop "$APP"
|
plugn trigger post-stop "$APP"
|
||||||
}
|
}
|
||||||
@@ -132,7 +164,7 @@ ps_restart() {
|
|||||||
if (is_deployed "$APP"); then
|
if (is_deployed "$APP"); then
|
||||||
release_and_deploy "$APP" "$IMAGE_TAG"
|
release_and_deploy "$APP" "$IMAGE_TAG"
|
||||||
else
|
else
|
||||||
echo "App $APP has not been deployed"
|
dokku_log_warn "App $APP has not been deployed"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,6 +173,7 @@ ps_scale() {
|
|||||||
local APP="$1"; verify_app_name "$APP"
|
local APP="$1"; verify_app_name "$APP"
|
||||||
local IMAGE_TAG=$(get_running_image_tag "$APP")
|
local IMAGE_TAG=$(get_running_image_tag "$APP")
|
||||||
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||||
|
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
[[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG"
|
[[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG"
|
||||||
@@ -171,3 +204,34 @@ get_restart_policies() {
|
|||||||
local -r phase_file_path=$1
|
local -r phase_file_path=$1
|
||||||
get_raw_restart_policies "$phase_file_path" | sed -e 's/^--restart=//g'
|
get_raw_restart_policies "$phase_file_path" | sed -e 's/^--restart=//g'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn-ps-app-status() {
|
||||||
|
declare APP="$1"
|
||||||
|
local PROCS=0 RUNNING=""
|
||||||
|
local APP_CIDS=$(get_app_container_ids "$APP");
|
||||||
|
|
||||||
|
for CID in $APP_CIDS; do
|
||||||
|
if (is_container_status "$CID" "Running"); then
|
||||||
|
RUNNING+="0"
|
||||||
|
else
|
||||||
|
RUNNING+="1"
|
||||||
|
fi
|
||||||
|
PROCS=$((PROCS + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "${#RUNNING}" -eq 0 ]] || [[ "${#RUNNING}" -ne 0 ]] && [[ "$RUNNING" != *"0"* ]]; then
|
||||||
|
RUNNING="false"
|
||||||
|
elif [[ "$RUNNING" != *"1"* ]] && [[ "${#RUNNING}" -ne 0 ]]; then
|
||||||
|
RUNNING="true"
|
||||||
|
else
|
||||||
|
RUNNING="mixed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$PROCS $RUNNING"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn-ps-is-app-running() {
|
||||||
|
declare APP="$1"
|
||||||
|
APP_STATUS=$(fn-ps-app-status "$APP")
|
||||||
|
echo "$APP_STATUS" | cut -d ' ' -f 2
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user