Compare commits

...

94 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
61af5971d5 Release 0.22.3
Some checks failed
bump-formula / bump-formula (push) Has been cancelled
# History

## 0.22.3

Install/update via the bootstrap script:

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

### Bug Fixes

- #4268: @josegonzalez Properly parse flags for logs command
- #4264: @josegonzalez Correct argument handling when setting the `--app` flag
- #4252: @magikid Allow symbolic links for certificate and key files

### New Features

- #4270: @josegonzalez Allow renaming old applications to new format
- #4261: @josegonzalez Add remove by fingerprint and json format output to ssh-keys plugin
- #4262: @josegonzalez Improve ps:restore logging
- #4263: @josegonzalez Bump the dokku client formula on release

### Documentation

- #4253: @guettli Highlight the default build method used by Dokku
- #4250: @rlnd1 Update upgrading.md
- #4249: @guettli Fix typo in zero downtime docs
- #4247: @josegonzalez Clarify the domain name setting in the docs

### Tests

- #4269: @josegonzalez Rename duplicate test
- #4266: @josegonzalez Update junit test files when a bats retry is successful
- #4265: @josegonzalez Retry failing and skipped tests once
2020-12-23 02:35:25 -05:00
Jose Diaz-Gonzalez
acc206fca7 Merge pull request #4270 from dokku/4267-fix-app-name-verification
Allow renaming old applications to new format
2020-12-23 02:32:10 -05:00
Jose Diaz-Gonzalez
59a81ad3be fix: cleanup apps and containers before each test
- remove all nginx configurations since they may be faulty
- move cleanup commands to helper functions
- fix a few shellcheck violations
2020-12-22 13:29:32 -05:00
Jose Diaz-Gonzalez
d7b23b84f0 fix: allow renaming old applications to new format
0.22.0 changed allowed values for app names, making it more difficult for users to fix their app names - you need to either downgrade+rename or recreate the app. The `apps:rename`  command can now rename these old applications to the new standard.

Also drop some app name verification from internal commands. Duplicate verification doesn't help much, and though it isn't excessively slow, it does prevent us from running commands against old apps that exist.

Refs #4267
2020-12-22 13:29:32 -05:00
Jose Diaz-Gonzalez
3d77de20cc Merge pull request #4269 from dokku/josegonzalez-patch-1
Rename duplicate test
2020-12-22 13:28:33 -05:00
Jose Diaz-Gonzalez
365356eb5f fix: output is expected twice 2020-12-22 11:52:02 -05:00
Jose Diaz-Gonzalez
044cc4a618 fix: rename duplicate test 2020-12-22 01:30:16 -05:00
Jose Diaz-Gonzalez
09541f8aac Merge pull request #4268 from dokku/4256-fix-logs-arguments
Properly parse flags for logs command
2020-12-21 18:29:04 -05:00
Jose Diaz-Gonzalez
4d0979bbcd fix: properly parse flags for logs command
Closes #4256
2020-12-21 16:50:34 -05:00
Jose Diaz-Gonzalez
dba4bb9c2c Merge pull request #4264 from dokku/4255-client-parsing
Correct argument handling when setting the `--app` flag
2020-12-21 15:55:27 -05:00
Jose Diaz-Gonzalez
2e4c886ab2 fix: correct app arg parsing and new test 2020-12-21 13:36:04 -05:00
Jose Diaz-Gonzalez
dd1962f92d fix: add missing docblock 2020-12-21 01:40:40 -05:00
Jose Diaz-Gonzalez
1439e8b30b hack: parse out the info flags for report subcommands separately
pflag doesn't ignore unspecified arguments, so they must be parsed out separately first.
2020-12-21 01:36:59 -05:00
Jose Diaz-Gonzalez
8240790381 fix: correct argument handling when setting the --app flag
When setting the `--app` flag, there was a special case for the config plugin. This plugin used to take the `--no-restart` flag as the first argument - and still did until this change - resulting in an invalid call to the plugin subcommands. What is worse is that this functionality carried over to all other plugins as they were rewritten in golang, and thus the issue spread without us knowing.

The fix is to support GNU flag parsing rules, which Golang does not do by default (Because Of Reasons™). Switching to `github.com/spf13/pflag` fixes this issue, and also allows positional arguments to be placed wherever, even in the middle of flags.

Closes #4255
2020-12-20 22:06:33 -05:00
Jose Diaz-Gonzalez
0050aa6b92 Merge pull request #4266 from dokku/better-bats-retry
Update junit test files when a bats retry is successful
2020-12-20 22:06:03 -05:00
Jose Diaz-Gonzalez
f53b26f3f0 tests: update junit test files when a bats retry is successful 2020-12-20 17:26:27 -05:00
Jose Diaz-Gonzalez
57a9a11ab3 Merge pull request #4261 from dokku/ssh-keys-commands
Add remove by fingerprint and json format output to ssh-keys plugin
2020-12-20 13:52:11 -05:00
Jose Diaz-Gonzalez
a6a0e033a7 Merge pull request #4262 from dokku/4259-better-restore-logging
Improve ps:restore logging
2020-12-20 13:51:10 -05:00
Jose Diaz-Gonzalez
18492ac83c feat: add json format support to ssh-keys:list 2020-12-20 04:15:53 -05:00
Jose Diaz-Gonzalez
13dd8aa224 feat: add ability to remove an ssh key by fingerprint
- add tests for ssh-keys:remove
- upgrade sshcommand
2020-12-20 04:15:53 -05:00
Jose Diaz-Gonzalez
574304486a chore: make the structs internal
They don't need to be exported as they are only used within this plugin.
2020-12-20 04:15:42 -05:00
Jose Diaz-Gonzalez
90feb8dc96 chore: remove unused file
This was forgotten in the ps plugin rewrite.
2020-12-20 04:15:42 -05:00
Jose Diaz-Gonzalez
7bc241dd48 feat: suppress output for nginx init commands
It's not super useful most of the time.
2020-12-20 04:15:42 -05:00
Jose Diaz-Gonzalez
57b884e7c7 feat: enhance logging for parallel commands
This logging change makes it easier to figure out what is breaking where when running commands in parallel.
2020-12-20 04:15:42 -05:00
Jose Diaz-Gonzalez
3ba775d4b3 feat: add better logging to ps:restore output
Without the logging additions, it's a bit more difficult to figure out why a ps:restore is skipping the restore of an app.
2020-12-20 04:15:42 -05:00
Jose Diaz-Gonzalez
89d6f0eb6e Merge pull request #4265 from dokku/bats-retry
Retry failing and skipped tests once
2020-12-20 04:15:09 -05:00
Jose Diaz-Gonzalez
465e220315 feat: retry failing and skipped tests once
Plugn is fairly brittle since the upgrade to bash 5, so this might help decrease the need to retry the whole circleci job.
2020-12-20 02:42:37 -05:00
Jose Diaz-Gonzalez
1b767e7632 Merge pull request #4263 from dokku/bump-formula
Bump the dokku client formula on release
2020-12-19 19:17:31 -05:00
Jose Diaz-Gonzalez
b3304337ca feat: bump the dokku client formula on release
This ensures we always have an up to date version :)
2020-12-19 19:16:37 -05:00
Jose Diaz-Gonzalez
40e7f6d15b Merge pull request #4252 from magikid/fix-symbolic-link-certs
Allow symbolic links for certificate and key files
2020-12-18 12:13:42 -05:00
Jose Diaz-Gonzalez
c95659d57d Merge pull request #4253 from guettli/patch-2
Highlight the default build method used by Dokku
2020-12-18 12:13:30 -05:00
Jose Diaz-Gonzalez
a1e7b99b26 docs: merge note into list
Makes it a little cleaner (though not by much).

[ci skip]
2020-12-18 12:12:59 -05:00
Thomas Güttler
52f1f2495c If unsure use "Heroku buildpacks via Herokuish".
I guess this is the current sane default. Correct me, if I am wrong.
2020-12-17 21:44:10 +01:00
Chris W Jones
112ee88fe9 Allow symbolic links for certificate and key files
This corrects an issue where if a symbolic link was given to the
`certs:add` command, an error would be thrown even though the file was
valid.

Issue: #4251
2020-12-17 15:35:52 -05:00
Jose Diaz-Gonzalez
2ff06ff4c7 Merge pull request #4250 from rlnd1/patch-1
Update upgrading.md
2020-12-17 11:53:44 -05:00
rlnd1
df289be994 Update upgrading.md
Add command for versions 0.22 and higher
2020-12-17 17:15:15 +01:00
Jose Diaz-Gonzalez
ae76e8784c Merge pull request #4249 from guettli/patch-1
Fix typo in zero downtime docs
2020-12-16 17:09:45 -05:00
Thomas Güttler
d537cb70cd typo "by for" 2020-12-16 23:07:02 +01:00
Jose Diaz-Gonzalez
4a70f0bea2 Merge pull request #4247 from dokku/josegonzalez-patch-1
Clarify the domain name setting in the docs
2020-12-16 16:08:21 -05:00
Jose Diaz-Gonzalez
e51165d915 docs: clarify the domain name setting in the docs
No need to mention the vagrant.

Closes #4246

[ci skip]
2020-12-16 16:07:13 -05:00
Jose Diaz-Gonzalez
d10d4cc55c Release 0.22.2
# History

## 0.22.2

Install/update via the bootstrap script:

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

### Bug Fixes

- #4243: @josegonzalez Do not delete app when the app name is invalid

### New Features

- #4141: @josegonzalez Always initialize git repository

### Other

- #4244: @dependabot-preview[bot] chore(deps): bump monolog/monolog from 1.25.5 to 1.26.0 in /tests/apps/php
2020-12-15 19:14:31 -05:00
Jose Diaz-Gonzalez
2301efa460 Merge pull request #4244 from dokku/dependabot/composer/tests/apps/php/monolog/monolog-1.26.0
chore(deps): bump monolog/monolog from 1.25.5 to 1.26.0 in /tests/apps/php
2020-12-15 14:04:14 -05:00
Jose Diaz-Gonzalez
d00284166f Merge pull request #4141 from dokku/always-initialize-repo
feat: always initialize git repository
2020-12-15 14:01:09 -05:00
Jose Diaz-Gonzalez
f279ce44b2 Merge pull request #4243 from dokku/4129-avoid-deletion
Do not delete app when the app name is invalid
2020-12-15 03:28:52 -05:00
Jose Diaz-Gonzalez
36215828f1 feat: always initialize git repository
This fixes issues where alternative tools that don't trigger the init via sshcommand - such as git-http-backend - are not able to setup applications correctly.

Note that those apps could always manually trigger git:initialize if desired, but if the app already exists, then this should already _just work_ without that extra initialization.
2020-12-15 01:42:10 -05:00
dependabot-preview[bot]
0623af86d6 chore(deps): bump monolog/monolog in /tests/apps/php
Bumps [monolog/monolog](https://github.com/Seldaek/monolog) from 1.25.5 to 1.26.0.
- [Release notes](https://github.com/Seldaek/monolog/releases)
- [Changelog](https://github.com/Seldaek/monolog/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Seldaek/monolog/compare/1.25.5...1.26.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-15 06:30:16 +00:00
Jose Diaz-Gonzalez
c6976499ad fix: do not delete app when the app name is invalid
Let folks call apps:destroy instead.

Refs #4129
2020-12-15 01:14:30 -05:00
Jose Diaz-Gonzalez
01bd69100c Release 0.22.1
# History

## 0.22.1

Install/update via the bootstrap script:

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

### Bug Fixes

- #4238: @josegonzalez Ensure dead files are created for docker object retirement
- #4239: @josegonzalez Ensure all byte output is trimmed of whitespace
- #4228: @Cellane Fix tags:deploy command for images that contain ONBUILD directive
- #4233: @josegonzalez Properly parse releease command when there is an entrypoint
- #4215: @josegonzalez Implement missing cleanup routines
- #4212: @josegonzalez Cleanup docker options during post-delete
- #4211: @ml-milan-vit Make the dokku-update command compatible with Dokku 0.22+

### New Features

- #4242: @josegonzalez Remove reference to 'whitelist'
- #4220: @josegonzalez Update plugn from 0.5.0 to 0.5.1
- #4241: @josegonzalez Properly handle stdout when capturing plugn output
- #4237: @josegonzalez Release dokku-update 0.2.0
- #4225: @znz Accept first pushed branch as deploy-branch

### Documentation

- #4236: @josegonzalez Remove note regarding not having an official client
- #4234: @josegonzalez Switch to bats --filter for running a single test
- #4222: @leopolicastro Fix typo in deployment tasks documentation
- #4221: @srr013 Updating readme for clarity on git push step
- #4214: @josegonzalez Expand backup and restore documentation
- #4213: @josegonzalez Enhance the 'plugin' plugin documentation

### Tests

- #4218: @josegonzalez Enable compilation cache

### Other

- #4230: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 186 to 187 in /tests/apps/php
- #4223: @dependabot-preview[bot] chore(deps): bump jetty-servlet from 9.4.35.v20201120 to 11.0.0 in /tests/apps/java
- #4224: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 185 to 186 in /tests/apps/php
2020-12-13 22:04:14 -05:00
Jose Diaz-Gonzalez
541d73ad93 Merge pull request #4238 from dokku/ensure-dead-files
Ensure dead files are created for docker object retirement
2020-12-13 21:59:47 -05:00
Jose Diaz-Gonzalez
6b159c32cf Merge pull request #4239 from dokku/4229-trim-whitespace
Ensure all byte output is trimmed of whitespace
2020-12-13 21:59:23 -05:00
Jose Diaz-Gonzalez
5f2968d1b0 Merge pull request #4242 from dokku/remove-whitelist-word
Remove reference to 'whitelist'
2020-12-13 21:58:37 -05:00
Jose Diaz-Gonzalez
0e768d107a Merge pull request #4218 from dokku/faster-compiles
Enable compilation cache
2020-12-13 15:39:29 -05:00
Jose Diaz-Gonzalez
3557ff16dc Merge pull request #4220 from dokku/update-plugn
Update plugn from 0.5.0 to 0.5.1
2020-12-13 15:23:35 -05:00
Jose Diaz-Gonzalez
30131ef363 Merge pull request #4241 from dokku/quieter-plugn-capture
Properly handle stdout when capturing plugn output
2020-12-13 15:15:48 -05:00
Jose Diaz-Gonzalez
946c424734 Merge pull request #4228 from Cellane/patch-1
Fix tags:deploy command for images that contain ONBUILD directive
2020-12-13 03:14:03 -05:00
Jose Diaz-Gonzalez
f42b293836 feat: remove reference to 'whitelist'
The term doesn't even 'make sense' in this context. 'allowed_prefixes' is a much better variable name.
2020-12-13 02:10:52 -05:00
Jose Diaz-Gonzalez
b691c0affc feat: properly handle stdout when capturing plugn output
The previous output would also include a message like `exit status 1`. This allows us to silence that output and instead only capture that which was return from the subprocess.
2020-12-13 02:08:44 -05:00
Jose Diaz-Gonzalez
48fa04a05b fix: ensure dead files are created for docker object retirement 2020-12-13 02:05:30 -05:00
Jose Diaz-Gonzalez
8c14bb9aeb fix: ensure all byte output is trimmed of whitespace
This otherwise causes issues when interpreting the output as part of a variable, such as when constructing the deploying app image.

Closes #4229
2020-12-13 02:04:35 -05:00
Jose Diaz-Gonzalez
ca2de6a4a3 Merge pull request #4237 from dokku/update-dokku-update
Release dokku-update 0.2.0
2020-12-12 23:11:03 -05:00
Jose Diaz-Gonzalez
755499797e feat: release dokku-update 0.2.0 2020-12-12 23:10:21 -05:00
Jose Diaz-Gonzalez
f2a3cfc0b4 tests: add unit test for label skipping 2020-12-12 16:33:39 -05:00
Milan Vit
a42786a465 Fixes tags:deploy command for images that contain ONBUILD directive
Fixes #4226
2020-12-12 16:07:31 -05:00
Jose Diaz-Gonzalez
de0a467c97 Merge pull request #4233 from dokku/4232-fix-release-command
Properly parse releease command when there is an entrypoint
2020-12-12 15:57:38 -05:00
Jose Diaz-Gonzalez
ab23a4b6f1 Merge pull request #4236 from dokku/josegonzalez-patch-1
Remove note regarding not having an official client
2020-12-12 15:56:11 -05:00
Jose Diaz-Gonzalez
87aed0eadf docs: remove note regarding not having an official client
Closes #4235

[ci skip]
2020-12-12 15:55:38 -05:00
Jose Diaz-Gonzalez
9a86549359 chore: fix mispelling
[ci skip]
2020-12-11 14:19:44 -05:00
Jose Diaz-Gonzalez
2eeb0069d5 Merge pull request #4234 from dokku/use-bats-filter
Switch to bats --filter for running a single test
2020-12-11 14:14:51 -05:00
Jose Diaz-Gonzalez
f536a05e06 fix: switch to bats --filter for running a single test 2020-12-11 11:45:15 -05:00
Jose Diaz-Gonzalez
26b95854d4 fix: properly parse releease command when there is an entrypoint
Closes #4232
2020-12-11 11:44:13 -05:00
Jose Diaz-Gonzalez
775432c73f Merge pull request #4230 from dokku/dependabot/composer/tests/apps/php/heroku/heroku-buildpack-php-187
chore(deps-dev): bump heroku/heroku-buildpack-php from 186 to 187 in /tests/apps/php
2020-12-10 11:00:36 -05:00
dependabot-preview[bot]
84ee5995f4 chore(deps-dev): bump heroku/heroku-buildpack-php in /tests/apps/php
Bumps [heroku/heroku-buildpack-php](https://github.com/heroku/heroku-buildpack-php) from 186 to 187.
- [Release notes](https://github.com/heroku/heroku-buildpack-php/releases)
- [Changelog](https://github.com/heroku/heroku-buildpack-php/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heroku/heroku-buildpack-php/compare/v186...v187)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-10 06:21:51 +00:00
Jose Diaz-Gonzalez
91e9bb9670 Merge pull request #4225 from znz/accept-first-pushed-branch-as-deploy-branch
Accept first pushed branch as deploy-branch
2020-12-08 16:04:05 -05:00
Jose Diaz-Gonzalez
c6a8bd669f Merge pull request #4223 from dokku/dependabot/maven/tests/apps/java/org.eclipse.jetty-jetty-servlet-11.0.0
chore(deps): bump jetty-servlet from 9.4.35.v20201120 to 11.0.0 in /tests/apps/java
2020-12-08 14:08:26 -05:00
Jose Diaz-Gonzalez
d9d0a932b0 Merge pull request #4224 from dokku/dependabot/composer/tests/apps/php/heroku/heroku-buildpack-php-186
chore(deps-dev): bump heroku/heroku-buildpack-php from 185 to 186 in /tests/apps/php
2020-12-08 12:54:04 -05:00
Jose Diaz-Gonzalez
a91d45c397 Merge pull request #4222 from leopolicastro/patch-1
Fix typo
2020-12-08 10:50:54 -05:00
Kazuhiro NISHIYAMA
98c81513aa Accept first pushed branch as deploy-branch
And set to DOKKU_DEPLOY_BRANCH.

Idea from https://github.com/dokku/dokku/pull/4167#issuecomment-717607136
2020-12-08 23:15:11 +09:00
dependabot-preview[bot]
a7e5f2abdc chore(deps-dev): bump heroku/heroku-buildpack-php in /tests/apps/php
Bumps [heroku/heroku-buildpack-php](https://github.com/heroku/heroku-buildpack-php) from 185 to 186.
- [Release notes](https://github.com/heroku/heroku-buildpack-php/releases)
- [Changelog](https://github.com/heroku/heroku-buildpack-php/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heroku/heroku-buildpack-php/compare/v185...v186)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-08 07:14:57 +00:00
dependabot-preview[bot]
0aa0c884d3 chore(deps): bump jetty-servlet in /tests/apps/java
Bumps [jetty-servlet](https://github.com/eclipse/jetty.project) from 9.4.35.v20201120 to 11.0.0.
- [Release notes](https://github.com/eclipse/jetty.project/releases)
- [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.35.v20201120...jetty-11.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-08 05:54:29 +00:00
Leo Policastro
dfa39fc590 Fix typo 2020-12-07 22:03:11 -05:00
Jose Diaz-Gonzalez
cbd442fc2e Merge pull request #4221 from srr013/patch-1
Updating readme for clarity on git push step
2020-12-05 15:07:48 -05:00
Scott Rossignol
ebd2778f5b Updating readme for clarity on git push step
https://www.digitalocean.com/community/questions/refactorin-git-remote-add-dokku-dokku-dokku-me-ruby-rails-sample
2020-12-05 10:17:11 -05:00
Jose Diaz-Gonzalez
5887d4ddfa Update plugn from 0.5.0 to 0.5.1 2020-12-05 02:32:15 -05:00
Jose Diaz-Gonzalez
36e9b4b2ae feat: enable compilation cache
Not sure why it was disabled but lets see if tests fail?
2020-12-04 16:58:45 -05:00
Jose Diaz-Gonzalez
81d31c9934 Merge pull request #4215 from dokku/plugin-cleanup
Implement missing cleanup routines
2020-12-02 14:19:07 -05:00
Jose Diaz-Gonzalez
4aaefb0c4c fix: implement missing cleanup routines
Without these, there was potential for configuration for certain plugins to continue to exist after an app was deleted.
2020-12-02 03:27:06 -05:00
Jose Diaz-Gonzalez
6aac1ea0d1 Merge pull request #4214 from dokku/4180-backup-docs
Expand backup and restore documentation
2020-12-02 02:54:48 -05:00
Jose Diaz-Gonzalez
bd275d9b5d docs: expand backup and restore documentation
This documentation should fill the need for users that wish to backup and restore their installations. While there are certainly other methods to trigger this process - and many caveats - this should give users more confidence as to how to approach the general problem.

Closes #4180
2020-12-02 02:54:07 -05:00
Jose Diaz-Gonzalez
8c0dbc7d6a Merge pull request #4213 from dokku/4192-plugin-docs
Enhance the 'plugin' plugin documentation
2020-12-02 01:30:49 -05:00
Jose Diaz-Gonzalez
07194ca17f docs: add documentation to the plugin plugin
These plugin docs will be good enough to tide end-users over until the 'plugin' plugin can be rewritten in golang.

Closes #4192
2020-12-02 01:30:12 -05:00
Jose Diaz-Gonzalez
325c6d44dd Merge pull request #4212 from dokku/cleanup-options
Cleanup docker options during post-delete
2020-12-02 00:14:02 -05:00
Jose Diaz-Gonzalez
168ed1716c fix: cleanup docker options during post-delete
While the directory removal should be enough, we should also force-clean just to be sure.
2020-12-01 22:38:20 -05:00
Jose Diaz-Gonzalez
3de8c3002a Merge pull request #4211 from ml-milan-vit/patch-1
🐛 Make the dokku-update command compatible with Dokku 0.22+
2020-12-01 18:41:22 -05:00
Milan Vit
1cbbfb195f 🐛 Make the dokku-update command compatible with Dokku 0.22+ 2020-12-02 08:39:21 +09:00
136 changed files with 1195 additions and 532 deletions

View File

@@ -84,7 +84,9 @@ jobs:
- run:
name: run bats tests
command: |
sudo -E make -e test-ci
if ! sudo -E make -e test-ci; then
sudo -E make tests-ci-retry-failed
fi
no_output_timeout: 60m
shell: /bin/bash
- run:

20
.github/workflows/bump-formula.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: bump-formula
on:
push:
tags:
- '*'
jobs:
bump-formula:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
- name: Bump Brew
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
run: |
brew tap dokku/repo
brew bump-formula-pr -f --no-browse --no-audit --no-fork --url "https://github.com/dokku/dokku/archive/${{ steps.get_version.outputs.version }}.tar.gz" dokku/repo/dokku

View File

@@ -1,5 +1,107 @@
# History
## 0.22.3
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.3/bootstrap.sh
sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh
```
### Bug Fixes
- #4268: @josegonzalez Properly parse flags for logs command
- #4264: @josegonzalez Correct argument handling when setting the `--app` flag
- #4252: @magikid Allow symbolic links for certificate and key files
### New Features
- #4270: @josegonzalez Allow renaming old applications to new format
- #4261: @josegonzalez Add remove by fingerprint and json format output to ssh-keys plugin
- #4262: @josegonzalez Improve ps:restore logging
- #4263: @josegonzalez Bump the dokku client formula on release
### Documentation
- #4253: @guettli Highlight the default build method used by Dokku
- #4250: @rlnd1 Update upgrading.md
- #4249: @guettli Fix typo in zero downtime docs
- #4247: @josegonzalez Clarify the domain name setting in the docs
### Tests
- #4269: @josegonzalez Rename duplicate test
- #4266: @josegonzalez Update junit test files when a bats retry is successful
- #4265: @josegonzalez Retry failing and skipped tests once
## 0.22.2
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.2/bootstrap.sh
sudo DOKKU_TAG=v0.22.2 bash bootstrap.sh
```
### Bug Fixes
- #4243: @josegonzalez Do not delete app when the app name is invalid
### New Features
- #4141: @josegonzalez Always initialize git repository
### Other
- #4244: @dependabot-preview[bot] chore(deps): bump monolog/monolog from 1.25.5 to 1.26.0 in /tests/apps/php
## 0.22.1
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.1/bootstrap.sh
sudo DOKKU_TAG=v0.22.1 bash bootstrap.sh
```
### Bug Fixes
- #4238: @josegonzalez Ensure dead files are created for docker object retirement
- #4239: @josegonzalez Ensure all byte output is trimmed of whitespace
- #4228: @Cellane Fix tags:deploy command for images that contain ONBUILD directive
- #4233: @josegonzalez Properly parse releease command when there is an entrypoint
- #4215: @josegonzalez Implement missing cleanup routines
- #4212: @josegonzalez Cleanup docker options during post-delete
- #4211: @ml-milan-vit Make the dokku-update command compatible with Dokku 0.22+
### New Features
- #4242: @josegonzalez Remove reference to 'whitelist'
- #4220: @josegonzalez Update plugn from 0.5.0 to 0.5.1
- #4241: @josegonzalez Properly handle stdout when capturing plugn output
- #4237: @josegonzalez Release dokku-update 0.2.0
- #4225: @znz Accept first pushed branch as deploy-branch
### Documentation
- #4236: @josegonzalez Remove note regarding not having an official client
- #4234: @josegonzalez Switch to bats --filter for running a single test
- #4222: @leopolicastro Fix typo in deployment tasks documentation
- #4221: @srr013 Updating readme for clarity on git push step
- #4214: @josegonzalez Expand backup and restore documentation
- #4213: @josegonzalez Enhance the 'plugin' plugin documentation
### Tests
- #4218: @josegonzalez Enable compilation cache
### Other
- #4230: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 186 to 187 in /tests/apps/php
- #4223: @dependabot-preview[bot] chore(deps): bump jetty-servlet from 9.4.35.v20201120 to 11.0.0 in /tests/apps/java
- #4224: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 185 to 186 in /tests/apps/php
## 0.22.0
Install/update via the bootstrap script:

View File

@@ -2,9 +2,9 @@ DOKKU_VERSION ?= master
HEROKUISH_VERSION ?= 0.5.19
PROCFILE_VERSION ?= 0.11.0
PLUGN_VERSION ?= 0.5.0
PLUGN_VERSION ?= 0.5.1
SIGIL_VERSION ?= 0.6.0
SSHCOMMAND_VERSION ?= 0.11.0
SSHCOMMAND_VERSION ?= 0.12.0
SSHCOMMAND_URL ?= https://github.com/dokku/sshcommand/releases/download/v${SSHCOMMAND_VERSION}/sshcommand_${SSHCOMMAND_VERSION}_linux_x86_64.tgz
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz

View File

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

View File

@@ -1,4 +1,4 @@
GO_ARGS ?= -a
GO_ARGS ?=
GO_PLUGIN_MAKE_TARGET ?= build
GO_REPO_ROOT := /go/src/github.com/dokku/dokku
BUILD_IMAGE := golang:1.14.4

View File

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

View File

@@ -101,7 +101,7 @@ main() {
# rebuild all applications
dokku-log-info "Rebuilding all applications"
dokku ps:rebuildall
dokku ps:rebuild --all
dokku-log-info "Waiting for old containers to stop"
sleep 120

View File

@@ -72,6 +72,9 @@ main() {
skip=false
continue
fi
is_flag=false
[[ "$arg" =~ ^--.* ]] && is_flag=true
if [[ "$arg" == "--app" ]]; then
APP=${args[$next_index]}
@@ -82,10 +85,10 @@ main() {
skip=true
shift 2
elif [[ "$arg" =~ ^--.* ]]; then
[[ "$cmd_set" == "true" ]] && APP_ARG="$arg" && break
[[ "$cmd_set" == "true" ]] && [[ "$is_flag" == "false" ]] && APP_ARG="$arg" && break
[[ "$arg" == "--trace" ]] && export DOKKU_TRACE=1 && set -x
else
if [[ "$cmd_set" == "true" ]]; then
if [[ "$cmd_set" == "true" ]] && [[ "$is_flag" == "false" ]]; then
APP_ARG="$arg"
break
else
@@ -110,7 +113,7 @@ main() {
case "$CMD" in
apps:create)
if [[ -z "$APP_ARG" ]]; then
if [[ -z "$APP" ]] && [[ -z "$APP_ARG" ]]; then
APP=$(fn-random-name)
counter=0
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps 2>/dev/null | grep -q "$APP"; do
@@ -123,7 +126,7 @@ main() {
counter=$((counter + 1))
fi
done
else
elif [[ -z "$APP" ]]; then
APP="$APP_ARG"
fi
if git remote add "$DOKKU_GIT_REMOTE" "dokku@$DOKKU_REMOTE_HOST:$APP"; then

2
deb.mk
View File

@@ -6,7 +6,7 @@ DOKKU_ARCHITECTURE = amd64
DOKKU_UPDATE_DESCRIPTION = 'Binary that handles updating Dokku and related systems'
DOKKU_UPDATE_REPO_NAME ?= dokku/dokku
DOKKU_UPDATE_VERSION ?= 0.1.0
DOKKU_UPDATE_VERSION ?= 0.2.0
DOKKU_UPDATE_ARCHITECTURE = amd64
DOKKU_UPDATE_PACKAGE_NAME = dokku-update_$(DOKKU_UPDATE_VERSION)_$(DOKKU_UPDATE_ARCHITECTURE).deb

4
debian/control vendored
View File

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

View File

@@ -2,7 +2,51 @@
> The backup plugin was deprecated in 0.4.x, below are backup recommendations for 0.5.x and later.
## Backup and Migration Tutorial
The best plan for disaster recovery is to always keep multiple (remote) copies of your local repo, static assets and periodic database dumps. Backups should be regularly tested for data integrity and completeness.
## TLDR
> Warning: This method has many caveats. Please read this entire document before assuming these backups work as expected, and test your backups on a regular basis.
### Creating a backup
To create a backup, run the following command at a time when not executing any Dokku commands or app deployments:
```shell
export BACKUP_TIME=$(date +%Y-%m-%d-%H-%M)
sudo mkdir -p /var/lib/dokku/services
sudo chown dokku:dokku /var/lib/dokku/services
mkdir -p /tmp/dokku-backups/
sudo tar -czvf "/tmp/dokku-backups/${BACKUP_TIME}.tar.gz" /home/dokku /var/lib/dokku/config /var/lib/dokku/data /var/lib/dokku/services /var/lib/dokku/plugins
```
This will create a point-in-time backup of your entire Dokku installation in the `/tmp/dokku-backups` directory. This backup may be moved offsite to another location via rsync, sftp, or some other protocol.
It is recommended that backups are regularly cleaned from the originating server and tested as necessary.
### Restoring a backup
To extract the backup onto another server, copy the backup to the server and extract it using the following command.
```shell
sudo tar -xzvf path/to/dokku/backup.tar.gz -C /
```
At this point, all datastores should be individually started and checked for data integrity. Once this is complete, individual applications can be rebuilt. Please consult the [process management documentation](/docs/deployment/process-management.md#rebuilding-apps) for more information on how to rebuild applications.
## Caveats
### App config
Application config is largely held in a small number of places:
- `/var/lib/dokku/config`: Properties set and managed by plugins
- `/var/lib/dokku/data`: Files generated or extracted by various plugins
- `/home/dokku`: Certain parts of Dokku core store data in this location
Compressing these directories when no Dokku commands are running is enough to ensure a complete backup of the system.
### Code Repositories
Because Dokku is git based, rebuilding a deployed app is as easy as pushing from git. You can push to a new server by updating the `dokku` remote in you local app's repo.
@@ -11,7 +55,14 @@ git remote rm dokku
git remote add dokku dokku@[dokku.me:dokku.me]
git push dokku [master]
```
## Databases
### Docker Image and Tar-based Apps
These applications may fail to rebuild via the normal `ps:rebuild` method. Redeploy these apps by running the original commands used to deploy them
### Datastores
> Please note that point-in-time backups of the `/var/lib/dokku/services` directory may contain partially written data due to how various datastores work. Consult the official datastore documentation for the best documentation surrounding proper backup and restore procedures.
Some plugins, like the official [dokku-postgres](https://github.com/dokku/dokku-postgres) plugin, have built-in commands that allow non-volatile data be exported and imported.
@@ -22,15 +73,26 @@ dokku postgres:export [db_name] > [db_name].dump
dokku postgres:import [db_name] < [db_name].dump
```
## Volumes and Static Assets
Additionally, data for official datastores is located in the `/var/lib/dokku/services` directory. If the directory is restored and the plugin is available, a `dokku $SERVICE:start` may be enough to restart the service with the underlying data, so long as the datastore version does not change and the underlying data is not corrupt. If this is the case, it may be necessary to re-import all the data onto a fresh version of the datastore service.
### Plugins
The plugin directory is contained at the `/var/lib/dokku/plugins` directory. Core plugins will automatically be included in new installs, but custom plugins may not. The aforementioned `tar` creation command will back all plugins up, and the `tar` extract command will restore the plugins.
Note that restoring a plugin will not trigger any `install` or `dependencies` triggers. You will need to run these manually. See the [plugin management documentation](/docs/advanced-usage/plugin-management.md#installing-a-plugin) for more information on how to trigger these two hooks.
### Volumes and Static Assets
Dokku doesn't enforce a [300mb](https://devcenter.heroku.com/articles/slug-compiler#slug-size) limit on apps, but it's best practice to keep binary assets outside of git. Since containers are considered volatile in Dokku, external stores like s3 or storage mounts should be used for non-volatile items like user uploads. The Dokku storage core plugin can be used to mount local directories / volumes inside the docker container.
System administrators are highly encouraged to store persistent data in app-specific subdirectories of the path `/var/lib/dokku/data/storage`. This will help ensure restores of the aforementioned primary Dokku directories will restore service to all apps.
See the [persistent storage documentation](/docs/advanced-usage/persistent-storage.md) for more information on how to attach persistent storage to your application.
## Disaster Recovery
## Recovering app code
The best plan for disaster recovery is to always keep multiple (remote) copies of your local repo, static assets and periodic database dumps. In case of an emergency when your git repo and backups are completely lost, you can recover the last pushed copy from your remote Dokku server (assuming you still have the ssh key).
In case of an emergency when your git repo and backups are completely lost, you can recover the last pushed copy from your remote Dokku server (assuming you still have the ssh key).
```shell
mkdir [app-name] ; cd !$

View File

@@ -2,7 +2,7 @@
> New as of 0.5.0
Sometimes you need to run a command on at deployment time, but before an app is completely deployed. Common use cases include:
Sometimes you need to run a command on deployment time, but before an app is completely deployed. Common use cases include:
* Checking a database is initialized
* Running database migrations

View File

@@ -25,7 +25,9 @@ dokku plugins-install
## Usage
You can list all installed plugins using the `plugin:list` command:
### Listing Plugins
Installed plugins can be listed via the `plugin:list` command:
```shell
dokku plugin:list
@@ -33,45 +35,60 @@ dokku plugin:list
```
plugn: dev
00_dokku-standard 0.22.0 enabled dokku core standard plugin
20_events 0.22.0 enabled dokku core events logging plugin
app-json 0.22.0 enabled dokku core app-json plugin
apps 0.22.0 enabled dokku core apps plugin
build-env 0.22.0 enabled dokku core build-env plugin
buildpacks 0.22.0 enabled dokku core buildpacks plugin
certs 0.22.0 enabled dokku core certificate management plugin
checks 0.22.0 enabled dokku core checks plugin
common 0.22.0 enabled dokku core common plugin
config 0.22.0 enabled dokku core config plugin
docker-options 0.22.0 enabled dokku core docker-options plugin
domains 0.22.0 enabled dokku core domains plugin
enter 0.22.0 enabled dokku core enter plugin
git 0.22.0 enabled dokku core git plugin
logs 0.22.0 enabled dokku core logs plugin
network 0.22.0 enabled dokku core network plugin
nginx-vhosts 0.22.0 enabled dokku core nginx-vhosts plugin
plugin 0.22.0 enabled dokku core plugin plugin
proxy 0.22.0 enabled dokku core proxy plugin
ps 0.22.0 enabled dokku core ps plugin
repo 0.22.0 enabled dokku core repo plugin
resource 0.22.0 enabled dokku core resource plugin
scheduler-docker-local 0.22.0 enabled dokku core scheduler-docker-local plugin
shell 0.22.0 enabled dokku core shell plugin
ssh-keys 0.22.0 enabled dokku core ssh-keys plugin
storage 0.22.0 enabled dokku core storage plugin
tags 0.22.0 enabled dokku core tags plugin
tar 0.22.0 enabled dokku core tar plugin
trace 0.22.0 enabled dokku core trace plugin
00_dokku-standard 0.22.3 enabled dokku core standard plugin
20_events 0.22.3 enabled dokku core events logging plugin
app-json 0.22.3 enabled dokku core app-json plugin
apps 0.22.3 enabled dokku core apps plugin
build-env 0.22.3 enabled dokku core build-env plugin
buildpacks 0.22.3 enabled dokku core buildpacks plugin
certs 0.22.3 enabled dokku core certificate management plugin
checks 0.22.3 enabled dokku core checks plugin
common 0.22.3 enabled dokku core common plugin
config 0.22.3 enabled dokku core config plugin
docker-options 0.22.3 enabled dokku core docker-options plugin
domains 0.22.3 enabled dokku core domains plugin
enter 0.22.3 enabled dokku core enter plugin
git 0.22.3 enabled dokku core git plugin
logs 0.22.3 enabled dokku core logs plugin
network 0.22.3 enabled dokku core network plugin
nginx-vhosts 0.22.3 enabled dokku core nginx-vhosts plugin
plugin 0.22.3 enabled dokku core plugin plugin
proxy 0.22.3 enabled dokku core proxy plugin
ps 0.22.3 enabled dokku core ps plugin
repo 0.22.3 enabled dokku core repo plugin
resource 0.22.3 enabled dokku core resource plugin
scheduler-docker-local 0.22.3 enabled dokku core scheduler-docker-local plugin
shell 0.22.3 enabled dokku core shell plugin
ssh-keys 0.22.3 enabled dokku core ssh-keys plugin
storage 0.22.3 enabled dokku core storage plugin
tags 0.22.3 enabled dokku core tags plugin
tar 0.22.3 enabled dokku core tar plugin
trace 0.22.3 enabled dokku core trace plugin
```
> Warning: All plugin commands other than `plugin:list` and `plugin:help` require sudo access and must be run directly from the Dokku server.
### Checking if a plugin is installed
You can check if a plugin has been installed via the `plugin:installed` command:
```shell
dokku plugin:installed postgres
```
### Installing a 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.
The most common usage is to install a plugin from a url. This url may be any of the following:
- `git`: For git+ssh based plugin repository clones.
- `ssh`: For git+ssh based plugin repository clones.
- `file`: For copying plugins from a path on disk.
- `https`: For http based plugin repository clones.
Additionally, any urls with the extensions `.tar.gz` or `.tgz` are treated as Gzipped Tarballs for installation purposes and will be downloaded and extracted into place.
```shell
dokku plugin:install https://github.com/dokku/dokku-postgres.git
```
@@ -87,7 +104,68 @@ Checking connectivity... done.
-----> Plugin postgres enabled
```
You can also uninstall a third-party plugin using the `plugin:uninstall` command:
For git-based plugin installation, a commit SHA-like object may be specified (tag/branch/commit sha) via the `--committish` argument and Dokku will attempt to install the specified commit object.
```shell
# where 2.0.0 is a potential git tag
dokku plugin:install https://github.com/dokku/dokku-postgres.git --committish 2.0.0
```
Plugin names are interpolated based on the repository name minus the `dokku-` prefix. If the plugin being installed has a name other than what matches the repository name - or another name is desired - the `--name` flag can be used to override this interpolation.
```shell
dokku plugin:install https://github.com/dokku/smoke-test-plugin.git --name smoke-test-plugin
```
The `--core` flag may also be indicated as the sole argument, though it is only for installation of core plugins, and thus not useful for end-user installations.
```shell
dokku plugin:install --core
```
Finally, all flags may be omitted to trigger the `install` procedures for both core and third-party plugins:
```shell
dokku plugin:install
```
### Installing plugin dependencies
In some cases, plugins will have system-level dependencies. These are not automatically installed via `plugin:install`, and must be separately via the `plugin:install-dependencies` command. This will run through all the `dependencies` trigger for all plugins.
```shell
dokku plugin:install-dependencies
```
This command may also target _just_ core plugins via the `--core` flag. This is usually only useful for source-based installs of Dokku.
```shell
dokku plugin:install-dependencies --core
```
### Updating a plugin
An installed, third-party plugin can be updated can updated via the `plugin:update` command. This should be done after any upgrades of Dokku as there may be changes in the internal api that require an update of how the plugin interfaces with Dokku.
Please note that this command is only valid for plugin installs that were backed by a git-repository.
```shell
dokku plugin:update postgres
```
```
Plugin (postgres) updated
```
An optional commit SHA-like object may be specified.
```shell
dokku plugin:update postgres 2.0.0
```
### Uninstalling a plugin
Third party plugins can be uninstalled using the `plugin:uninstall` command:
```shell
dokku plugin:uninstall postgres
@@ -97,7 +175,9 @@ dokku plugin:uninstall postgres
-----> Plugin postgres uninstalled
```
Enabling or disabling a plugin can also be useful in cases where you are debugging whether a third-party plugin is causing issues in your Dokku installation:
### Disabling a plugin
Disabling a plugin can also be useful for debugging whether a third-party plugin is causing issues in a Dokku installation. Another common use case is for disabling core functionality for replacement with a third-party plugin.
```shell
dokku plugin:disable postgres
@@ -107,6 +187,10 @@ dokku plugin:disable postgres
-----> Plugin postgres disabled
```
### Enabling a plugin
Disabled plugins can be re-enabled via the `plugin:enable` command.
```shell
dokku plugin:enable postgres
```
@@ -115,12 +199,10 @@ dokku plugin:enable postgres
-----> Plugin postgres enabled
```
Finally, you can update an installed third-party plugin. This should be done after any upgrades of Dokku as there may be changes in the internal api that require an update of how the plugin interfaces with Dokku.
### Triggering a plugin trigger
The `plugin:trigger` can be used to call any internal plugin trigger. This may have unintended consequences, and thus should only be called for development or debugging purposes.
```shell
dokku plugin:update postgres
```
```
Plugin (postgres) updated
dokku plugin:trigger some-internal-trigger args-go-here
```

View File

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

View File

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

View File

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

View File

@@ -19,6 +19,6 @@
"0.19.13",
"0.20.4",
"0.21.4",
"0.22.0"
"0.22.3"
]
}

View File

@@ -2,7 +2,7 @@
Given the constraints, running Dokku commands remotely via SSH is fine. For certain configurations, the extra complication of manually invoking ssh can be a burden.
While Dokku does not yet have an official client, there are a multitude of ways in which you can interact with your Dokku installation. The easiest is to use the **bash** client, though you may wish to use another.
The easiest way to interact with Dokku remotely is by using the official client. Documented below are the various clients that you may wish to use.
## Official Client

View File

@@ -1,6 +1,6 @@
# Deploying to Dokku
> Note: This walkthrough uses the hostname `dokku.me` in commands. When deploying to your own server, you should set the `DOKKU_DOMAIN` value in the `Vagrantfile` before you initialize the Vagrant VM.
> Note: This walkthrough uses the hostname `dokku.me` in commands. When deploying to your own server, you should substitute the domain `dokku.me` for the domain name or IP address associated with your server. Users of the Vagrant VM included with Dokku can use `dokku.me` which points to the IP of the VM.
## Deploy tutorial
@@ -103,6 +103,7 @@ Once the deploy is complete, the application's web URL will be generated as abov
Dokku supports deploying applications in a few ways:
- [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) via [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks): See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish-buildpacks.md) to learn about the different ways to specify a buildpack.
- This is the default method used by Dokku.
- [Dockerfile](https://docs.docker.com/reference/builder/): See the [dockerfile documentation](/docs/deployment/methods/dockerfiles.md) to learn about the different ways to configure Dockerfile-based deploys.
- [Docker Image](https://docs.docker.com/get-started/overview/#docker-objects): See the [docker image documentation](/docs/deployment/methods/images.md) to learn about how to deploy a Docker Image.
@@ -146,6 +147,7 @@ If you do not enter a fully qualified domain name when pushing your app, Dokku d
```shell
# from your local machine
# the remote username *must* be dokku or pushes will fail
# the below example assumes your app server domain or IP is dokku.me. Push in the form of: dokku@{serveripordomain}:{dokkuappname}
git remote add dokku dokku@dokku.me:ruby-getting-started
git push dokku main:master
```

View File

@@ -3,9 +3,9 @@
> New as of 0.7.0
```
ssh-keys:add <name> [/path/to/key] # Add a new public key by pipe or path
ssh-keys:list [<name>] # List of all authorized Dokku public ssh keys
ssh-keys:remove <name> # Remove SSH public key by name
ssh-keys:add <name> [/path/to/key] # Add a new public key by pipe or path
ssh-keys:list [--format text|json] [<name>] # List of all authorized Dokku public ssh keys
ssh-keys:remove [--fingerprint fingerprint|<name>] # Remove SSH public key by name
```
When pushing to Dokku, SSH key-based authorization is the preferred authentication method, for ease of use and increased security.
@@ -42,6 +42,20 @@ The keys for a specific user may be listed by specifying a second argument to th
dokku ssh-keys:list admin
```
> 0.22.3
The output format may be specified via the `--format` flag. Supported values include `json` and `text`.
```shell
dokku ssh-keys:list --format json
```
This can additionally be used to filter to keys for a particular user:
```shell
dokku ssh-keys:list --format json admin
```
### Adding SSH keys
You can add your public key to Dokku with the `ssh-keys:add` command. The output will be the fingerprint of the SSH key:
@@ -74,10 +88,16 @@ cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
As key names are unique, they can be used to remove a public SSH key.
```SHELL
```shell
dokku ssh-keys:remove KEY_NAME
```
An SSH Key can also be removed by fingerprint.
```shell
dokku ssh-keys:remove --fingerprint FINGERPRINT
```
## Scoping commands to specific users
Support for scoping commands to specific users can be added through plugins that take advantage of the [user-auth](/docs/development/plugin-triggers.md#user-auth) plugin trigger to handle command authorization.

View File

@@ -10,7 +10,7 @@ checks:run <app> [process-type(s)] Runs zero-downtime checks for all proce
checks:skip <app> [process-type(s)] Skip zero-downtime checks for all processes (or comma-separated process-type list)
```
By default, Dokku will wait `10` seconds after starting each container before assuming it is up and proceeding with the deploy. Once this has occurred for all containers started by for an application, traffic will be switched to point to your new containers. Dokku will also wait a further `60` seconds *after* the deploy is complete before terminating old containers in order to give time for long running connections to terminate. In either case, you may have more than one container running for a given application.
By default, Dokku will wait `10` seconds after starting each container before assuming it is up and proceeding with the deploy. Once this has occurred for all containers started by an application, traffic will be switched to point to your new containers. Dokku will also wait a further `60` seconds *after* the deploy is complete before terminating old containers in order to give time for long running connections to terminate. In either case, you may have more than one container running for a given application.
You may both create user-defined checks for web processes using a `CHECKS` file, as well as customize any and all parts of this experience using the checks plugin.

View File

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

View File

@@ -75,20 +75,14 @@ bats tests/unit/10_apps.bats tests/unit/10_certs.bats
In order to increase testing velocity, a wrapper script around Bats is available that can be used to run a single test case within a suite.
Tests within a suite may be listed by specifying the suite as a parameter to the `tests/bats-exec-test-single` script.
Tests within a suite may be listed by specifying the suite as a parameter to `bats`.
```shell
tests/bats-exec-test-single tests/unit/10_apps.bats
bats tests/unit/10_apps.bats
```
A single test can be specified as a second parameter. The test is selected by fuzzy-match, and only the first match is executed.
A single test can be specified via the `--filter` argument. The tests are selected via regex match, and all matches are executed.
```shell
tests/bats-exec-test-single tests/unit/10_apps.bats clone
```
Some special characters are translated in the test listing, specifically the characters `( ) :`, while others are not. The fuzzy matching happens on test names as listed by this script, so executing a test with a more specific name will work as expected.
```shell
tests/bats-exec-test-single tests/unit/10_apps.bats clone_-2d-2dskip-2ddeploy
bats --filter clone tests/unit/10_apps.bats
```

View File

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

View File

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

View File

@@ -46,6 +46,7 @@ Why do we recommend stopping all apps?
```shell
# for 0.22.0 and newer versions, use
dokku ps:stop --all
# for versions between 0.11.4 and 0.21.4, use
dokku ps:stopall

View File

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

View File

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

7
dokku
View File

@@ -144,12 +144,7 @@ execute_dokku_cmd() {
if [[ "$(readlink -f "$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}")" == *core-plugins* ]]; then
[[ ${argv[0]} == "$PLUGIN_CMD" ]] && shift 1
if [[ -n $DOKKU_APP_NAME ]]; then
if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then
shift 1
set -- "--no-restart" "$DOKKU_APP_NAME" "$@"
else
set -- "$DOKKU_APP_NAME" "$@"
fi
set -- "$DOKKU_APP_NAME" "$@"
fi
set -- "$PLUGIN_CMD" "$@"
fi

View File

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

View File

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

View File

@@ -25,7 +25,12 @@ type AppJSON struct {
func constructScript(command string, shell string, isHerokuishImage bool, hasEntrypoint bool) []string {
if hasEntrypoint {
return []string{command}
words, err := shellquote.Split(strings.TrimSpace(command))
if err != nil {
common.LogWarn(fmt.Sprintf("Skipping command construction for app with ENTRYPOINT: %v", err.Error()))
return nil
}
return words
}
script := []string{"set -eo pipefail;"}

View File

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

View File

@@ -1,6 +1,8 @@
package apps
import (
"strings"
"github.com/dokku/dokku/plugins/common"
)
@@ -12,7 +14,7 @@ func ReportSingleApp(appName, infoFlag string) error {
deploySource := ""
if b, err := common.PlugnTriggerSetup("deploy-source", []string{appName}...).SetInput("").Output(); err != nil {
deploySource = string(b[:])
deploySource = strings.TrimSpace(string(b[:]))
}
locked := "false"

View File

@@ -83,6 +83,17 @@ func destroyApp(appName string) error {
forceCleanup := true
common.DockerCleanup(appName, forceCleanup)
// remove contents for apps that are symlinks to other folders
if err := os.RemoveAll(fmt.Sprintf("%v/", common.AppRoot(appName))); err != nil {
common.LogWarn(err.Error())
}
// then remove the folder and/or the symlink
if err := os.RemoveAll(common.AppRoot(appName)); err != nil {
common.LogWarn(err.Error())
}
return nil
}
@@ -140,7 +151,7 @@ func maybeCreateApp(appName string) error {
}
b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_DISABLE_APP_AUTOCREATION"}...)
disableAutocreate := string(b[:])
disableAutocreate := strings.TrimSpace(string(b[:]))
if disableAutocreate == "true" {
common.LogWarn("App auto-creation disabled.")
return fmt.Errorf("Re-enable app auto-creation or create an app with 'dokku apps:create %s'", appName)

View File

@@ -6,6 +6,7 @@ require (
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -4,3 +4,5 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

View File

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

View File

@@ -1,13 +1,14 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/apps"
"github.com/dokku/dokku/plugins/common"
flag "github.com/spf13/pflag"
)
// main entrypoint to all subcommands
@@ -64,10 +65,12 @@ func main() {
err = apps.CommandRename(oldAppName, newAppName, *skipDeploy)
case "report":
args := flag.NewFlagSet("apps:report", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
infoFlag := args.Arg(1)
err = apps.CommandReport(appName, infoFlag)
osArgs, infoFlag, err := common.ParseReportArgs("apps", os.Args[2:])
if err == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = apps.CommandReport(appName, infoFlag)
}
case "unlock":
args := flag.NewFlagSet("apps:unlock", flag.ExitOnError)
args.Parse(os.Args[2:])

View File

@@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/common"
)
@@ -19,7 +18,7 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
return errors.New("Please specify an new app name")
}
if err := common.IsValidAppName(oldAppName); err != nil {
if err := common.VerifyAppName(oldAppName); err != nil {
return err
}
@@ -27,10 +26,6 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
return err
}
if err := appExists(oldAppName); err != nil {
return err
}
if err := appExists(newAppName); err == nil {
if ignoreExisting {
common.LogWarn("Name is already taken")
@@ -62,8 +57,8 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
// CommandCreate creates app via command line
func CommandCreate(appName string) error {
if appName == "" {
return errors.New("Please specify an app to run the command on")
if err := common.IsValidAppName(appName); err != nil {
return err
}
return createApp(appName)
@@ -71,8 +66,8 @@ func CommandCreate(appName string) error {
// CommandDestroy destroys an app
func CommandDestroy(appName string, force bool) error {
if appName == "" {
return errors.New("Please specify an app to run the command on")
if err := common.VerifyAppName(appName); err != nil {
return err
}
if force {
@@ -154,7 +149,7 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
return errors.New("Please specify an new app name")
}
if err := common.IsValidAppName(oldAppName); err != nil {
if err := common.VerifyAppName(oldAppName); err != nil {
return err
}
@@ -162,10 +157,6 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
return err
}
if err := appExists(oldAppName); err != nil {
return err
}
if err := appExists(newAppName); err == nil {
return errors.New("Name is already taken")
}
@@ -197,11 +188,6 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
// CommandReport displays an app report for one or more apps
func CommandReport(appName string, infoFlag string) error {
if strings.HasPrefix(appName, "--") {
infoFlag = appName
appName = ""
}
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {

View File

@@ -1,9 +1,6 @@
package apps
import (
"fmt"
"os"
"github.com/dokku/dokku/plugins/common"
)
@@ -31,16 +28,6 @@ func TriggerAppMaybeCreate(appName string) error {
func TriggerPostDelete(appName string) error {
imageRepo := common.GetAppImageRepo(appName)
// remove contents for apps that are symlinks to other folders
if err := os.RemoveAll(fmt.Sprintf("%v/", common.AppRoot(appName))); err != nil {
common.LogWarn(err.Error())
}
// then remove the folder and/or the symlink
if err := os.RemoveAll(common.AppRoot(appName)); err != nil {
common.LogWarn(err.Error())
}
imagesByAppLabel, err := listImagesByAppLabel(appName)
if err != nil {
common.LogWarn(err.Error())

View File

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

View File

@@ -15,7 +15,11 @@ trigger-builder-dockerfile-builder-release() {
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
if "$DOCKER_BIN" image history --format "{{ json . }}" "$IMAGE" | grep -q "ONBUILD"; then
dokku_log_warn "Image contains one or more ONBUILD directives, skipping label injection"
else
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
fi
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
}

View File

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

View File

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

View File

@@ -6,6 +6,7 @@ require (
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -4,3 +4,5 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

View File

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

View File

@@ -1,13 +1,14 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/buildpacks"
"github.com/dokku/dokku/plugins/common"
flag "github.com/spf13/pflag"
)
// main entrypoint to all subcommands
@@ -43,10 +44,12 @@ func main() {
err = buildpacks.CommandRemove(appName, buildpack, *index)
case "report":
args := flag.NewFlagSet("buildpacks:report", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
infoFlag := args.Arg(1)
err = buildpacks.CommandReport(appName, infoFlag)
osArgs, infoFlag, err := common.ParseReportArgs("buildpacks", os.Args[2:])
if err == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = buildpacks.CommandReport(appName, infoFlag)
}
case "set":
args := flag.NewFlagSet("buildpacks:set", flag.ExitOnError)
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")

View File

@@ -3,7 +3,6 @@ package buildpacks
import (
"errors"
"fmt"
"strings"
"github.com/dokku/dokku/plugins/common"
)
@@ -106,11 +105,6 @@ func CommandRemove(appName string, buildpack string, index int) (err error) {
// CommandReport displays a buildpacks report for one or more apps
func CommandReport(appName string, infoFlag string) error {
if strings.HasPrefix(appName, "--") {
infoFlag = appName
appName = ""
}
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {

View File

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

View File

@@ -16,9 +16,9 @@ is_file_import() {
local KEY_FILE="$2"
if [[ $CRT_FILE ]] && [[ $KEY_FILE ]]; then
if [[ ! -f $CRT_FILE ]]; then
if [[ ! -r $CRT_FILE ]]; then
dokku_log_fail "CRT file specified not found, please check file paths"
elif [[ ! -f $KEY_FILE ]]; then
elif [[ ! -r $KEY_FILE ]]; then
dokku_log_fail "KEY file specified not found, please check file paths"
else
return 0

View File

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

View File

@@ -69,7 +69,7 @@ func GetAppScheduler(appName string) string {
}
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SCHEDULER"}...)
value := string(b[:])
value := strings.TrimSpace(string(b[:]))
if value != "" {
return value
}
@@ -80,7 +80,7 @@ func GetAppScheduler(appName string) string {
// GetGlobalScheduler fetchs the global scheduler
func GetGlobalScheduler() string {
b, _ := PlugnTriggerOutput("config-get-global", []string{"DOKKU_SCHEDULER"}...)
value := string(b[:])
value := strings.TrimSpace(string(b[:]))
if value != "" {
return value
}
@@ -98,19 +98,19 @@ func GetDeployingAppImageName(appName, imageTag, imageRepo string) (string, erro
if err != nil {
return "", err
}
imageRemoteRepository := string(b[:])
imageRemoteRepository := strings.TrimSpace(string(b[:]))
b, err = PlugnTriggerOutput("deployed-app-image-tag", []string{appName}...)
if err != nil {
return "", err
}
newImageTag := string(b[:])
newImageTag := strings.TrimSpace(string(b[:]))
b, err = PlugnTriggerOutput("deployed-app-image-repo", []string{appName}...)
if err != nil {
return "", err
}
newImageRepo := string(b[:])
newImageRepo := strings.TrimSpace(string(b[:]))
if newImageRepo != "" {
imageRepo = newImageRepo
@@ -286,6 +286,27 @@ func GetenvWithDefault(key string, defaultValue string) (val string) {
return
}
// ParseReportArgs splits out flags from non-flags for input into report commands
func ParseReportArgs(pluginName string, arguments []string) ([]string, string, error) {
osArgs := []string{}
infoFlags := []string{}
for _, argument := range arguments {
if strings.HasPrefix(argument, "--") {
infoFlags = append(infoFlags, argument)
} else {
osArgs = append(osArgs, argument)
}
}
if len(infoFlags) == 0 {
return osArgs, "", nil
}
if len(infoFlags) == 1 {
return osArgs, infoFlags[0], nil
}
return osArgs, "", fmt.Errorf("%s:report command allows only a single flag", pluginName)
}
// ReportSingleApp is an internal function that displays a report for an app
func ReportSingleApp(reportType string, appName string, infoFlag string, infoFlags map[string]string, trimPrefix bool, uppercaseFirstCharacter bool) error {
flags := []string{}
@@ -395,10 +416,10 @@ func UcFirst(str string) string {
return ""
}
// IsValidAppName verifies app name format
// IsValidAppName verifies that the app name matches naming restrictions
func IsValidAppName(appName string) error {
if appName == "" {
return fmt.Errorf("APP must not be null")
return errors.New("Please specify an app to run the command on")
}
r, _ := regexp.Compile("^[a-z0-9][^/:_A-Z]*$")
@@ -406,18 +427,30 @@ func IsValidAppName(appName string) error {
return nil
}
appRoot := AppRoot(appName)
if DirectoryExists(appRoot) {
os.RemoveAll(appRoot)
}
return errors.New("App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores")
}
// VerifyAppName verifies app name format and app existence"
// isValidAppNameOld verifies that the app name matches the old naming restrictions
func isValidAppNameOld(appName string) error {
if appName == "" {
return errors.New("Please specify an app to run the command on")
}
r, _ := regexp.Compile("^[a-z0-9][^/:A-Z]*$")
if r.MatchString(appName) {
return nil
}
return errors.New("App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, or colons")
}
// VerifyAppName checks if an app conforming to either the old or new
// naming conventions exists
func VerifyAppName(appName string) error {
if err := IsValidAppName(appName); err != nil {
return err
newErr := IsValidAppName(appName)
oldErr := isValidAppNameOld(appName)
if newErr != nil && oldErr != nil {
return newErr
}
appRoot := AppRoot(appName)

View File

@@ -137,7 +137,7 @@ func DockerCleanup(appName string, forceCleanup bool) error {
skipCleanup := false
if appName != "" {
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SKIP_CLEANUP"}...)
output := string(b[:])
output := strings.TrimSpace(string(b[:]))
if output == "true" {
skipCleanup = true
}

View File

@@ -181,23 +181,43 @@ dokku_container_log_verbose_quiet() {
}
is_valid_app_name() {
declare desc="verify app name format"
declare desc="verify that the app name matches naming restrictions"
local APP="$1"
[[ -z "$APP" ]] && dokku_log_fail "APP must not be null"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
if [[ "$APP" =~ ^[a-z].* ]] || [[ "$APP" =~ ^[0-9].* ]]; then
if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]] && [[ ! $APP =~ [_] ]]; then
return 0
fi
fi
[[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "${DOKKU_ROOT:?}/$APP"
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores"
}
is_valid_app_name_old() {
declare desc="verify that the app name matches the old naming restrictions"
local APP="$1"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
if [[ "$APP" =~ ^[a-z].* ]] || [[ "$APP" =~ ^[0-9].* ]]; then
if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]]; then
return 0
fi
fi
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, or colons"
}
verify_app_name() {
declare desc="verify app name format and app existence"
local APP="$1"
is_valid_app_name "$APP"
declare APP="$1"
local VALID_NEW=false
local VALID_OLD=false
is_valid_app_name "$APP" 2>/dev/null && VALID_NEW=true
is_valid_app_name_old "$APP" 2>/dev/null && VALID_OLD=true
if [[ "$VALID_NEW" == "false" ]] && [[ "$VALID_OLD" == "false" ]]; then
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores"
fi
[[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist"
return 0
@@ -217,7 +237,6 @@ get_app_image_repo() {
declare desc="central definition of image repo pattern"
local APP="$1"
local IMAGE_REPO="dokku/$APP"
is_valid_app_name "$APP"
echo "$IMAGE_REPO"
}
@@ -226,7 +245,6 @@ get_deploying_app_image_name() {
local APP="$1"
local IMAGE_TAG="$2"
IMAGE_REPO="$3"
is_valid_app_name "$APP"
local IMAGE_REMOTE_REPOSITORY=$(plugn trigger deployed-app-repository "$APP")
local NEW_IMAGE_TAG=$(plugn trigger deployed-app-image-tag "$APP")
@@ -247,7 +265,6 @@ get_app_image_name() {
local APP="$1"
local IMAGE_TAG="$2"
IMAGE_REPO="$3"
is_valid_app_name "$APP"
if [[ -z "$IMAGE_REPO" ]]; then
IMAGE_REPO=$(get_app_image_repo "$APP")

View File

@@ -6,25 +6,20 @@ import (
"sync"
)
// ParallelCommand is a type that declares functions
// parallelCommand is a type that declares functions
// the ps plugins can execute in parallel
type ParallelCommand func(string) error
type parallelCommand func(string) error
// ParallelCommandRun contains all the arguments
// necessary for a parallel command run
type ParallelCommandRun struct {
Name string
}
// ParallelCommandResult is the result of a parallel
// parallelCommandResult is the result of a parallel
// command run
type ParallelCommandResult struct {
Name string
Error error
type parallelCommandResult struct {
Name string
CommandName string
Error error
}
// RunCommandAgainstAllApps runs a given ParallelCommand against all apps
func RunCommandAgainstAllApps(command ParallelCommand, commandName string, parallelCount int) error {
// RunCommandAgainstAllApps runs a given parallelCommand against all apps
func RunCommandAgainstAllApps(command parallelCommand, commandName string, parallelCount int) error {
runInSerial := false
if parallelCount < -1 {
@@ -49,8 +44,8 @@ func RunCommandAgainstAllApps(command ParallelCommand, commandName string, paral
return RunCommandAgainstAllAppsInParallel(command, commandName, parallelCount)
}
// RunCommandAgainstAllAppsInParallel runs a given ParallelCommand against all apps in parallel
func RunCommandAgainstAllAppsInParallel(command ParallelCommand, commandName string, parallelCount int) error {
// RunCommandAgainstAllAppsInParallel runs a given parallelCommand against all apps in parallel
func RunCommandAgainstAllAppsInParallel(command parallelCommand, commandName string, parallelCount int) error {
apps, err := DokkuApps()
if err != nil {
LogWarn(err.Error())
@@ -58,19 +53,19 @@ func RunCommandAgainstAllAppsInParallel(command ParallelCommand, commandName str
}
jobs := make(chan string, parallelCount)
results := make(chan ParallelCommandResult, len(apps))
results := make(chan parallelCommandResult, len(apps))
go allocateJobs(apps, jobs)
done := make(chan error)
go aggregateResults(results, done)
createParallelWorkerPool(jobs, results, command, parallelCount)
createParallelWorkerPool(jobs, results, command, commandName, parallelCount)
err = <-done
return err
}
// RunCommandAgainstAllAppsSerially runs a given ParallelCommand against all apps serially
func RunCommandAgainstAllAppsSerially(command ParallelCommand, commandName string) error {
// RunCommandAgainstAllAppsSerially runs a given parallelCommand against all apps serially
func RunCommandAgainstAllAppsSerially(command parallelCommand, commandName string) error {
apps, err := DokkuApps()
if err != nil {
LogWarn(err.Error())
@@ -81,6 +76,7 @@ func RunCommandAgainstAllAppsSerially(command ParallelCommand, commandName strin
for _, appName := range apps {
LogInfo1(fmt.Sprintf("Running %s against app %s", commandName, appName))
if err = command(appName); err != nil {
LogWarn(fmt.Sprintf("Error running %s against app %s: %s", commandName, appName, err.Error()))
errorCount++
}
}
@@ -99,12 +95,12 @@ func allocateJobs(input []string, jobs chan string) {
close(jobs)
}
func aggregateResults(results chan ParallelCommandResult, done chan error) {
func aggregateResults(results chan parallelCommandResult, done chan error) {
var parallelError error
errorCount := 0
for result := range results {
if result.Error != nil {
LogWarn(fmt.Sprintf("Error running command against %s", result.Name))
LogWarn(fmt.Sprintf("Error running %s against %s: %s", result.CommandName, result.Name, result.Error.Error()))
errorCount++
}
}
@@ -114,23 +110,24 @@ func aggregateResults(results chan ParallelCommandResult, done chan error) {
done <- parallelError
}
func createParallelWorker(jobs chan string, results chan ParallelCommandResult, command ParallelCommand, wg *sync.WaitGroup, workerID int) {
func createParallelWorker(jobs chan string, results chan parallelCommandResult, command parallelCommand, commandName string, wg *sync.WaitGroup, workerID int) {
for job := range jobs {
LogInfo1(fmt.Sprintf("Running command against %s", job))
output := ParallelCommandResult{
Name: job,
Error: command(job),
output := parallelCommandResult{
Name: job,
CommandName: commandName,
Error: command(job),
}
results <- output
}
wg.Done()
}
func createParallelWorkerPool(jobs chan string, results chan ParallelCommandResult, command ParallelCommand, numberOfWorkers int) {
func createParallelWorkerPool(jobs chan string, results chan parallelCommandResult, command parallelCommand, commandName string, numberOfWorkers int) {
var wg sync.WaitGroup
for i := 0; i < numberOfWorkers; i++ {
wg.Add(1)
go createParallelWorker(jobs, results, command, &wg, i)
go createParallelWorker(jobs, results, command, commandName, &wg, i)
}
wg.Wait()
close(results)

View File

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

View File

@@ -2,6 +2,7 @@ package common
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
@@ -79,7 +80,21 @@ func PlugnTrigger(triggerName string, args ...string) error {
// PlugnTriggerOutput fire the given plugn trigger with the given args
func PlugnTriggerOutput(triggerName string, args ...string) ([]byte, error) {
return PlugnTriggerSetup(triggerName, args...).Output()
rescueStderr := os.Stderr
r, w, _ := os.Pipe()
os.Stderr = w
out, err := PlugnTriggerSetup(triggerName, args...).Output()
w.Close()
readStderr, _ := ioutil.ReadAll(r)
os.Stderr = rescueStderr
var stderr error
if err != nil {
stderr = fmt.Errorf(string(readStderr[:]))
}
return out, stderr
}
// PlugnTriggerSetup sets up a plugn trigger call

View File

@@ -1,7 +1,6 @@
package config
import (
"errors"
"fmt"
"os"
"regexp"
@@ -145,9 +144,14 @@ func getEnvironment(appName string, merged bool) (env *Env) {
}
func getAppNameOrGlobal(appName string, global bool) (string, error) {
if appName == "" && !global {
return appName, errors.New("Please specify an app to run the command on or --global")
if global {
return appName, nil
}
if err := common.VerifyAppName(appName); err != nil {
return appName, err
}
return appName, nil
}

View File

@@ -56,6 +56,10 @@ func newEnvFromString(rep string) (env *Env, err error) {
//LoadAppEnv loads an environment for the given app
func LoadAppEnv(appName string) (env *Env, err error) {
err = common.VerifyAppName(appName)
if err != nil {
return
}
appfile, err := getAppFile(appName)
if err != nil {
return

View File

@@ -7,6 +7,7 @@ require (
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/joho/godotenv v1.2.0
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -6,3 +6,5 @@ github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc=
github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

View File

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

View File

@@ -1,13 +1,14 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/config"
flag "github.com/spf13/pflag"
)
func getKeys(args []string, global bool) []string {

View File

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

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
trigger-docker-options-post-delete() {
declare desc="deletes docker options files for an app"
declare trigger="post-delete"
declare APP="$1"
rm -f "$(fn-get-phase-file-path "$APP" "build")" "$(fn-get-phase-file-path "$APP" "deploy")" "$(fn-get-phase-file-path "$APP" "run")"
}
trigger-docker-options-post-delete "$@"

View File

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

View File

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

View File

@@ -139,12 +139,15 @@ cmd-git-hook() {
# if block if you wish to run it for others as well.
if [[ $refname == "refs/heads/${DOKKU_DEPLOY_BRANCH}" ]]; then
# broken out into plugin so we might support other methods to receive an app
# shellcheck disable=SC2086
git_receive_app "$APP" "$newrev"
else
if [[ $(find "$PLUGIN_PATH"/enabled/*/receive-branch 2>/dev/null | wc -l) != 1 ]]; then
# shellcheck disable=SC2086
plugn trigger receive-branch $APP $newrev $refname
elif [[ -z "$(fn-git-deploy-branch "$APP" "")" ]]; then
echo $'\e[1G\e[K'"-----> Set ${refname/refs\/heads\//} to DOKKU_DEPLOY_BRANCH."
fn-plugin-property-write "git" "$app" "deploy-branch" "${refname/refs\/heads\//}"
git_receive_app "$APP" "$newrev"
else
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to ${DOKKU_DEPLOY_BRANCH}."
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\//}:${DOKKU_DEPLOY_BRANCH}'"
@@ -169,9 +172,14 @@ git_build() {
local REF="$REV"
else
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
REF=$(<"$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH")
if [[ -f "$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH" ]]; then
REF=$(<"$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH")
fi
fi
if [[ -z "$REF" ]]; then
return
fi
# shellcheck disable=SC2086
git_build_app_repo $APP $REF
}

View File

@@ -85,6 +85,7 @@ fn-git-last-updated-at() {
fn-git-deploy-branch() {
declare desc="retrieve the deploy branch for a given application"
local APP="$1"
local DEFAULT_BRANCH="${2-master}"
local DOKKU_DEPLOY_BRANCH="$(fn-plugin-property-get "git" "$APP" "deploy-branch" "")"
local DOKKU_GLOBAL_DEPLOY_BRANCH="$(fn-plugin-property-get "git" "--global" "deploy-branch" "")"
@@ -93,6 +94,6 @@ fn-git-deploy-branch() {
elif [[ -n "$DOKKU_GLOBAL_DEPLOY_BRANCH" ]]; then
echo "$DOKKU_GLOBAL_DEPLOY_BRANCH"
else
echo "master"
echo "$DEFAULT_BRANCH"
fi
}

View File

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

14
plugins/git/post-create Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/git/functions"
trigger-git-post-create() {
declare desc="initializes an app with the correct git repository structure"
declare trigger="post-create"
declare APP="$1"
fn-git-create-hook "$APP"
}
trigger-git-post-create "$@"

View File

@@ -6,6 +6,7 @@ require (
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -4,3 +4,5 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

View File

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

View File

@@ -1,7 +1,6 @@
package main
import (
"flag"
"fmt"
"os"
"strconv"
@@ -9,6 +8,10 @@ import (
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/logs"
stdFlag "flag"
flag "github.com/spf13/pflag"
)
const (
@@ -19,39 +22,32 @@ Manage log integration for an app
Additional commands:`
helpContent = `
logs [-h] [-t] [-n num] [-q] [-p process] <app>, Display recent log output
logs [-h] [-t|--tail] [-n|--num num] [-q|--quiet] [-p|--ps process] <app>, Display recent log output
logs:failed [<app>], Shows the last failed deploy logs
`
)
func main() {
flag.Usage = usage
flag.Parse()
stdFlag.Usage = usage
stdFlag.Parse()
cmd := flag.Arg(0)
cmd := stdFlag.Arg(0)
switch cmd {
case "logs":
args := flag.NewFlagSet("logs", flag.ExitOnError)
var num int64
var ps string
var tail bool
var quiet bool
help := args.Bool("h", false, "-h: print help for the command")
args.Int64Var(&num, "n", 0, "-n: the number of lines to display")
args.Int64Var(&num, "num", 0, "--num: the number of lines to display")
args.StringVar(&ps, "p", "", "-p: only display logs from the given process")
args.StringVar(&ps, "ps", "", "--p: only display logs from the given process")
args.BoolVar(&tail, "t", true, "-t: continually stream logs")
args.BoolVar(&tail, "tail", true, "--tail: continually stream logs")
args.BoolVar(&quiet, "q", true, "-q: display raw logs without colors, time and names")
args.BoolVar(&quiet, "quiet", true, "--quiet: display raw logs without colors, time and names")
args.Parse(flag.Args()[1:])
num := args.Int64P("num", "n", 100, "the number of lines to display")
ps := args.StringP("ps", "p", "", "only display logs from the given process")
tail := args.BoolP("tail", "t", false, "continually stream logs")
quiet := args.BoolP("quiet", "q", false, "display raw logs without colors, time and names")
args.Parse(os.Args[2:])
if *help {
usage()
return
}
appName := args.Arg(0)
err := logs.CommandDefault(appName, num, ps, tail, quiet)
err := logs.CommandDefault(appName, *num, *ps, *tail, *quiet)
if err != nil {
common.LogFail(err.Error())
}

View File

@@ -1,13 +1,14 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/logs"
flag "github.com/spf13/pflag"
)
// main entrypoint to all subcommands

View File

@@ -26,6 +26,7 @@ func CommandDefault(appName string, num int64, process string, tail, quiet bool)
t := strconv.FormatBool(tail)
q := strconv.FormatBool(quiet)
n := strconv.FormatInt(num, 10)
if err := common.PlugnTrigger("scheduler-logs", []string{s, appName, process, t, q, n}...); err != nil {
return err
}

View File

@@ -7,6 +7,7 @@ require (
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -6,3 +6,5 @@ github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc=
github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

View File

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

View File

@@ -1,13 +1,14 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/network"
flag "github.com/spf13/pflag"
)
// main entrypoint to all subcommands
@@ -52,10 +53,12 @@ func main() {
err = network.CommandRebuildall()
case "report":
args := flag.NewFlagSet("network:report", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
infoFlag := args.Arg(1)
err = network.CommandReport(appName, infoFlag)
osArgs, infoFlag, err := common.ParseReportArgs("network", os.Args[2:])
if err == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = network.CommandReport(appName, infoFlag)
}
case "set":
args := flag.NewFlagSet("network:set", flag.ExitOnError)
args.Parse(os.Args[2:])

View File

@@ -124,11 +124,6 @@ func CommandRebuildall() error {
// CommandReport displays a network report for one or more apps
func CommandReport(appName string, infoFlag string) error {
if strings.HasPrefix(appName, "--") {
infoFlag = appName
appName = ""
}
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {

View File

@@ -168,5 +168,5 @@ nginx_clear_config() {
declare desc="Remove the nginx conf file"
declare APP="$1"
rm -f "$DOKKU_ROOT/$APP/nginx.conf"
fn-nginx-vhosts-nginx-init-cmd "reload"
suppress_output fn-nginx-vhosts-nginx-init-cmd "reload"
}

View File

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

View File

@@ -1,12 +1,15 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
trigger-nginx-vhosts-post-delete() {
declare desc="nginx-vhosts post-delete trigger"
declare trigger="post-delete"
declare APP="$1"
fn-plugin-property-destroy "nginx" "$APP"
restart_nginx "$@" >/dev/null
}

View File

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

View File

@@ -7,6 +7,7 @@ require (
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -6,3 +6,5 @@ github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc=
github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

View File

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

View File

@@ -1,13 +1,14 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/proxy"
flag "github.com/spf13/pflag"
)
// main entrypoint to all subcommands
@@ -63,10 +64,12 @@ func main() {
err = proxy.CommandPortsSet(appName, portMaps)
case "report":
args := flag.NewFlagSet("proxy:report", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
infoFlag := args.Arg(1)
err = proxy.CommandReport(appName, infoFlag)
osArgs, infoFlag, err := common.ParseReportArgs("proxy", os.Args[2:])
if err == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = proxy.CommandReport(appName, infoFlag)
}
case "set":
args := flag.NewFlagSet("proxy:set", flag.ExitOnError)
args.Parse(os.Args[2:])

View File

@@ -155,11 +155,6 @@ func CommandPortsSet(appName string, portMaps []string) error {
// CommandReport displays a proxy report for one or more apps
func CommandReport(appName string, infoFlag string) error {
if strings.HasPrefix(appName, "--") {
infoFlag = appName
appName = ""
}
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {

View File

@@ -9,6 +9,7 @@ require (
github.com/dokku/dokku/plugins/docker-options v0.0.0-00010101000000-000000000000
github.com/gofrs/flock v0.8.0
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
github.com/spf13/pflag v1.0.5 // indirect
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -10,3 +10,5 @@ github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqx
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

View File

@@ -1,57 +0,0 @@
#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
fn-ps-parallel-cmd() {
declare desc="Run a ps command against all apps"
declare CMD="$1"
local GNU_PARALLEL has_apps=false
for APP in $(dokku_apps); do
has_apps=true
break
done
if [[ "$has_apps" == "false" ]]; then
dokku_log_info1 "No apps detected"
return
fi
if which parallel >/dev/null 2>&1; then
dokku_log_info1 "Running 'dokku ps:${CMD}' in parallel"
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
if [[ -z "$GNU_PARALLEL" ]]; then
# shellcheck disable=SC2046
parallel $DOKKU_PARALLEL_ARGUMENTS -i bash -c "dokku ps:${CMD} {}" -- $(dokku_apps)
else
# shellcheck disable=SC2046
dokku_apps | parallel $DOKKU_PARALLEL_ARGUMENTS "dokku ps:${CMD} {}"
fi
return
fi
dokku_log_info1 "Running 'dokku ps:${CMD}' in serially"
for APP in $(dokku_apps); do
if ! (is_deployed "$APP"); then
dokku_log_warn "App $APP has not been deployed"
continue
fi
if [[ "$CMD" == "restore" ]]; then
local DOKKU_APP_RESTORE=$(config_get "$APP" DOKKU_APP_RESTORE || true)
if [[ "$DOKKU_APP_RESTORE" == 0 ]]; then
continue
fi
fi
dokku_log_verbose "Running 'dokku ps:${CMD} $APP' ..."
if ps_${CMD} "$APP"; then
continue
fi
dokku_log_warn "dokku ps:${CMD} $APP failed"
done
}

View File

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

View File

@@ -99,6 +99,7 @@ func Restore(appName string) error {
return fmt.Errorf("Error running pre-restore: %s", err)
}
common.LogInfo1("Clearing potentially invalid proxy configuration")
if err := common.PlugnTrigger("proxy-clear-config", []string{appName}...); err != nil {
return fmt.Errorf("Error clearing proxy config: %s", err)
}
@@ -111,9 +112,11 @@ func Restore(appName string) error {
b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_RESTORE"}...)
restore := strings.TrimSpace(string(b[:]))
if restore == "0" {
common.LogWarn(fmt.Sprintf("Skipping ps:restore for %s as DOKKU_APP_RESTORE=%s", appName, restore))
return nil
}
common.LogInfo1("Starting app")
return Start(appName)
}

View File

@@ -1,13 +1,14 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/ps"
flag "github.com/spf13/pflag"
)
// main entrypoint to all subcommands
@@ -31,10 +32,12 @@ func main() {
err = ps.CommandRebuild(appName, *allApps, *parallelCount)
case "report":
args := flag.NewFlagSet("ps:report", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
infoFlag := args.Arg(1)
err = ps.CommandReport(appName, infoFlag)
osArgs, infoFlag, err := common.ParseReportArgs("ps", os.Args[2:])
if err == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = ps.CommandReport(appName, infoFlag)
}
case "restart":
args := flag.NewFlagSet("ps:restart", flag.ExitOnError)
allApps := args.Bool("all", false, "--all: restart all apps")

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