Compare commits

...

259 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
642c293d5a Release 0.15.0
# History

## 0.15.0

Install/update via the bootstrap script:

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

### Bug Fixes

- #3479: @josegonzalez Turn off logging for nginx validate configuration
- #3470: @josegonzalez fix: correct the argument for get_release_cmd

### New Features

- #3469: @josegonzalez Resource management
- #3466: @josegonzalez Quieter builds
- #3467: @josegonzalez feat: update golang in use for binary building
- #3465: @josegonzalez Vagrant VM Enhancements
- #3464: @josegonzalez Upgrade to go-procfile-util version 0.6.0
- #3463: @josegonzalez Implement version flags
- #3462: @josegonzalez Upgrade procfile-util
- #3449: @josegonzalez Only override the `WORKDIR` in copy_from_image if the image is `gliderlabs/herokuish` based
- #3461: @josegonzalez Allow skipping aws releases for plugins
- #3459: @josegonzalez Upgrade to herokuish:0.4.9
- #3413: @josegonzalez Implement buildpacks plugin

### Documentation

- #3482: @multikatt rails-database -> railsdatabase
- #3476: @lazyatom Add chrome plugin to documentation
- #3468: @josegonzalez Doc cleanup

### Other

- #3471: @josegonzalez chore: drop plugn package building
2019-04-08 18:03:29 -04:00
Jose Diaz-Gonzalez
f05247226d Merge pull request #3469 from dokku/resource-management
Resource management
2019-04-08 17:17:42 -04:00
Jose Diaz-Gonzalez
a4c30c2ba9 chore: standardize variable naming 2019-04-08 16:36:30 -04:00
Jose Diaz-Gonzalez
b24697443a fix: correct the name 2019-04-08 15:18:46 -04:00
Jose Diaz-Gonzalez
a4114bb29d fix: clearing values has no returnable errors 2019-04-08 14:36:38 -04:00
Jose Diaz-Gonzalez
c41753c747 fix: clearing resources for web doesn't actually clear for everything 2019-04-08 14:17:16 -04:00
Jose Diaz-Gonzalez
4a6d3c25a4 fix: do not crash when clearing properties 2019-04-08 13:56:06 -04:00
Jose Diaz-Gonzalez
beef464cc1 fix: only uncomment port for sshd-config 2019-04-08 13:42:01 -04:00
Jose Diaz-Gonzalez
6cc6d5a33f fix: correct port application during local tests 2019-04-08 13:22:40 -04:00
Jose Diaz-Gonzalez
ff945c64fe fix: correct local test running 2019-04-08 13:18:28 -04:00
Jose Diaz-Gonzalez
d7c7511ea9 fix: correct comment on GetResourceValue 2019-04-08 12:52:30 -04:00
Jose Diaz-Gonzalez
0af8b2421d fix: correct range call 2019-04-08 12:42:25 -04:00
Jose Diaz-Gonzalez
71be7026d7 fix: correct GetResourceValue errors 2019-04-08 12:41:48 -04:00
Jose Diaz-Gonzalez
1683095233 fix: try and decrease number of compiles during release process 2019-04-08 12:41:06 -04:00
Jose Diaz-Gonzalez
c2898ec040 feat: add trigger to allow retrieving resource properties on the fly 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
243d5ecc43 feat: integrate resource plugin with scheduler-docker-local 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
3f0126a471 fix: do not output empty arguments
Also ensure we use Printf instead of Print...
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
8db3b8e333 fix: do not barf if there are no resources specified for an application 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
00c9e5a5e9 feat: first pass at implement resource limitation on a pre-process basis 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
e8134f9c2c feat: implement resource:report 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
c9bbddcfcb refactor: drop global resource limits
Global limits make it harder to reason about the inheritance in the system. Rather than support global limits, Dokku should provide primitives to automatically set them on an app at provision time, or explicitly set them for an app. Both of these are likely best suited for a higher-level provisioner, or a community plugin.
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
278a80cc25 feat: switch from _all_ to _default_ for process type
This is a special process type that signifies it's the default value for everything.
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
3ab271f756 refactor: drop implicit returns 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
982895ff71 fix: add missing argument 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
9acb9e527d feat: implement resource:*-clear commands 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
ab9f516c08 refactor: clean up duplication in retrieving and verifying the APP argument 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
c5717510ee feat: always get keys in order
Ranging over maps is unordered in golang, so we need to use the correct data structure if we need the output in an ordered way.
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
8d23556831 fix: omit 2nd, unused value from range 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
04a6e30e45 refactor: drop -defaults command in favor of --global flag
This makes usage a bit simpler, at the cost of interface complexity.
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
bdfde9a481 feat: initial stub implementation for resource:*-clear commands 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
9808ecde81 feat: implement default limit management
Also add generic report information when no flags are specified
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
b36ab54b87 fix: correct variable name 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
ff35e95924 fix: correct type comment declaration 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
49e44ce59b fix: correct stickler-ci issues 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
ab88dbb03d feat: Implement resource:limit and resource:reserve
Also add the install and post-delete hooks
2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
2e895286cf docs: drop ability to process multiple process types at once 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
5b2d4b3559 feat: add initial documentation for resource management plugin 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
8ad74d0814 fix: correct buildpack plugin version 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
9486576add fix: drop nil err reference from log output 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
2a353a9ca5 Merge pull request #3482 from multikatt/patch-1
rails-database -> railsdatabase
2019-04-05 18:20:29 -04:00
David
2d1f241677 rails-database -> railsdatabase
Naming the database rails-database throws
```Please specify a valid name for the service. Valid characters are: [A-Za-z0-9_]+```
2019-04-05 23:46:36 +02:00
Jose Diaz-Gonzalez
d6f122bfda Merge pull request #3479 from dokku/josegonzalez-patch-1
Turn off logging for nginx validate configuration
2019-03-28 12:30:27 -04:00
Jose Diaz-Gonzalez
54ef6514d5 fix: turn off error logging for validate config
This will allow validation to work if the default logging locations cannot be written to but the configuration is otherwise okay. This will be the case for users with custom nginx configurations that log to other places, such as syslog.
2019-03-26 17:10:32 -04:00
Jose Diaz-Gonzalez
abf7addaa6 Merge pull request #3476 from lazyatom/patch-1
Add chrome plugin to documentation
2019-03-19 14:29:25 -04:00
James Adam
e831b786f0 Add chrome plugin to documentation
Adds a link to the headless chrome plugin to the plugin documentation.
2019-03-19 17:20:21 +00:00
Jose Diaz-Gonzalez
c6074baad5 Merge pull request #3471 from dokku/plugn-builds-its-own-packages
chore: drop plugn package building
2019-03-16 03:49:05 -04:00
Jose Diaz-Gonzalez
7cb0d11b95 chore: drop plugn package building
The dokku/plugn project now builds and releases it's own packages on release creation.

Also upgrade to latest plugn version, 0.3.2
2019-03-16 03:16:28 -04:00
Jose Diaz-Gonzalez
87c77b1aa0 Merge pull request #3470 from dokku/josegonzalez-patch-1
fix: correct the argument for get_release_cmd
2019-03-14 14:26:10 -04:00
Jose Diaz-Gonzalez
7d2f5b84c8 fix: add missing head -n1 call to second build-env test
Otherwise `docker inspect` outputs a "condensed" json output that doesn't parse as well...
2019-03-14 13:44:54 -04:00
Jose Diaz-Gonzalez
8dcbfe5542 fix: correct case where there could be multiple build containers post-build
This happens when we execute several post-release scripts.
2019-03-14 13:12:07 -04:00
Jose Diaz-Gonzalez
f9023402ad fix: correct the argument for get_release_cmd
Closes #3438
2019-03-14 12:00:23 -04:00
Jose Diaz-Gonzalez
c658d60dc2 Merge pull request #3468 from dokku/doc-cleanup
Doc cleanup
2019-03-13 17:50:09 -04:00
Jose Diaz-Gonzalez
c1781c39ca docs: correct header
[ci skip]
2019-03-13 16:55:39 -04:00
Jose Diaz-Gonzalez
5f75b24fb2 docs: correct docker options information output 2019-03-13 16:55:11 -04:00
Jose Diaz-Gonzalez
3db5de1a9e Merge pull request #3466 from dokku/quieter-builds
Quieter builds
2019-03-13 15:00:27 -04:00
Jose Diaz-Gonzalez
520a72078e fix: remove useless cat 2019-03-13 14:12:35 -04:00
Jose Diaz-Gonzalez
ef5a45c7cb feat: add DOKKU_QUIET_OUTPUT=1 to all config_set/config_unset calls
This makes build output a bit more digestable.
2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
c6a1c0dcbf feat: respect --quiet in config.go
When setting environment variables, we should respect a passed `--quiet` flag - and the respective environment variable. This will allow users to have a nicer experience when using the config functions within their own plugins.
2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
c701429a05 chore: quiet down logging around scale declarations 2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
7f1fe3ccfd chore: follow logging pattern from heroku for phase command declarations 2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
6797971016 chore: drop extra echo in app-json method calls 2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
dc6abe691a Merge pull request #3467 from dokku/upgrade-golang
feat: update golang in use for binary building
2019-03-13 02:04:45 -04:00
Jose Diaz-Gonzalez
7333a630a1 feat: update golang in use for binary building
This change is not necessary other than for good house-keeping. All dokku-related binaries should _also_ be built with the latest golang.
2019-03-13 00:28:55 -04:00
Jose Diaz-Gonzalez
2edbc3fe39 Merge pull request #3465 from dokku/vm-enhancements
Vagrant VM Enhancements
2019-03-12 21:27:58 -04:00
Jose Diaz-Gonzalez
50357eb682 feat: add support for new vmware_desktop provider 2019-03-12 21:26:39 -04:00
Jose Diaz-Gonzalez
1203146ab9 feat: switch vagrant vm to ubuntu 18.04 2019-03-12 21:26:07 -04:00
Jose Diaz-Gonzalez
fc8637a0f5 Merge pull request #3464 from dokku/josegonzalez-patch-1
Upgrade to go-procfile-util version 0.6.0
2019-03-12 16:56:08 -04:00
Jose Diaz-Gonzalez
f3ace60a98 feat: upgrade to go-procfile-util version 0.6.0
Refs #3428
2019-03-12 16:23:33 -04:00
Jose Diaz-Gonzalez
8fe87358e1 Merge pull request #3463 from dokku/version-command
Implement version flags
2019-03-11 22:46:26 -04:00
Jose Diaz-Gonzalez
297a26aa20 feat: implement version flags
This moves the version command to the dokku binary, and also implements both -v and --version flags on the binary.
2019-03-11 21:50:05 -04:00
Jose Diaz-Gonzalez
2da16265cb Merge pull request #3462 from dokku/upgrade-procfile-util
feat: upgrade procfile-util
2019-03-11 21:13:28 -04:00
Jose Diaz-Gonzalez
25a65add4a Merge pull request #3449 from dokku/3263-copy-from-image
Only override the `WORKDIR` in copy_from_image if the image is `gliderlabs/herokuish` based
2019-03-11 21:01:21 -04:00
Jose Diaz-Gonzalez
a721abd972 feat: upgrade procfile-util
The new version properly handles trailing inline comments.
2019-03-11 20:09:53 -04:00
Jose Diaz-Gonzalez
acbe8fa805 fix: Only override the WORKDIR in copy_from_image if the image is gliderlabs/herokuish based
Rather than always assuming a missing `WORKDIR` means herokuish, we instead inspect the image to verify that it is. If it is, then and _only_ then do we set WORKDIR. Otherwise, we respect the decision of `docker cp` to execute from within the last known `WORKDIR` context, which is inherited at the image level, not image metadata level.

Additionally, speed up `is_image_herokuish_based` by inspecting the environment variables on the image. When there is a "USER=herokuishuser", we can more or less safely assume it is an image that Dokku built, and is therefore a herokuish image. While possible, it would be very strange if a non-herokuish image had this environment variable set, so it is a relatively safe change.
2019-03-11 20:09:13 -04:00
Jose Diaz-Gonzalez
57a1c68aba fix: correct shfmt 2019-03-11 19:12:57 -04:00
Jose Diaz-Gonzalez
83104bf919 Merge pull request #3461 from dokku/plugin-releasing
feat: allow skipping aws releases for plugins
2019-03-11 18:46:40 -04:00
Jose Diaz-Gonzalez
7574c407fa feat: allow skipping aws releases for plugins
If there is no configured s3 bucket/path, avoid attempting to push when `true` is passed as the second argument.
2019-03-11 18:30:03 -04:00
Jose Diaz-Gonzalez
f67a38864c Merge pull request #3459 from dokku/upgrade-herokuish
feat: upgrade to herokuish:0.4.9
2019-03-07 17:32:47 -05:00
Jose Diaz-Gonzalez
f632795904 feat: upgrade to herokuish:0.4.9 2019-03-07 17:29:42 -05:00
Jose Diaz-Gonzalez
0cf43b8623 Merge pull request #3413 from dokku/3256-buildpack-management
Implement buildpacks plugin
2019-03-05 22:22:56 -05:00
Jose Diaz-Gonzalez
d3d426a8d9 tests: add functional tests for buildpacks plugin 2019-03-05 21:41:23 -05:00
Jose Diaz-Gonzalez
6cae92e1f1 fix: add missing comments to exported functions 2019-03-05 21:41:23 -05:00
Jose Diaz-Gonzalez
3670d7efcd fix: correct fmt.Errorf violations 2019-03-05 21:41:23 -05:00
Jose Diaz-Gonzalez
887c1d4254 feat: implement buildpacks plugin
This will allow users to specify buildpacks outside of a git repository.

Note that this does not override any specified `BUILDPACK_URL`.

Closes #3256
2019-03-05 21:41:23 -05:00
Jose Diaz-Gonzalez
a56ae22614 refactor: switch to path.Join
This is the _correct_ way to join paths in golang
2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
884c45de0c chore: move print calls together 2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
8d6a1773a3 fix: correct the DOKKU_QUIET_OUTPUT env var check for golang log methods 2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
6f1e964c9f refactor: ensure all property-handling functions return an error
This will allow upstream functions to handle errors in the most appropriate manner
2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
4db7ebd743 feat: add helper method for ensuring a property file exists 2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
83f5e380d4 refactor: add helper method for getting the path of a property 2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
34f5eaeaa2 chore: rename helper method 2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
726f96089c Release 0.14.6
# History

## 0.14.6

Install/update via the bootstrap script:

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

### Bug Fixes

- #3448: @josegonzalez Remove https port mappings from new app during clone
- #3434: @tamanobi Ignore cache directories when clone

### New Features

- #3447: @josegonzalez Update herokuish to 0.4.8

### Documentation

- #3420: @baikunz Add reference to external post-deploy-script plugin
- #3453: @jayjun Fix Deployment guides style
- #3445: @zuccs Fix typo in deployment tasks documentation
- #3441: @josegonzalez Update issue template information
- #3436: @jayjun Fix Getting Started guides style
- #3425: @jayjun Add warning about PORT variable in deploy tutorial

### Tests

- #3435: @josegonzalez Fix lint issues across codebase
2019-02-19 11:50:20 -05:00
Jose Diaz-Gonzalez
6428b57775 Merge pull request #3420 from baikunz/patch-1
Add reference to external post-deploy-script plugin
2019-02-19 11:18:57 -05:00
Jose Diaz-Gonzalez
e3f0e09a4a Merge pull request #3453 from jayjun/deployment
Fix Deployment guides style
2019-02-19 10:41:42 -05:00
Jay Jun
e839c29916 Fix Deployment guides style 2019-02-19 20:01:24 +08:00
Jose Diaz-Gonzalez
42b6876f2c Merge pull request #3448 from dokku/3446-ssl-clone
Remove https port mappings from new app during clone
2019-02-15 03:59:47 -05:00
Jose Diaz-Gonzalez
d439518f13 fix: Remove https port mappings from new app during clone
Closes #3446
2019-02-15 03:15:14 -05:00
Jose Diaz-Gonzalez
f4be5adae0 Merge pull request #3447 from dokku/update-herokuish
Update herokuish to 0.4.8
2019-02-15 01:36:59 -05:00
Jose Diaz-Gonzalez
4b77a97148 feat: upgrade herokuish to 0.4.8 2019-02-15 01:36:24 -05:00
Jose Diaz-Gonzalez
dd92e9db1a feat: upgrade herokuish to 0.4.7 2019-02-15 01:36:06 -05:00
Jose Diaz-Gonzalez
ead82cdcf3 Merge pull request #3434 from tamanobi/fix/ignore-cache-directories-when-clone
ignore cache directories when clone
2019-02-15 01:24:05 -05:00
Jose Diaz-Gonzalez
9cce80d679 Merge pull request #3445 from zuccs/patch-1
Fix typo in deployment tasks documentation
2019-02-15 00:08:53 -05:00
zuccs
f43451de36 Fix typo 2019-02-15 16:05:24 +11:00
Jose Diaz-Gonzalez
5d1cd5ed47 Merge pull request #3441 from dokku/josegonzalez-patch-1
docs: Update issue template information
2019-02-11 11:10:37 -05:00
Jose Diaz-Gonzalez
de948e4d2b docs: Update issue template information
Remove duplicate information that is outdated.

[ci skip]
2019-02-11 11:10:18 -05:00
Kohki YAMAGIWA
db69f0cafa Merge branch 'master' into fix/ignore-cache-directories-when-clone 2019-02-10 21:59:01 +09:00
Jose Diaz-Gonzalez
c97ab482fb Merge pull request #3436 from jayjun/getting-started
Fix Getting Started guides style
2019-02-03 15:29:05 -05:00
Kohki YAMAGIWA
17ec77073a Merge branch 'master' into fix/ignore-cache-directories-when-clone 2019-02-04 00:30:58 +09:00
Tan Jay Jun
0967f3f7bf Fix Getting Started guides style 2019-02-03 16:15:42 +08:00
Jose Diaz-Gonzalez
86351724ff Merge pull request #3435 from dokku/lint-updates
Lint updates
2019-02-02 14:22:12 -05:00
Jose Diaz-Gonzalez
a97b3d1ed3 fix: exit with a status code between 1 and 255
Fixes SC2242
2019-02-02 13:52:42 -05:00
Jose Diaz-Gonzalez
c7b71b5d92 lint: remove unnecessary negation
Also use double-brackets where possible.

Fixes SC2236
2019-02-02 13:52:18 -05:00
Jose Diaz-Gonzalez
67ae374e60 lint: remove whitespaces before redirect 2019-02-02 13:49:24 -05:00
Jose Diaz-Gonzalez
b72deb2b2a Merge pull request #3425 from jayjun/port
Add warning about PORT variable in deploy tutorial
2019-01-29 12:57:24 -05:00
Jose Diaz-Gonzalez
c368cc0855 docs: must to should
Must is a bit too strong - its possible that the app responds to web requests, just on a different port...

[ci skip]
2019-01-29 12:57:07 -05:00
Tan Jay Jun
33800e226a Add warning about PORT variable in deploy tutorial 2019-01-30 01:47:27 +08:00
dorian ALKOUM
4539535c8c Reference Post Deploy Script plugin 2019-01-24 19:00:50 +01:00
Jose Diaz-Gonzalez
76bdac9747 Release 0.14.5
# History

## 0.14.5

Install/update via the bootstrap script:

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

### Bug Fixes

- #3419: @jayjun Fix Dokku installer checkbox for WebKit and Edge browsers
2019-01-24 10:32:52 -05:00
Jose Diaz-Gonzalez
d6b909adf4 Merge pull request #3419 from jayjun/checkbox
Fix Dokku installer checkbox for WebKit and Edge browsers
2019-01-24 10:07:32 -05:00
Tan Jay Jun
39a0e89a24 Fix Dokku installer checkbox for WebKit and Edge browsers 2019-01-24 22:54:29 +08:00
tamanobi
d35042066b return exit-status:0 when dokku clone 2019-01-24 22:07:15 +09:00
Jose Diaz-Gonzalez
9a690ba042 Release 0.14.4
# History

## 0.14.4

Install/update via the bootstrap script:

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

### Bug Fixes

- #3415: @josegonzalez Drop universe installation in debian
2019-01-22 13:31:40 -05:00
Jose Diaz-Gonzalez
11f90a1112 Merge pull request #3415 from dokku/josegonzalez-patch-1
Drop universe installation in debian
2019-01-22 13:31:16 -05:00
Jose Diaz-Gonzalez
954684f5b5 fix: drop universe installation in debian
This doesn't exist for debian, and is fine to skip.

[ci skip]
2019-01-22 13:30:59 -05:00
Jose Diaz-Gonzalez
39c0c316fc Release 0.14.3
# History

## 0.14.3

Install/update via the bootstrap script:

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

### Bug Fixes

- #3412: @josegonzalez Ensure official golang plugins have correct help output
- #3411: @josegonzalez Properly handle the nginx installation dependency
- #3406: @josegonzalez Add missing semicolons to app-json script
- #3394: @josegonzalez Quiet ps:retire where possible

### New Features

- #3410: @josegonzalez Make installs quieter
- #3409: @josegonzalez Build golang binaries with higher concurrency
- #3408: @josegonzalez Disable container restarts for stopped containers
- #3389: @heyarne Remove jQuery from web-based installer

### Documentation

- #3407: @tkrugg Fix typo on domain docs

### Tests

- #3414: @josegonzalez Test and release changes
2019-01-22 01:08:04 -05:00
Jose Diaz-Gonzalez
3285cacc97 Merge pull request #3414 from dokku/dokku-release-changes
Test and release changes
2019-01-21 22:32:03 -05:00
Jose Diaz-Gonzalez
7ac9c33112 tests: split by classname instead of filename 2019-01-21 21:57:03 -05:00
Jose Diaz-Gonzalez
f5c45b99ad refactor: use a base image when running the build process in CI 2019-01-21 21:53:35 -05:00
Jose Diaz-Gonzalez
af35de509b fix: drop extra release call in test run 2019-01-21 21:40:29 -05:00
Jose Diaz-Gonzalez
0798841f83 chore: standardize on a single naming scheme for releases
- "build" Dockerfiles should start with build-
- "release" scripts should have the name of the thing they are building appended
2019-01-21 21:40:10 -05:00
Jose Diaz-Gonzalez
8d577b275e Merge pull request #3412 from dokku/full-golang-help
Ensure official golang plugins have correct help output
2019-01-21 02:16:06 -05:00
Jose Diaz-Gonzalez
35e04d58fe Merge pull request #3411 from dokku/nginx-dependencies
Properly handle the nginx installation dependency
2019-01-21 02:15:53 -05:00
Jose Diaz-Gonzalez
af8718cebe fix: ensure official golang plugins have correct help output
Previously, golang plugins would omit subcommands for 'dokku help --all', meaning they could not be introspected upon by outside tooling.
2019-01-20 22:50:48 -05:00
Jose Diaz-Gonzalez
b7e5bbed08 Merge pull request #3410 from dokku/quieter-install
Make installs quieter
2019-01-20 22:43:09 -05:00
Jose Diaz-Gonzalez
6b0cdae3d3 fix: properly handle the nginx installation dependency
- ensure nginx is always installed
- install nginx in the same way for apt-using distros
- do not install software-properties-common or python-software-properties if not needed
2019-01-20 20:57:40 -05:00
Jose Diaz-Gonzalez
e423676b11 feat: make installs quieter
This removes output from commands that otherwise should be silent - such as when not needing to migrate data.
2019-01-20 20:54:00 -05:00
Jose Diaz-Gonzalez
1757bc0207 Merge pull request #3409 from dokku/faster-build
Build golang binaries with higher concurrency
2019-01-20 18:58:12 -05:00
Jose Diaz-Gonzalez
e7fb6007d3 feat: build golang binaries with higher concurrency
This should allow us to shave off a few minutes of build time, both locally and on CI
2019-01-20 18:12:08 -05:00
Jose Diaz-Gonzalez
2e446fc3be Merge pull request #3408 from dokku/container-restart-no
Disable container restarts for stopped containers
2019-01-20 16:24:35 -05:00
Jose Diaz-Gonzalez
173b87928c feat: disable container restarts for stopped containers
This should avoid the case where the docker daemon starts the containers upon reboot.
2019-01-20 15:19:54 -05:00
Jose Diaz-Gonzalez
1edb734df9 Merge pull request #3406 from dokku/3404-missing-semicolon
Add missing semicolons to app-json script
2019-01-20 15:05:43 -05:00
Jose Diaz-Gonzalez
6da8a54f86 Merge pull request #3407 from tkrugg/patch-1
typo
2019-01-20 14:29:41 -05:00
Youcef Mammar
eea863e556 typo 2019-01-20 18:35:02 +01:00
Jose Diaz-Gonzalez
db0df4e4ca Merge pull request #3389 from rbb-data/feature/remove-jquery
Remove jQuery from web-based installer
2019-01-20 11:28:33 -05:00
Jose Diaz-Gonzalez
b9b4693e20 fix: add missing semicolons 2019-01-20 11:21:53 -05:00
Arne Schlüter
699d205060 Remove external dependencies and warnings from setup page
* Remove jQuery dependency
* Add charset declaration to installer page
2019-01-18 13:15:19 +01:00
Jose Diaz-Gonzalez
5579fe0006 Merge pull request #3394 from dokku/retire-fixes
Quiet ps:retire where possible
2019-01-12 22:54:06 -05:00
Jose Diaz-Gonzalez
0375bc3e97 fix: quiet ps:retire where possible
Log output for ps:retire was previously a bit too verbose because we weren't handling the following edge-cases.

- if a container doesn't exist, remove it from the dead container list
- ensure a restarting container is properly killed
- only attempt to stop/kill if the state is not dead or exited
- do not attempt to do anything if the container doesn't exist
- correct check on running state
2019-01-12 22:49:23 -05:00
Jose Diaz-Gonzalez
49af2d8062 Release 0.14.2
# History

## 0.14.2

Install/update via the bootstrap script:

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

### Bug Fixes

- #3395: @josegonzalez Correct early exit 1 in apps:report

### Documentation

- #3393: @jayjun Fix capitalization and formatting in installation guides
- #3392: @jayjun Fix wrong PostgreSQL environment variable in guide
- #3391: @josegonzalez Update all gpgkey paths to the new url
2019-01-12 20:55:58 -05:00
Jose Diaz-Gonzalez
745f680899 Merge pull request #3393 from jayjun/install
Fix capitalization and formatting in installation guides
2019-01-12 19:50:56 -05:00
Jose Diaz-Gonzalez
e46e2f01f1 Merge pull request #3395 from dokku/log-exit
Correct early exit 1 in apps:report
2019-01-11 11:22:28 -05:00
Jose Diaz-Gonzalez
12b82b67e7 fix: correct early exit 1 in apps:report
Previously, if running 'dokku report --all', the early exit 1 in apps:report would cause the entire process to bail, resulting in a partial report. Instead, we exit 0, allowing plugn to continue.

Technically a non-deployed app is not an error case at this position.
2019-01-11 11:21:56 -05:00
Tan Jay Jun
a418cf6a25 Fix capitalization and formatting in installation guides 2019-01-11 19:55:46 +08:00
Jose Diaz-Gonzalez
01e6f378bd Merge pull request #3392 from jayjun/evar
Fix wrong PostgreSQL environment variable in guide
2019-01-11 06:36:51 -05:00
Tan Jay Jun
2e11804ec9 Fix wrong PostgreSQL environment variable in guide 2019-01-11 18:33:15 +08:00
Jose Diaz-Gonzalez
efca23c22e Merge pull request #3391 from dokku/3390-updated-gpgkey-path
Update all gpgkey paths to the new url
2019-01-10 12:18:30 -05:00
Jose Diaz-Gonzalez
6772c001dd docs: update all gpgkey paths to the new url
PackageCloud automatically switched our key earlier this week but some docs were still referencing the old path.

Closes #3390
2019-01-10 12:18:01 -05:00
Jose Diaz-Gonzalez
058646c9f9 Release 0.14.1
# History

## 0.14.1

Install/update via the bootstrap script:

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

### Bug Fixes

- #3386: @josegonzalez Ensure we can deploy code when there is no pre or post-deploy script defined
2019-01-09 10:20:10 -05:00
Jose Diaz-Gonzalez
32896debcf Merge pull request #3386 from dokku/3385-predeploy-fix
Ensure we can deploy code when there is no pre or post-deploy script defined
2019-01-09 09:01:58 -05:00
Jose Diaz-Gonzalez
4ae280528e fix: ensure we can deploy code when there is no pre or post-deploy script defined
Closes #3385
2019-01-09 07:46:04 -05:00
Jose Diaz-Gonzalez
924287c04f Release 0.14.0
# History

## 0.14.0

Install/update via the bootstrap script:

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

### Bug Fixes

- #3384: @josegonzalez fix: use updated gpg key for apt repository
- #3382: @josegonzalez Set cleanup to global when no application is specified
- #3350: @josegonzalez Do not build the proxy config when there are no app listeners
- #3366: @josegonzalez Add post-app-clone-setup to network clean make target
- #3349: @josegonzalez Ensure apps are cleanly cloned
- #3356: @josegonzalez Move storage directory into DOKKU_LIB_ROOT
- #3341: @baikunz Select only default dokku network IP
- #3348: @josegonzalez Use correct name for packagecloud token when running CI commands
- #3339: @josegonzalez Properly check args when calling cleanup globally
- #3344: @josegonzalez Allow running dokku report without needing an interactive shell

### New Features

- #3381: @josegonzalez Add support for the Procfile release command
- #3380: @josegonzalez Install stable docker when using bootstrap script
- #3378: @josegonzalez Make admin setup UI look nicer
- #3369: @josegonzalez Pull invalid nginx configuration when the nginx configs fail to validate
- #3371: @josegonzalez Add tests section to changelog
- #3358: @josegonzalez Image tag deploy workflow cleanup
- #3351: @josegonzalez Do not clone URLS and VHOST files to new apps
- #3357: @josegonzalez Add support for building arbitrary releases
- #3354: @josegonzalez Drop default dhparam key size to 2048
- #3347: @josegonzalez Upgrade herokuish
- #3352: @josegonzalez Increase security of default SSL setup
- #3353: @josegonzalez Normalize tests
- #3345: @josegonzalez Allow triggering the full report for all apps via --all flag
- #3346: @josegonzalez Always overwrite the dokku.conf file for nginx

### Documentation

- #3377: @josegonzalez Remove team member section on homepage in favor of sponsor section
- #3376: @josegonzalez Switch from rawgit to jsdelivr
- #3365: @josegonzalez Remove extra tags:create call from docs

### Tests

- #3379: @josegonzalez Run mvdan/shfmt on test runs
- #3370: @josegonzalez Add junit support to shellcheck output
- #3308: @josegonzalez Add timing info to test runs on CircleCI
- #3367: @josegonzalez Run tests from built artifact
- #3368: @josegonzalez Balance circleci tests
- #3363: @josegonzalez Add a wrapper for invoking a single test
- #3362: @josegonzalez Allow tests to be run from any directory
- #3360: @josegonzalez Switch to bats-core
- #3361: @josegonzalez Do not generate dhparam for tests

### Other

- #3279: @fruitl00p Make sure the universe repo is loaded into APT
2019-01-08 08:02:13 -05:00
Jose Diaz-Gonzalez
4b4119e52b Merge pull request #3381 from dokku/3136-release-support
Add support for the Procfile release command
2019-01-08 08:01:02 -05:00
Jose Diaz-Gonzalez
ca621129e2 Merge pull request #3384 from dokku/3383-fix-gpg-key
fix: use updated gpg key for apt repository
2019-01-08 07:57:35 -05:00
Jose Diaz-Gonzalez
0d8d43d4dd fix: use updated gpg key for apt repository
Packagecloud recently updated legacy repositories to sign with a repository-specific gpg key.

Closes #3383
2019-01-08 07:56:58 -05:00
Jose Diaz-Gonzalez
74e1cbd27d Merge pull request #3382 from dokku/fix-global-cleanup
Set cleanup to global when no application is specified
2019-01-07 16:11:02 -05:00
Jose Diaz-Gonzalez
9d45b0e2fb fix: set cleanup to global when no application is specified 2019-01-07 16:10:35 -05:00
Jose Diaz-Gonzalez
a5a66dd916 feat: add support for the Procfile release command
Closes #3136
2019-01-07 07:45:02 -05:00
Jose Diaz-Gonzalez
14a2699ac4 feat: make the app-json script execution quieter 2019-01-07 07:14:05 -05:00
Jose Diaz-Gonzalez
dfefdab67c refactor: simplify script execution
The previous method had a few too many nested if statements, making it difficult to track when and where the function stopped executing.
2019-01-07 07:04:02 -05:00
Jose Diaz-Gonzalez
952db832d9 refactor: move app.json script execution into it's own plugin
Rather than have this live in 00_dokku-standard, move it out so that it may start to support various other features around the app.json manifest.
2019-01-07 07:02:07 -05:00
Jose Diaz-Gonzalez
1a36c77c46 Merge pull request #3380 from dokku/3269-stable-docker
Install stable docker when using bootstrap script
2019-01-07 06:41:14 -05:00
Jose Diaz-Gonzalez
5c0b350cff feat: install stable docker when using bootstrap script
This script previously ran through the docker installation process with the edge channel on each run. Instead, we only run the docker installation if docker is not available. In addition, we force set the channel to stable, ensuring the script installs the correct channel for stable docker installations.

Closes #3269
2019-01-07 06:40:03 -05:00
Jose Diaz-Gonzalez
093fafe0b7 Merge pull request #3379 from dokku/shfmt
Run mvdan/shfmt on test runs
2019-01-07 02:05:16 -05:00
Jose Diaz-Gonzalez
86795ddacc tests: run mvdan/shfmt on test runs
While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™.

The command used to reprocess everything is:

```shell
shfmt -l -bn -ci -i 2 -w .
```
2019-01-07 01:25:55 -05:00
Jose Diaz-Gonzalez
fb7c73a7e3 fix: properly setup the tmp files necessary for the lint make target 2019-01-07 00:17:38 -05:00
Jose Diaz-Gonzalez
360cca08ef Merge pull request #3378 from dokku/setup-revamp-v1
Make admin setup UI look nicer
2019-01-06 22:41:07 -05:00
Jose Diaz-Gonzalez
2dd9ff3ac8 refactor: make admin setup UI look a bit nicer
The initial admin setup UI is a bit of a hack, but could also be a bit frustrating to new users as the settings are unclear. Rather than throw them to the wolves, include some useful information to allow them to make good decisions when setting up Dokku.

- Upgrade to latest bootstramp and latest jquery 1.x release
- Add a warning for people who might miss this setup page
- Add placeholder text to both the ssh key area and the hostname
- Add descriptions to all form fields to further explain the consequences of a particular field
- Add links where necessary for users who wish to explore how to change settings in the future
- Make the "result" message on submission red or green depending on the success or failure of the submission.
- Wait 3 seconds before redirecting on success
2019-01-06 22:38:49 -05:00
Jose Diaz-Gonzalez
f8766708c7 feat: add support for alternate ssh authorized_keys locations
On Ubuntu within AWS environments, the default user is the `ubuntu` user, and this is where the ssh key should be pulled from. CentOS has a tendency to use `ec2-user`.

On all other environments, the `root` user is typically the only user provisioned.

Closes #3372
2019-01-06 22:26:54 -05:00
Jose Diaz-Gonzalez
fba44b63a5 Merge pull request #3279 from fruitl00p/patch-3
Make sure the universe repo is loaded into APT
2019-01-06 20:49:46 -05:00
Jose Diaz-Gonzalez
51add20a53 fix: ensure software-properties-common is installed
It is necessary for add-apt-repository
2019-01-06 20:49:08 -05:00
Jose Diaz-Gonzalez
85bf4dd5cd tests: add support to junit output for marking what tests were excluded and all files that were processed
[ci skip]
2019-01-06 20:27:48 -05:00
Jose Diaz-Gonzalez
57766597ae Merge pull request #3370 from dokku/shellcheck-junit-output
Add junit support to shellcheck output
2019-01-05 23:27:17 -05:00
Jose Diaz-Gonzalez
f33784cbc9 fix: use correct encoding 2019-01-05 20:42:42 -05:00
Jose Diaz-Gonzalez
5f3b4640e8 refactor: use a python script to translate from shellcheck output to junit
The checkstyle xslt wasn't quite good enough, resulting in missing/malformatted output. Note that this now excludes _passing_ tests, which also isn't quite right, but a fair bit closer to the xsd here: https://github.com/windyroad/JUnit-Schema
2019-01-05 19:56:23 -05:00
Jose Diaz-Gonzalez
d67f719fe4 chore: lint python 2019-01-05 19:46:08 -05:00
Jose Diaz-Gonzalez
c4f1ef26c0 tests: move all shellcheck excludes into a single file
This will allow us to add/remove shellcheck excludes more easily.
2019-01-05 07:43:20 -05:00
Jose Diaz-Gonzalez
73eabec039 feat: add junit support to shellcheck output
This requires us to run shellcheck twice, as the first pass doesn't output anything human readable - both because of the redirect and because shellcheck doesn't directly support it - which increases lint runtime but allows us to have both the junit information and the normal human-readable output.

Note that the checkstyle output does not contain timing info.
2019-01-05 06:31:14 -05:00
Jose Diaz-Gonzalez
287a3c3542 Merge pull request #3350 from dokku/3262-check-web-listeners
Do not build the proxy config when there are no app listeners
2019-01-05 06:30:14 -05:00
Jose Diaz-Gonzalez
afacf32ba7 Merge pull request #3377 from dokku/3374-sponsor-dokku
Remove team member section on homepage in favor of sponsor section
2019-01-05 06:23:58 -05:00
Jose Diaz-Gonzalez
12d3f112e3 docs: Remove team member section on homepage in favor of sponsor section
This removes outdated information on the main page in favor of the "official" ways of sponsoring Dokku.

Also update the contributing note to mention where to post

Are you a crypto-user and want other options? Feel free to send bitcoin to 3MY2HxMVsxuWmhQkgYBsE3iZFjJgkjNPyQ

Closes #3374
2019-01-05 06:22:03 -05:00
Jose Diaz-Gonzalez
74b36bd66d Merge pull request #3376 from dokku/3284-bye-rawgit
Switch from rawgit to jsdelivr
2019-01-05 04:10:31 -05:00
Jose Diaz-Gonzalez
bb8d0324b5 docs: Switch from rawgit to jsdelivr
Rawgit is no longer being offered due to spammers, but jsdelivr has graciously allowed folks to use their cdn to mirror assets from github.

Closes #3284
2019-01-05 04:08:30 -05:00
Jose Diaz-Gonzalez
8b67d36c88 Merge pull request #3369 from dokku/3162-nginx-validate
Pull invalid nginx configuration when the nginx configs fail to validate
2018-12-31 12:40:22 -05:00
Jose Diaz-Gonzalez
0909052816 feat: Pull invalid nginx configuration when the nginx configs fail to validate
- expose an nginx:validate command that can be used to show validation information
- properly reference the invalid nginx config, rather than tell the user that another app's nginx config is invalid when deploying their own app
- allow a user to cleanup bad nginx config files out of band when they are blocking a deploy _without_ requiring knowing where that nginx config is

Note that this may have issues with generated nginx.conf files that depend on other apps or other parts of the nginx config. For now, this is acceptable, though it is something that needs to be field tested.

Closes #3162
2018-12-31 11:57:03 -05:00
Jose Diaz-Gonzalez
2c002177e4 Merge pull request #3371 from dokku/changelog-tests-section
Add tests section to changelog
2018-12-30 18:06:07 -05:00
Jose Diaz-Gonzalez
dbf21d6b8c feat: add tests section to changelog
For changes that are primarily test-related, pull them out into a specific section of the changelog.

[ci skip]
2018-12-30 18:05:48 -05:00
Jose Diaz-Gonzalez
7ad493c263 docs: do not reference commands as subcommands 2018-12-30 06:31:40 -05:00
Jose Diaz-Gonzalez
d1d9c57892 chore: add documentation to existing nginx commands 2018-12-30 06:31:18 -05:00
Jose Diaz-Gonzalez
bccfa8a3a0 fix: do not build the proxy config when there are no app listeners
This avoids cases where a developer believes they should be able to provision an nginx proxy but is unable to as no web process is configured to listen for the app.

Also silence stderr when extracting custom nginx templates. If there is stderr, that means we were not able to retrieve the template, but it's of no consequence for debugging.

Closes #3262
2018-12-30 05:11:36 -05:00
Jose Diaz-Gonzalez
68309d5659 Merge pull request #3308 from dokku/timing-info
Timing info in CircleCI
2018-12-29 21:22:18 -05:00
Jose Diaz-Gonzalez
95aeb27f0b feat: add timing info 2018-12-29 21:21:17 -05:00
Jose Diaz-Gonzalez
d2f116f958 Merge pull request #3367 from dokku/tests-from-built-artifact
Run tests from built artifact
2018-12-29 19:53:21 -05:00
Jose Diaz-Gonzalez
c344efdd8d tests: run tests from built artifact
Rather than testing against an install from source, ensure that all tests run from what _would_ be installed on a user's server. This ensures that the build process is sound, regardless of what code changes are implemented.
2018-12-29 18:32:52 -05:00
Jose Diaz-Gonzalez
dece1b52e0 Merge pull request #3368 from dokku/balance-tests
Balance circleci tests
2018-12-29 16:48:13 -05:00
Jose Diaz-Gonzalez
fbab5d2313 tests: balance circleci tests
This will help with test keep test times low
2018-12-29 16:47:52 -05:00
Jose Diaz-Gonzalez
10c56efdf7 Merge pull request #3366 from dokku/fix-network-clean
fix: add post-app-clone-setup to network clean make target
2018-12-29 16:36:03 -05:00
Jose Diaz-Gonzalez
56967ef950 fix: add post-app-clone-setup to network clean make target 2018-12-29 16:35:40 -05:00
Jose Diaz-Gonzalez
fc5f0c6685 Merge pull request #3365 from dokku/josegonzalez-patch-1
Remove extra tags:create call from docs
2018-12-29 16:29:58 -05:00
Jose Diaz-Gonzalez
9f05bd0dc3 docs: remove extra tag creation
The `latest` tag is now automatically created on tags:deploy.

[ci skip]
2018-12-29 16:29:30 -05:00
Jose Diaz-Gonzalez
682c6256bc Merge pull request #3363 from dokku/single-test
Add a wrapper for invoking a single test
2018-12-29 16:28:05 -05:00
Jose Diaz-Gonzalez
de89dd7319 Merge pull request #3362 from dokku/relative-test-runs
Allow tests to be run from any directory
2018-12-29 08:25:13 -05:00
Jose Diaz-Gonzalez
480b8ce42e tests: add a wrapper for invoking a single test
This can be used to increase testing velocity.
2018-12-29 08:01:14 -05:00
Jose Diaz-Gonzalez
dec181be6e tests: allow tests to be run from any directory
They previously required being run from repository root.
2018-12-29 07:33:59 -05:00
Jose Diaz-Gonzalez
c20826efa7 Merge pull request #3360 from dokku/upgrade-bats
Switch to bats-core
2018-12-29 07:21:51 -05:00
Jose Diaz-Gonzalez
10b6cd5b83 Merge pull request #3361 from dokku/faster-nginx-install
Do not generate dhparam for tests
2018-12-29 05:38:42 -05:00
Jose Diaz-Gonzalez
7ed7202c67 tests: switch to bats-core
This switches from the older, unmaintained version of bats to one that _is_ maintained. In particular, this fork of the community version - bats-core/bats-core - adds junit timing support, which can be used to track down slow tests.

Once the bats-core/bats-core repository merges junit support, we will switch back to upstream.

Note that tests on OS X will still run using a version that _does not_ have junit timing support.
2018-12-29 05:09:30 -05:00
Jose Diaz-Gonzalez
a54f672b5c tests: do not generate dhparam for tests
Tests will run much quicker if we don't need to regenerate this file. Note that this file _should not_ be used within installs.
2018-12-29 04:22:28 -05:00
Jose Diaz-Gonzalez
03ed58600c Merge pull request #3358 from dokku/3355-tags-deploys
Image tag deploy workflow cleanup
2018-12-28 23:41:01 -05:00
Jose Diaz-Gonzalez
95469f472e docs: add a warning concerning the addition of layers to herokuish-based images that are deployed via the tags plugin 2018-12-28 22:29:55 -05:00
Jose Diaz-Gonzalez
4a3707d36d feat: tag the "latest" image on tags deploy
If the image tag being deployed is not `latest`, we'll retag it as such once the deploy is complete.

Closes #3355
2018-12-28 22:29:53 -05:00
Jose Diaz-Gonzalez
4990a1cdda Merge pull request #3351 from dokku/2740-clone-domains
Do not clone URLS and VHOST files to new apps
2018-12-28 19:29:00 -05:00
Jose Diaz-Gonzalez
df1987e6c4 chore: reformat file to use spaces, not tabs 2018-12-28 19:00:42 -05:00
Jose Diaz-Gonzalez
81542ef089 feat: do not clone URLS and VHOST files to new apps
This follows the heroku pattern of ensuring applications are "freshly" created, routing-wise.

Closes #2740
2018-12-28 18:10:22 -05:00
Jose Diaz-Gonzalez
51dea4a220 fix: do not clone the tls directory
The tls directory stores the ssl certificate for an application, and should not be cloned to any new applications.

Refs #2740
2018-12-28 18:06:09 -05:00
Jose Diaz-Gonzalez
26ad2320cb Merge pull request #3349 from dokku/3249-clean-clones
Ensure apps are cleanly cloned
2018-12-28 18:05:43 -05:00
Jose Diaz-Gonzalez
29bad6b635 Merge pull request #3357 from dokku/build
Add support for building arbitrary releases
2018-12-28 17:57:22 -05:00
Jose Diaz-Gonzalez
39fad96b0d Merge pull request #3356 from dokku/storage-var-lib
Move storage directory into DOKKU_LIB_ROOT
2018-12-28 17:44:10 -05:00
Jose Diaz-Gonzalez
1bcf91895b fix: move storage directory into DOKKU_LIB_ROOT
Should this path change in the future, the storage plugin will respect the variable value.

[ci skip]
2018-12-28 17:43:32 -05:00
Jose Diaz-Gonzalez
fd5aa596d1 feat: add support for building arbitrary releases
This will let us support creating a build release that can be used to test anyone's PR.
2018-12-28 17:42:15 -05:00
Jose Diaz-Gonzalez
c5143cb722 chore: switch to dokku_log_info1_quiet 2018-12-28 17:02:09 -05:00
Jose Diaz-Gonzalez
a9d46ada5d feat: add test for old app during apps:clone --skip-deploy
If you skip a deploy and then destroy the newly created app, the old application should continue functioning like normal.
2018-12-28 17:02:09 -05:00
Jose Diaz-Gonzalez
f3a33e74d7 fix: remove CONTAINER files on app clone
This will ensure we don't accidentally destroy old applications if the new app isn't rebuilt or the rebuild fails.

Closes #3249
2018-12-28 17:02:08 -05:00
Jose Diaz-Gonzalez
cfd8f237df feat: cleanup IP and PORT files on app clone 2018-12-28 17:02:06 -05:00
Jose Diaz-Gonzalez
34d248a28c fix: remove old nginx.conf from a new app on clone 2018-12-27 21:31:57 -05:00
Jose Diaz-Gonzalez
0498a707c8 fix: Add a trigger to allow plugins to cleanup after a new clone is created 2018-12-27 21:31:57 -05:00
Jose Diaz-Gonzalez
86cc15d285 Merge pull request #3354 from dokku/josegonzalez-patch-1
Drop default dhparam key size to 2048
2018-12-27 21:21:41 -05:00
Jose Diaz-Gonzalez
f25f45b67e fix: drop dhparam key size to 2048
4096 takes so long on a very fast machine - 32 core, 64 gb droplet - that most users will begin to believe that it will never complete.
2018-12-27 21:21:06 -05:00
Jose Diaz-Gonzalez
a7c5e74c91 Merge pull request #3341 from baikunz/single-ipadress
Select only default dokku network IP
2018-12-27 19:37:49 -05:00
dorian
47462fcb6f WIP add tests 2018-12-27 23:32:28 +01:00
Jose Diaz-Gonzalez
077f5c1281 Merge pull request #3347 from dokku/upgrade-herokuish
Upgrade herokuish
2018-12-27 15:11:29 -05:00
Jose Diaz-Gonzalez
54990ebf83 Merge pull request #3352 from dokku/3343-ssl-enhancements
Increase security of default SSL setup
2018-12-27 15:10:04 -05:00
Jose Diaz-Gonzalez
af742f70c6 Merge pull request #3353 from dokku/normalize-tests
Normalize tests
2018-12-27 15:09:43 -05:00
Jose Diaz-Gonzalez
2fc51bcf53 fix: wrap all output and status variables in quotes
This will ensure newlines are replaced when these variables are output for debugging tests
2018-12-27 09:02:39 -05:00
Jose Diaz-Gonzalez
3656651cb9 refactor: wrap all 'run dokku' calls in /bin/bash calls 2018-12-27 09:02:26 -05:00
Jose Diaz-Gonzalez
a9920e7cf9 Merge pull request #3348 from dokku/packagecloud-token
Use correct name for packagecloud token when running CI commands
2018-12-27 08:35:07 -05:00
Jose Diaz-Gonzalez
ba8037b4bd feat: switch to move secure ssl ciphers
The cipher list is from from https://cipherli.st/ and will remove a few older browsers:

- Android 5.0
- Android 6.0
- Chrome 49 / XP SP3
- Firefox 31.3.0 ESR / Win 7
- Firefox 47 / Win 7  R
- IE 11 / Win Phone 8.1

I _think_ thats an okay drop - dropping Android kinda hurts, but we're far from the only ones dropping them from being served, and our users are free to override these settings on their own servers.

Closes #3343
2018-12-27 06:22:37 -05:00
Jose Diaz-Gonzalez
92ae1b678a feat: increase RSA bit keys to 4096
Refs #3343
2018-12-27 06:21:50 -05:00
Jose Diaz-Gonzalez
fbf19daff8 fix: use correct name for packagecloud token when running CI commands 2018-12-27 04:36:32 -05:00
Jose Diaz-Gonzalez
53d66246d8 feat: upgrade herokuish 2018-12-27 04:34:23 -05:00
Jose Diaz-Gonzalez
90105e3c6a Merge pull request #3339 from dokku/fix-global-cleanup
Properly check args when calling cleanup globally
2018-12-27 04:09:22 -05:00
Jose Diaz-Gonzalez
53ad759da8 Merge pull request #3344 from dokku/non-interactive-report
Allow running dokku report without needing an interactive shell
2018-12-27 04:08:36 -05:00
Jose Diaz-Gonzalez
72f531001e Merge pull request #3345 from dokku/report-all-flag
Allow triggering the full report for all apps via --all flag
2018-12-27 04:08:20 -05:00
Jose Diaz-Gonzalez
f49754de7a Merge pull request #3346 from dokku/overwrite-dokku-nginx-conf
feat: always overwrite the dokku.conf file for nginx
2018-12-27 04:08:02 -05:00
Jose Diaz-Gonzalez
8bc87ee656 feat: always overwrite the dokku.conf file for nginx
This is necessary as sometimes older config is shipped with Dokku, meaning that security directives - amongst others - are not properly updated.

Refs #3342
2018-12-26 23:05:01 -05:00
Jose Diaz-Gonzalez
e838fe7b96 feat: allow triggering the full report for all apps via --all flag 2018-12-26 23:03:00 -05:00
Jose Diaz-Gonzalez
a688a23d1a fix: Allow running dokku report without needing an interactive shell 2018-12-26 23:00:36 -05:00
dorian
ccfaeb0e36 Select only default dokku network IP 2018-12-23 20:54:20 +01:00
Jose Diaz-Gonzalez
f3c0c70b22 fix: properly check args when calling cleanup globally 2018-12-18 02:30:11 -05:00
Robin Speekenbrink
7e990963f1 Make sure the universe repo is loaded into APT
this should fix #3278
2018-10-06 01:27:29 +02:00
501 changed files with 10191 additions and 3404 deletions

View File

@@ -16,9 +16,10 @@ jobs:
sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev eth0
- run: |
case $CIRCLE_NODE_INDEX in
0) sudo -E make -e lint ;;
1) sudo -E make -e go-tests ci-go-coverage;;
2) sudo -E make -e deploy-test-checks-root deploy-test-config deploy-test-multi deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
0) sudo -E make -e lint go-tests ci-go-coverage ;;
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
2) sudo -E make -e deploy-test-multi ;;
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
esac
- run:
shell: /bin/bash
@@ -26,3 +27,8 @@ jobs:
no_output_timeout: 60m
- store_artifacts:
path: ./coverage.out
- store_artifacts:
path: ./test-results
destination: test-results
- store_test_results:
path: test-results

View File

@@ -3,8 +3,9 @@
.git
.vagrant
contrib
build
docs
tests
!contrib/dokku-installer.py
!contrib/dokku-update
!contrib/bash-completion
!contrib/bash-completion

4
.gitignore vendored
View File

@@ -4,8 +4,10 @@
.ruby-version
.idea/
.vagrant
build/
data/
test-results/
stack.tgz
tmp
coverage.out
contrib/dokku-update-version
contrib/dokku-update-version

View File

@@ -11,7 +11,7 @@ several ways to help out:
* Contribute to the [documentation](http://dokku.viewdocs.io/dokku/)
* Come up with new ways to show off our [lovely logo](https://avatars1.githubusercontent.com/u/13455795)
* Blog about different ways you are using dokku
* [Sponsor](https://opencollective.com/dokku#support) the Dokku project financially
* Sponsor the Dokku project financially on [OpenCollective](https://opencollective.com/dokku#support) or [Patreon](https://www.patreon.com/dokku)
There are a few guidelines that we need contributors to follow so that we have
a chance of keeping on top of things.
@@ -55,22 +55,10 @@ doesn't already include that problem or suggestion before submitting an issue.
If you find a match, add a quick "+1" or "I have this problem too." Doing this
helps prioritize the most common problems and requests.
When reporting issues, please include your host OS (Ubuntu 14.04, CentOS 7,
etc). Please include:
* The output of `uname -a`.
* The output of `free -m`
* The output of `docker version`.
* The output of `docker -D info`.
* The output of `sigil -v`.
* The output of `docker run --rm -ti gliderlabs/herokuish:latest herokuish version`
* The output of `dokku version`.
* The output of `dokku plugin`.
Please also include the steps required to reproduce the problem if possible and
applicable. This information will help us review and fix your issue faster.
Our Issue Report Template is available [here](https://github.com/dokku/dokku/blob/master/ISSUE_TEMPLATE.md)
When reporting issues, please include all the information we ask for in our
[issue template](https://github.com/dokku/dokku/blob/master/ISSUE_TEMPLATE.md).
Not doing so will prolongue the support period, making it more difficult to support
you.
## Contributing
@@ -126,7 +114,7 @@ Be patient! The Dokku maintainers will review all pull requests and comment as
quickly as possible. There may be some back and forth while the details of your
pull request are discussed.
In the unlikely event that your pull request does not get merged, the dokku
In the unlikely event that your pull request does not get merged, the Dokku
maintainers will either provide an alternative patch or guide you towards a
better solution to the problem at hand.

View File

@@ -1,5 +1,224 @@
# History
## 0.15.0
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.15.0/bootstrap.sh
sudo DOKKU_TAG=v0.15.0 bash bootstrap.sh
```
### Bug Fixes
- #3479: @josegonzalez Turn off logging for nginx validate configuration
- #3470: @josegonzalez fix: correct the argument for get_release_cmd
### New Features
- #3469: @josegonzalez Resource management
- #3466: @josegonzalez Quieter builds
- #3467: @josegonzalez feat: update golang in use for binary building
- #3465: @josegonzalez Vagrant VM Enhancements
- #3464: @josegonzalez Upgrade to go-procfile-util version 0.6.0
- #3463: @josegonzalez Implement version flags
- #3462: @josegonzalez Upgrade procfile-util
- #3449: @josegonzalez Only override the `WORKDIR` in copy_from_image if the image is `gliderlabs/herokuish` based
- #3461: @josegonzalez Allow skipping aws releases for plugins
- #3459: @josegonzalez Upgrade to herokuish:0.4.9
- #3413: @josegonzalez Implement buildpacks plugin
### Documentation
- #3482: @multikatt rails-database -> railsdatabase
- #3476: @lazyatom Add chrome plugin to documentation
- #3468: @josegonzalez Doc cleanup
### Other
- #3471: @josegonzalez chore: drop plugn package building
## 0.14.6
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.14.6/bootstrap.sh
sudo DOKKU_TAG=v0.14.6 bash bootstrap.sh
```
### Bug Fixes
- #3448: @josegonzalez Remove https port mappings from new app during clone
- #3434: @tamanobi Ignore cache directories when clone
### New Features
- #3447: @josegonzalez Update herokuish to 0.4.8
### Documentation
- #3420: @baikunz Add reference to external post-deploy-script plugin
- #3453: @jayjun Fix Deployment guides style
- #3445: @zuccs Fix typo in deployment tasks documentation
- #3441: @josegonzalez Update issue template information
- #3436: @jayjun Fix Getting Started guides style
- #3425: @jayjun Add warning about PORT variable in deploy tutorial
### Tests
- #3435: @josegonzalez Fix lint issues across codebase
## 0.14.5
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.14.5/bootstrap.sh
sudo DOKKU_TAG=v0.14.5 bash bootstrap.sh
```
### Bug Fixes
- #3419: @jayjun Fix Dokku installer checkbox for WebKit and Edge browsers
## 0.14.4
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.14.4/bootstrap.sh
sudo DOKKU_TAG=v0.14.4 bash bootstrap.sh
```
### Bug Fixes
- #3415: @josegonzalez Drop universe installation in debian
## 0.14.3
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.14.3/bootstrap.sh
sudo DOKKU_TAG=v0.14.3 bash bootstrap.sh
```
### Bug Fixes
- #3412: @josegonzalez Ensure official golang plugins have correct help output
- #3411: @josegonzalez Properly handle the nginx installation dependency
- #3406: @josegonzalez Add missing semicolons to app-json script
- #3394: @josegonzalez Quiet ps:retire where possible
### New Features
- #3410: @josegonzalez Make installs quieter
- #3409: @josegonzalez Build golang binaries with higher concurrency
- #3408: @josegonzalez Disable container restarts for stopped containers
- #3389: @heyarne Remove jQuery from web-based installer
### Documentation
- #3407: @tkrugg Fix typo on domain docs
### Tests
- #3414: @josegonzalez Test and release changes
## 0.14.2
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.14.2/bootstrap.sh
sudo DOKKU_TAG=v0.14.2 bash bootstrap.sh
```
### Bug Fixes
- #3395: @josegonzalez Correct early exit 1 in apps:report
### Documentation
- #3393: @jayjun Fix capitalization and formatting in installation guides
- #3392: @jayjun Fix wrong PostgreSQL environment variable in guide
- #3391: @josegonzalez Update all gpgkey paths to the new url
## 0.14.1
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.14.1/bootstrap.sh
sudo DOKKU_TAG=v0.14.1 bash bootstrap.sh
```
### Bug Fixes
- #3386: @josegonzalez Ensure we can deploy code when there is no pre or post-deploy script defined
## 0.14.0
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.14.0/bootstrap.sh
sudo DOKKU_TAG=v0.14.0 bash bootstrap.sh
```
### Bug Fixes
- #3384: @josegonzalez fix: use updated gpg key for apt repository
- #3382: @josegonzalez Set cleanup to global when no application is specified
- #3350: @josegonzalez Do not build the proxy config when there are no app listeners
- #3366: @josegonzalez Add post-app-clone-setup to network clean make target
- #3349: @josegonzalez Ensure apps are cleanly cloned
- #3356: @josegonzalez Move storage directory into DOKKU_LIB_ROOT
- #3341: @baikunz Select only default dokku network IP
- #3348: @josegonzalez Use correct name for packagecloud token when running CI commands
- #3339: @josegonzalez Properly check args when calling cleanup globally
- #3344: @josegonzalez Allow running dokku report without needing an interactive shell
### New Features
- #3381: @josegonzalez Add support for the Procfile release command
- #3380: @josegonzalez Install stable docker when using bootstrap script
- #3378: @josegonzalez Make admin setup UI look nicer
- #3369: @josegonzalez Pull invalid nginx configuration when the nginx configs fail to validate
- #3371: @josegonzalez Add tests section to changelog
- #3358: @josegonzalez Image tag deploy workflow cleanup
- #3351: @josegonzalez Do not clone URLS and VHOST files to new apps
- #3357: @josegonzalez Add support for building arbitrary releases
- #3354: @josegonzalez Drop default dhparam key size to 2048
- #3347: @josegonzalez Upgrade herokuish
- #3352: @josegonzalez Increase security of default SSL setup
- #3353: @josegonzalez Normalize tests
- #3345: @josegonzalez Allow triggering the full report for all apps via --all flag
- #3346: @josegonzalez Always overwrite the dokku.conf file for nginx
### Documentation
- #3377: @josegonzalez Remove team member section on homepage in favor of sponsor section
- #3376: @josegonzalez Switch from rawgit to jsdelivr
- #3365: @josegonzalez Remove extra tags:create call from docs
### Tests
- #3379: @josegonzalez Run mvdan/shfmt on test runs
- #3370: @josegonzalez Add junit support to shellcheck output
- #3308: @josegonzalez Add timing info to test runs on CircleCI
- #3367: @josegonzalez Run tests from built artifact
- #3368: @josegonzalez Balance circleci tests
- #3363: @josegonzalez Add a wrapper for invoking a single test
- #3362: @josegonzalez Allow tests to be run from any directory
- #3360: @josegonzalez Switch to bats-core
- #3361: @josegonzalez Do not generate dhparam for tests
### Other
- #3279: @fruitl00p Make sure the universe repo is loaded into APT
## 0.13.4
Install/update via the bootstrap script:

View File

@@ -1,8 +1,10 @@
DOKKU_VERSION ?= master
PROCFILE_VERSION ?= 0.6.0
PLUGN_VERSION ?= 0.3.2
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v0.4.0/procfile-util_0.4.0_linux_x86_64.tgz
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_linux_x86_64.tgz
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
@@ -30,6 +32,7 @@ include common.mk
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies sshcommand procfile-util plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build
include tests.mk
include package.mk
include deb.mk
include rpm.mk
include arch.mk
@@ -105,7 +108,7 @@ addman: help2man man-db
version:
ifeq ($(DOKKU_VERSION),master)
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
git describe --tags > ~dokku/VERSION 2>/dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
else
echo $(DOKKU_VERSION) > ~dokku/VERSION
endif

View File

@@ -98,8 +98,8 @@ A fresh VM running any of the following operating systems:
To install the latest stable release, run the following commands as a user who has access to `sudo`:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.4/bootstrap.sh
sudo DOKKU_TAG=v0.13.4 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.15.0/bootstrap.sh
sudo DOKKU_TAG=v0.15.0 bash bootstrap.sh
```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.

12
Vagrantfile vendored
View File

@@ -1,7 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV["BOX_NAME"] || "bento/ubuntu-14.04"
BOX_NAME = ENV["BOX_NAME"] || "bento/ubuntu-18.04"
BOX_CPUS = ENV["BOX_CPUS"] || "1"
BOX_MEMORY = ENV["BOX_MEMORY"] || "1024"
DOKKU_DOMAIN = ENV["DOKKU_DOMAIN"] || "dokku.me"
@@ -33,6 +33,10 @@ Vagrant::configure("2") do |config|
v.vmx["memsize"] = BOX_MEMORY
end
config.vm.provider :vmware_desktop do |v, override|
v.vmx["memsize"] = BOX_MEMORY
end
config.vm.define "empty", autostart: false
config.vm.define "dokku", primary: true do |vm|
@@ -49,7 +53,7 @@ Vagrant::configure("2") do |config|
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git >/dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
vm.vm.provision :shell do |s|
s.inline = <<-EOT
@@ -66,7 +70,7 @@ Vagrant::configure("2") do |config|
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
vm.vm.hostname = "#{DOKKU_DOMAIN}"
vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git dos2unix > /dev/null"
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git dos2unix >/dev/null"
vm.vm.provision :shell, :inline => "cd /vagrant/ && export DOKKU_BRANCH=`git symbolic-ref -q --short HEAD 2>/dev/null` && export DOKKU_TAG=`git describe --tags --exact-match 2>/dev/null` && cd /root/ && cp /vagrant/bootstrap.sh ./ && dos2unix bootstrap.sh && bash bootstrap.sh"
end
@@ -92,7 +96,7 @@ Vagrant::configure("2") do |config|
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
vm.vm.hostname = "#{DOKKU_DOMAIN}"
vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git >/dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "export IS_RELEASE=true && cd /root/dokku && make deb-all rpm-all"
end

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $TRACE ]] && set -x
set -eo pipefail
[[ $TRACE ]] && set -x
# A script to bootstrap dokku.
# It expects to be run on Ubuntu 14.04 via 'sudo'
@@ -15,7 +16,7 @@ ensure-environment() {
local FREE_MEMORY
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
hostname -f > /dev/null 2>&1 || {
hostname -f >/dev/null 2>&1 || {
echo "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
exit 1
}
@@ -31,8 +32,20 @@ install-requirements() {
echo "--> Ensuring we have the proper dependencies"
case "$DOKKU_DISTRO" in
debian|ubuntu)
apt-get update -qq > /dev/null
debian)
if ! dpkg -l | grep -q software-properties-common; then
apt-get update -qq >/dev/null
apt-get -qq -y install software-properties-common
fi
;;
ubuntu)
if ! dpkg -l | grep -q software-properties-common; then
apt-get update -qq >/dev/null
apt-get -qq -y install software-properties-common
fi
add-apt-repository universe >/dev/null
apt-get update -qq >/dev/null
;;
esac
}
@@ -41,7 +54,7 @@ install-dokku() {
if [[ -n $DOKKU_BRANCH ]]; then
install-dokku-from-source "origin/$DOKKU_BRANCH"
elif [[ -n $DOKKU_TAG ]]; then
local DOKKU_SEMVER="${DOKKU_TAG//v}"
local DOKKU_SEMVER="${DOKKU_TAG//v/}"
major=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[1]}')
minor=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[2]}')
patch=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[3]}')
@@ -95,10 +108,10 @@ install-dokku-from-source() {
install-dokku-from-package() {
case "$DOKKU_DISTRO" in
debian|ubuntu)
debian | ubuntu)
install-dokku-from-deb-package "$@"
;;
centos|rhel)
centos | rhel)
install-dokku-from-rpm-package "$@"
;;
*)
@@ -128,24 +141,27 @@ install-dokku-from-deb-package() {
fi
echo "--> Initial apt-get update"
apt-get update -qq > /dev/null
apt-get update -qq >/dev/null
apt-get -qq -y install apt-transport-https
echo "--> Installing docker"
if uname -r | grep -q linode; then
echo "--> NOTE: Using Linode? Docker may complain about missing AUFS support."
echo " You can safely ignore this warning."
echo " Installation will continue in 10 seconds."
sleep 10
if ! command -v docker &>/dev/null; then
echo "--> Installing docker"
if uname -r | grep -q linode; then
echo "--> NOTE: Using Linode? Docker may complain about missing AUFS support."
echo " You can safely ignore this warning."
echo " Installation will continue in 10 seconds."
sleep 10
fi
export CHANNEL=stable
wget -nv -O - https://get.docker.com/ | sh
fi
wget -nv -O - https://get.docker.com/ | sh
if [[ "$DOKKU_DISTRO_VERSION" == "14.04" ]]; then
echo "--> Adding nginx PPA"
add-apt-repository -y ppa:nginx/stable
fi
OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")"
OS_ID="$(lsb_release -cs 2>/dev/null || echo "trusty")"
if ! in-array "$DOKKU_DISTRO" "debian" "ubuntu"; then
DOKKU_DISTRO="ubuntu"
OS_ID="trusty"
@@ -164,16 +180,16 @@ install-dokku-from-deb-package() {
fi
echo "--> Installing dokku"
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/$DOKKU_DISTRO/ $OS_ID main" | tee /etc/apt/sources.list.d/dokku.list
apt-get update -qq > /dev/null
apt-get update -qq >/dev/null
[[ -n $DOKKU_VHOST_ENABLE ]] && echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | sudo debconf-set-selections
[[ -n $DOKKU_WEB_CONFIG ]] && echo "dokku dokku/web_config boolean $DOKKU_WEB_CONFIG" | sudo debconf-set-selections
[[ -n $DOKKU_HOSTNAME ]] && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | sudo debconf-set-selections
[[ -n $DOKKU_VHOST_ENABLE ]] && echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | sudo debconf-set-selections
[[ -n $DOKKU_WEB_CONFIG ]] && echo "dokku dokku/web_config boolean $DOKKU_WEB_CONFIG" | sudo debconf-set-selections
[[ -n $DOKKU_HOSTNAME ]] && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | sudo debconf-set-selections
[[ -n $DOKKU_SKIP_KEY_FILE ]] && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | sudo debconf-set-selections
[[ -n $DOKKU_KEY_FILE ]] && echo "dokku dokku/key_file string $DOKKU_KEY_FILE" | sudo debconf-set-selections
[[ -n $DOKKU_NGINX_ENABLE ]] && echo "dokku dokku/nginx_enable string $DOKKU_NGINX_ENABLE" | sudo debconf-set-selections
[[ -n $DOKKU_KEY_FILE ]] && echo "dokku dokku/key_file string $DOKKU_KEY_FILE" | sudo debconf-set-selections
[[ -n $DOKKU_NGINX_ENABLE ]] && echo "dokku dokku/nginx_enable string $DOKKU_NGINX_ENABLE" | sudo debconf-set-selections
if [[ -n $DOKKU_CHECKOUT ]]; then
# shellcheck disable=SC2086

View File

@@ -1,4 +1,4 @@
GO_REPO_ROOT := /go/src/github.com/dokku/dokku
BUILD_IMAGE := golang:1.9.1
BUILD_IMAGE := golang:1.12
.PHONY: build-in-docker build clean src-clean

View File

@@ -0,0 +1,6 @@
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc

View File

@@ -1,9 +1,9 @@
FROM ubuntu:14.04
FROM dokku/build-base:0.0.1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
ARG WORKDIR=/go/src/github.com/dokku/dokku
@@ -13,7 +13,4 @@ COPY . ${WORKDIR}
RUN make deb-dokku-update rpm-dokku-update
RUN mkdir -p /data \
&& cp /tmp/*.deb /data \
&& cp /tmp/*.rpm /data \
&& ls -lha /data/
RUN ls -lha /tmp/

View File

@@ -1,9 +1,9 @@
FROM ubuntu:14.04
FROM dokku/build-base:0.0.1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
ARG GOLANG_VERSION
@@ -36,10 +36,7 @@ RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \
SKIP_GO_CLEAN=true \
make version copyfiles \
&& rm -rf plugins/common/*.go plugins/common/glide* plugins/common/vendor/ \
&& make deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil deb-dokku-update \
rpm-herokuish rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil rpm-dokku-update
&& make deb-dokku deb-sshcommand deb-sigil \
rpm-dokku rpm-sshcommand rpm-sigil
RUN mkdir -p /data \
&& cp /tmp/*.deb /data \
&& cp /tmp/*.rpm /data \
&& ls -lha /data/
RUN ls -lha /tmp/

View File

@@ -1,9 +1,9 @@
FROM ubuntu:14.04
FROM dokku/build-base:0.0.1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
ARG WORKDIR=/go/src/github.com/dokku/dokku
@@ -13,7 +13,4 @@ COPY . ${WORKDIR}
RUN make deb-herokuish rpm-herokuish
RUN mkdir -p /data \
&& cp /tmp/*.deb /data \
&& cp /tmp/*.rpm /data \
&& ls -lha /data/
RUN ls -lha /tmp/

View File

@@ -5,7 +5,7 @@ import shutil
import subprocess
from requests.auth import HTTPBasicAuth
PACKAGECLOUD_API_TOKEN = os.getenv('DOKKU_PACKAGECLOUD_API_TOKEN')
PACKAGECLOUD_TOKEN = os.getenv('DOKKU_PACKAGECLOUD_TOKEN')
def download_file(filename, url):
@@ -25,7 +25,7 @@ def upload_file(filename):
def main():
auth = HTTPBasicAuth(PACKAGECLOUD_API_TOKEN, '')
auth = HTTPBasicAuth(PACKAGECLOUD_TOKEN, '')
base = requests.get('https://packagecloud.io/api/v1/repos/dokku/dokku/packages/deb/ubuntu/trusty.json',
auth=auth)
data = base.json()

View File

@@ -10,7 +10,7 @@ import subprocess
import sys
import threading
VERSION = 'v0.13.4'
VERSION = 'v0.15.0'
hostname = ''
try:
@@ -21,7 +21,13 @@ try:
except subprocess.CalledProcessError:
pass
key_file = os.getenv('KEY_FILE', '/root/.ssh/authorized_keys')
key_file = os.getenv('KEY_FILE', None)
if os.path.isfile('/home/ec2-user/.ssh/authorized_keys'):
key_file = '/home/ec2-user/.ssh/authorized_keys'
elif os.path.isfile('/home/ubuntu/.ssh/authorized_keys'):
key_file = '/home/ubuntu/.ssh/authorized_keys'
else:
key_file = '/root/.ssh/authorized_keys'
admin_keys = []
if os.path.isfile(key_file):
@@ -72,6 +78,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
content = PAGE.replace('{VERSION}', VERSION)
content = content.replace('{HOSTNAME}', hostname)
content = content.replace('{AUTHORIZED_KEYS_LOCATION}', key_file)
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
self.send_response(200)
self.end_headers()
@@ -211,70 +218,147 @@ def main():
PAGE = """
<html>
<head>
<meta charset="utf-8" />
<title>Dokku Setup</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>
.bd-callout {
padding: 1.25rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
border: 1px solid #eee;
border-left-width: .25rem;
border-radius: .25rem;
}
.bd-callout p:last-child {
margin-bottom: 0;
}
.bd-callout-info {
border-left-color: #5bc0de;
}
pre {
font-size: 80%;
margin-bottom: 0;
}
h1 small {
font-size: 50%;
}
h5 {
font-size: 1rem;
}
.container {
width: 640px;
}
.result {
padding-left: 20px;
}
input.form-control, textarea.form-control {
background-color: #fafbfc;
font-size: 14px;
}
input.form-control::placeholder, textarea.form-control::placeholder {
color: #adb2b8
}
</style>
</head>
<body>
<div class="container" style="width: 640px;">
<form id="form" role="form">
<h1>Dokku Setup <small>{VERSION}</small></h1>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Admin Access</small></h3>
<label for="key">Public Key</label><br />
<textarea class="form-control" name="keys" rows="7" id="key">{ADMIN_KEYS}</textarea>
</div>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Hostname Configuration</small></h3>
<div class="form-group">
<label for="hostname">Hostname</label>
<input class="form-control" type="text" id="hostname" name="hostname" value="{HOSTNAME}" />
<div class="container">
<form id="form" role="form">
<h1 class="pt-3">Dokku Setup <small class="text-muted">{VERSION}</small></h1>
<div class="alert alert-warning small" role="alert">
<strong>Warning:</strong> The SSH key filled out here can grant root access to the server. Please complete the setup as soon as possible.
</div>
<div class="checkbox">
<label><input id="vhost" name="vhost" type="checkbox" value="true"> Use <abbr title="Nginx will be run on port 80 and backend to your apps based on hostname">virtualhost naming</abbr> for apps</label>
<div class="row">
<div class="col">
<h3>Admin Access</h3>
<div class="form-group">
<label for="key">Public SSH Keys</label><br />
<textarea class="form-control" name="keys" rows="5" id="key" placeholder="Begins with 'ssh-rsa', 'ssh-dss', 'ssh-ed25519', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'">{ADMIN_KEYS}</textarea>
<small class="form-text text-muted">Public keys allow users to ssh onto the server as the <code>dokku</code> user, as well as remotely execute Dokku commands. They are currently auto-populated from: <code>{AUTHORIZED_KEYS_LOCATION}</code>, and can be changed later via the <a href="http://dokku.viewdocs.io/dokku/deployment/user-management/" target="_blank"><code>dokku ssh-keys</code></a> plugin.</small>
</div>
</div>
</div>
<p>Your app URLs will look like:</p>
<pre id="example">http://hostname:port</pre>
</div>
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span style="padding-left: 20px;" id="result"></span>
</form>
<div class="row">
<div class="col">
<h3>Hostname Configuration</h3>
<div class="form-group">
<label for="hostname">Hostname</label>
<input class="form-control" type="text" id="hostname" name="hostname" value="{HOSTNAME}" placeholder="A hostname or ip address such as {HOSTNAME}" />
<small class="form-text text-muted">This will be used as the default host for all applications, and can be changed later via the <a href="http://dokku.viewdocs.io/dokku/configuration/domains/" target="_blank"><code>dokku domains:set-global</code></a> command.</small>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="vhost" name="vhost" value="true">
<label class="form-check-label" for="vhost">Use virtualhost naming for apps</label>
<small class="form-text text-muted">When enabled, Nginx will be run on port 80 and proxy requests to apps based on hostname.</small>
<small class="form-text text-muted">When disabled, a specific port will be setup for each application on first deploy, and requests to that port will be proxied to the relevant app.</small>
</div>
<div class="bd-callout bd-callout-info">
<h5>What will app URLs look like?</h5>
<pre><code id="example">http://hostname:port</code></pre>
</div>
</div>
</div>
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span class="result"></span>
</form>
</div>
<div id="error-output"></div>
<script>
var $ = document.querySelector.bind(document)
function setup() {
if ($.trim($("#key").val()) == "") {
if ($("#key").value.trim() == "") {
alert("Your admin public key cannot be blank.")
return
}
if ($.trim($("#hostname").val()) == "") {
if ($("#hostname").value.trim() == "") {
alert("Your hostname cannot be blank.")
return
}
data = $("#form").serialize()
$("input,textarea,button").prop("disabled", true);
$.post('/setup', data)
.done(function() {
$("#result").html("Success!")
window.location.href = "http://dokku.viewdocs.io/dokku~{VERSION}/deployment/application-deployment/";
var data = new FormData($("#form"))
var inputs = [].slice.call(document.querySelectorAll("input, textarea, button"))
inputs.forEach(function (input) {
input.disabled = true
})
var result = $(".result")
fetch("/setup", {method: "POST", body: data})
.then(function(response) {
if (response.ok) {
return response.json()
} else {
throw new Error('Server returned error')
}
})
.then(function(response) {
result.classList.add("text-success");
result.textContent = "Success! Redirecting in 3 seconds. .."
setTimeout(function() {
window.location.href = "http://dokku.viewdocs.io/dokku~{VERSION}/deployment/application-deployment/";
}, 3000);
})
.catch(function (error) {
result.classList.add("text-danger");
result.textContent = "Could not send the request"
})
.fail(function(data) {
$("#result").html("Something went wrong...")
$("#error-output").html(data.responseText)
});
}
function update() {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
if ($("#vhost").matches(":checked") && $("#hostname").value.match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
alert("In order to use virtualhost naming, the hostname must not be an IP but a valid domain name.")
$("#vhost").prop('checked', false);
$("#vhost").checked = false;
}
if ($("#vhost").is(':checked')) {
$("#example").html("http://&lt;app-name&gt;."+$("#hostname").val())
if ($("#vhost").matches(':checked')) {
$("#example").textContent = "http://<app-name>."+$("#hostname").value
} else {
$("#example").html("http://"+$("#hostname").val()+":&lt;app-port&gt;")
$("#example").textContent = "http://"+$("#hostname").value+":<app-port>"
}
}
$("#vhost").change(update);
$("#hostname").change(update);
$("#vhost").addEventListener("change", update);
$("#hostname").addEventListener("input", update);
update();
</script>
</body>

View File

@@ -79,11 +79,11 @@ main() {
arch)
yaourt -Syyua
;;
debian|ubuntu)
apt-get update -qq > /dev/null
debian | ubuntu)
apt-get update -qq >/dev/null
apt-get -qq -y --force-yes dist-upgrade
;;
centos|opensuse|rhel)
centos | opensuse | rhel)
dokku-log-warn "Updating this operating system is not supported"
;;
*)
@@ -94,7 +94,7 @@ main() {
# update all plugins
dokku-log-info "Updating all plugins"
for PLUGIN_NAME in $(dokku plugin:list | grep enabled | awk '$1=$1' | cut -d' ' -f1); do
for PLUGIN_NAME in $(dokku plugin:list | grep enabled | awk '$1=$1' | cut -d' ' -f1); do
dokku-update-plugin "$PLUGIN_NAME"
done
dokku plugin:install

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
export DOKKU_PORT=${DOKKU_PORT:=22}
export DOKKU_HOST=${DOKKU_HOST:=}
@@ -48,7 +49,7 @@ fn-dokku-host() {
declare DOKKU_GIT_REMOTE="$1" DOKKU_HOST="$2"
if [[ -z "$DOKKU_HOST" ]]; then
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
if [[ -d .git ]] || git rev-parse --git-dir >/dev/null 2>&1; then
DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^${DOKKU_GIT_REMOTE}\s" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null || true)
fi
fi
@@ -67,7 +68,7 @@ main() {
for arg in "$@"; do
if [[ "$skip" == "true" ]]; then
next_index=$(( next_index + 1 ))
next_index=$((next_index + 1))
skip=false
continue
fi
@@ -92,13 +93,13 @@ main() {
cmd_set=true
fi
fi
next_index=$(( next_index + 1 ))
next_index=$((next_index + 1))
done
DOKKU_REMOTE_HOST="$(fn-dokku-host "$DOKKU_GIT_REMOTE" "$DOKKU_HOST")"
if [[ -z "$APP" ]]; then
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
if [[ -d .git ]] || git rev-parse --git-dir >/dev/null 2>&1; then
set +e
APP=$(git remote -v 2>/dev/null | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
set -e
@@ -112,14 +113,14 @@ main() {
if [[ -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
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps 2>/dev/null | grep -q "$APP"; do
if [[ $counter -ge 100 ]]; then
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps
exit 1
else
APP=$(random_name)
counter=$((counter+1))
counter=$((counter + 1))
fi
done
else

View File

@@ -19,7 +19,7 @@
"sleep 30",
"echo '--> Updating apt repositories'",
"sudo apt-get update -qq > /dev/null",
"sudo apt-get update -qq >/dev/null",
"echo '--> Installing make requirement'",
"sudo apt-get -qq -y install build-essential",

View File

@@ -6,7 +6,7 @@ readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXX")"
readonly DOKKU_GIT_REV="$(git rev-parse HEAD)"
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN INT TERM EXIT
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT
log-info() {
# shellcheck disable=SC2034
@@ -24,7 +24,7 @@ log-fail() {
# shellcheck disable=SC2034
declare desc="Log fail formatter"
log-error "$*"
exit -1
exit 1
}
fn-build-dokku() {
@@ -49,7 +49,7 @@ fn-build-dokku() {
--build-arg IS_RELEASE="$IS_RELEASE" \
--build-arg PLUGIN_MAKE_TARGET="build" \
--build-arg GOLANG_VERSION="$GOLANG_VERSION" \
-f "contrib/build.Dockerfile" \
-f "contrib/build-dokku.Dockerfile" \
-t "$NAME" .
return "$?"
}
@@ -68,7 +68,7 @@ fn-extract-package() {
[[ "$IS_RELEASE" == "true" ]] && NAME="dokku:build-release"
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path"
docker run --rm --entrypoint cat "$NAME" "/data/${PACKAGE_NAME}" > "${ROOT_DIR}/${PACKAGE_NAME}"
docker run --rm --entrypoint cat "$NAME" "/tmp/${PACKAGE_NAME}" >"${ROOT_DIR}/build/${PACKAGE_NAME}"
return "$?"
}
@@ -219,7 +219,7 @@ fn-repo-update() {
if [[ "$RELEASE" == 'patch' ]]; then
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/assets/versions.json
else
versions=$(python -c 'import json,sys;d=json.load(sys.stdin);d["max-versions"].append("'"${NEXT_VERSION}"'"); print json.dumps(d, indent=2, sort_keys=True)' <docs/assets/versions.json)
versions=$(python -c 'import json,sys;d=json.load(sys.stdin);d["max-versions"].append("'"${NEXT_VERSION}"'"); print(json.dumps(d, indent=2, sort_keys=True))' <docs/assets/versions.json)
echo "$versions" >docs/assets/versions.json
git add docs/assets/versions.json
fi
@@ -237,7 +237,7 @@ fn-repo-update-history-and-commit() {
declare desc="Updates the history file and commits the changes"
declare CURRENT_VERSION="$1" NEXT_VERSION="$2"
local PULL_REQUEST_ID TITLE AUTHOR TYPE CHANGELOG_TEXT
local COMMIT_MESSAGE HISTORY HISTORY_CONTENTS HISTORY_DOCUMENTATION HISTORY_ENHANCEMENT HISTORY_BUG HISTORY_OTHER ISSUE_FILE
local COMMIT_MESSAGE HISTORY HISTORY_CONTENTS HISTORY_DOCUMENTATION HISTORY_ENHANCEMENT HISTORY_BUG HISTORY_OTHER HISTORY_TESTS ISSUE_FILE
pushd "$ROOT_DIR" >/dev/null
@@ -260,6 +260,8 @@ fn-repo-update-history-and-commit() {
HISTORY_DOCUMENTATION="${HISTORY_DOCUMENTATION}"$'\n'"$CHANGELOG_TEXT"
elif [[ "$TYPE" == "enhancement" ]] || [[ "$TYPE" == "refactor" ]]; then
HISTORY_ENHANCEMENT="${HISTORY_ENHANCEMENT}"$'\n'"$CHANGELOG_TEXT"
elif [[ "$TYPE" == "tests" ]]; then
HISTORY_TESTS="${HISTORY_TESTS}"$'\n'"$CHANGELOG_TEXT"
else
HISTORY_OTHER="${HISTORY_OTHER}"$'\n'"$CHANGELOG_TEXT"
fi
@@ -288,6 +290,11 @@ fn-repo-update-history-and-commit() {
HISTORY="${HISTORY}"$'\n'"$HISTORY_DOCUMENTATION"
fi
if [[ "$HISTORY_TESTS" ]]; then
HISTORY="${HISTORY}"$'\n\n'"### Tests"
HISTORY="${HISTORY}"$'\n'"$HISTORY_TESTS"
fi
if [[ "$HISTORY_OTHER" ]]; then
HISTORY="${HISTORY}"$'\n\n'"### Other"
HISTORY="${HISTORY}"$'\n'"$HISTORY_OTHER"
@@ -313,7 +320,7 @@ fn-require-bin() {
main() {
declare RELEASE="$1"
local CURRENT_VERSION NEXT_VERSION IS_RELEASE
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish")
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish" "build")
if [[ "$RELEASE" == '--trace' ]]; then
shift 1
@@ -322,39 +329,45 @@ main() {
fi
if [[ -z "$RELEASE" ]]; then
log-fail "Argument 1 must be one of [major, minor, patch, betafish], none given"
log-fail "Argument 1 must be one of [major, minor, patch, betafish, build], none given"
fi
if ! fn-in-array "$RELEASE" "${VALID_RELEASE_LEVELS[@]}"; then
log-fail "Argument 1 must be one of [major, minor, patch, betafish], '${RELEASE}' given"
log-fail "Argument 1 must be one of [major, minor, patch, betafish, build], '${RELEASE}' given"
fi
log-info "Creating $RELEASE release"
mkdir -p "build"
fn-require-bin "docker"
fn-require-bin "git"
fn-require-bin "package_cloud"
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable"
if [[ "$RELEASE" != "build" ]]; then
fn-require-bin "package_cloud"
[[ -n "$PACKAGECLOUD_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_TOKEN environment variable"
fi
CURRENT_VERSION="$(fn-version-current)"
NEXT_VERSION="$(fn-version-next "$CURRENT_VERSION" "$RELEASE")"
IS_RELEASE="$(fn-is-release "$RELEASE")"
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION" || log-fail "Error building package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error extracting deb package"
fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
fn-publish-package "$IS_RELEASE" "deb" "dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
if [[ "$RELEASE" != "build" ]]; then
fn-publish-package "$IS_RELEASE" "deb" "build/dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fn-repo-push-tags "$IS_RELEASE"
fi
fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fn-repo-push-tags "$IS_RELEASE"
if [[ "$IS_RELEASE" != "true" ]]; then
git reset -q HEAD plugins/*/plugin.toml
git checkout -- plugins/*/plugin.toml
fi
echo "build/dokku_${NEXT_VERSION}_amd64.deb" >build/deb-filename
echo "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" >build/rpm-filename
}
main "$@"

View File

@@ -6,7 +6,7 @@ readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXX")"
readonly DOKKU_GIT_REV="$(git rev-parse HEAD)"
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN INT TERM EXIT
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT
log-info() {
# shellcheck disable=SC2034
@@ -24,7 +24,7 @@ log-fail() {
# shellcheck disable=SC2034
declare desc="Log fail formatter"
log-error "$*"
exit -1
exit 1
}
fn-build-dokku() {
@@ -32,7 +32,7 @@ fn-build-dokku() {
pushd "$ROOT_DIR" >/dev/null
docker build \
-f "contrib/update-build.Dockerfile" \
-f "contrib/build-dokku-update.Dockerfile" \
-t dokku-update:build .
return "$?"
}
@@ -47,7 +47,7 @@ fn-extract-package() {
fi
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path"
docker run --rm --entrypoint cat dokku-update:build "/data/${PACKAGE_NAME}" > "${ROOT_DIR}/${PACKAGE_NAME}"
docker run --rm --entrypoint cat dokku-update:build "/tmp/${PACKAGE_NAME}" >"${ROOT_DIR}/build/${PACKAGE_NAME}"
return "$?"
}
@@ -70,7 +70,7 @@ fn-publish-package() {
EXIT_CODE="$ex"
fi
done
DIST=debian
OS_IDS=("wheezy" "jessie" "stretch" "buster")
for OS_ID in "${OS_IDS[@]}"; do
@@ -121,7 +121,7 @@ fn-require-bin() {
main() {
declare RELEASE="$1"
local NEXT_VERSION
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish")
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish" "build")
if [[ "$RELEASE" == '--trace' ]]; then
shift 1
@@ -130,29 +130,31 @@ main() {
fi
if [[ -z "$RELEASE" ]]; then
log-fail "Argument 1 must be one of [major, minor, patch, betafish], none given"
log-fail "Argument 1 must be one of [major, minor, patch, betafish, build], none given"
fi
if ! fn-in-array "$RELEASE" "${VALID_RELEASE_LEVELS[@]}"; then
log-fail "Argument 1 must be one of [major, minor, patch, betafish], '${RELEASE}' given"
log-fail "Argument 1 must be one of [major, minor, patch, betafish, build], '${RELEASE}' given"
fi
mkdir -p "build"
fn-require-bin "docker"
fn-require-bin "package_cloud"
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable"
if [[ "$RELEASE" != "build" ]]; then
fn-require-bin "package_cloud"
[[ -n "$PACKAGECLOUD_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_TOKEN environment variable"
fi
NEXT_VERSION="$(grep DOKKU_UPDATE_VERSION deb.mk | head -n1 | cut -d'=' -f2 | xargs)"
IS_RELEASE="$(fn-is-release "$RELEASE")"
fn-build-dokku || log-fail "Error building package"
fn-extract-package "dokku-update_${NEXT_VERSION}_amd64.deb" || log-fail "Error extracting deb package"
fn-extract-package "dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
fn-publish-package "$IS_RELEASE" "deb" "dokku-update_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
if [[ "$RELEASE" != "build" ]]; then
fn-publish-package "$IS_RELEASE" "deb" "build/dokku-update_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "build/dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fi
}
main "$@"

View File

@@ -6,7 +6,7 @@ readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-release.XXXX")"
readonly DOKKU_GIT_REV="$(git rev-parse HEAD)"
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN INT TERM EXIT
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT
log-info() {
# shellcheck disable=SC2034
@@ -24,7 +24,7 @@ log-fail() {
# shellcheck disable=SC2034
declare desc="Log fail formatter"
log-error "$*"
exit -1
exit 1
}
fn-build-dokku() {
@@ -32,7 +32,7 @@ fn-build-dokku() {
pushd "$ROOT_DIR" >/dev/null
docker build \
-f "contrib/herokuish-build.Dockerfile" \
-f "contrib/build-herokuish.Dockerfile" \
-t herokuish:build .
return "$?"
}
@@ -47,7 +47,7 @@ fn-extract-package() {
fi
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path"
docker run --rm --entrypoint cat herokuish:build "/data/${PACKAGE_NAME}" > "${ROOT_DIR}/${PACKAGE_NAME}"
docker run --rm --entrypoint cat herokuish:build "/tmp/${PACKAGE_NAME}" >"${ROOT_DIR}/build/${PACKAGE_NAME}"
return "$?"
}
@@ -70,7 +70,7 @@ fn-publish-package() {
EXIT_CODE="$ex"
fi
done
DIST=debian
OS_IDS=("wheezy" "jessie" "stretch" "buster")
for OS_ID in "${OS_IDS[@]}"; do
@@ -121,7 +121,7 @@ fn-require-bin() {
main() {
declare RELEASE="$1"
local NEXT_VERSION
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish")
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish" "build")
if [[ "$RELEASE" == '--trace' ]]; then
shift 1
@@ -130,27 +130,31 @@ main() {
fi
if [[ -z "$RELEASE" ]]; then
log-fail "Argument 1 must be one of [major, minor, patch, betafish], none given"
log-fail "Argument 1 must be one of [major, minor, patch, betafish, build], none given"
fi
if ! fn-in-array "$RELEASE" "${VALID_RELEASE_LEVELS[@]}"; then
log-fail "Argument 1 must be one of [major, minor, patch, betafish], '${RELEASE}' given"
log-fail "Argument 1 must be one of [major, minor, patch, betafish, build], '${RELEASE}' given"
fi
mkdir -p "build"
fn-require-bin "docker"
fn-require-bin "package_cloud"
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable"
if [[ "$RELEASE" != "build" ]]; then
fn-require-bin "package_cloud"
[[ -n "$PACKAGECLOUD_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_TOKEN environment variable"
fi
NEXT_VERSION="$(grep HEROKUISH_VERSION deb.mk | head -n1 | cut -d'=' -f2 | xargs)"
IS_RELEASE="$(fn-is-release "$RELEASE")"
fn-build-dokku || log-fail "Error building package"
fn-extract-package "herokuish_${NEXT_VERSION}_amd64.deb" || log-fail "Error extracting deb package"
fn-extract-package "herokuish-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
fn-publish-package "$IS_RELEASE" "deb" "herokuish_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "herokuish-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
if [[ "$RELEASE" != "build" ]]; then
fn-publish-package "$IS_RELEASE" "deb" "build/herokuish_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "build/herokuish-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fi
}
main "$@"

View File

@@ -4,7 +4,7 @@ set -eo pipefail
readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-plugin-release.XXXX")"
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN INT TERM EXIT
trap 'rm -rf "$TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT
log-info() {
# shellcheck disable=SC2034
@@ -22,7 +22,7 @@ log-fail() {
# shellcheck disable=SC2034
declare desc="Log fail formatter"
log-error "$*"
exit -1
exit 1
}
fn-github-download-release() {
@@ -53,11 +53,11 @@ fn-require-bin() {
}
main() {
local RELEASE="$1"
local RELEASE="$1" AWS_RELEASE="$2"
local CURRENT_VERSION FILENAME NEXT_VERSION ORG_REPO_NAME REPO_NAME major minor patch
if [[ -z "$RELEASE" ]]; then
cat<<'EOF'
cat <<'EOF'
requirements:
- this is run in a plugin folder
@@ -91,20 +91,24 @@ EOF
fn-require-bin "git"
if [[ "$AWS_RELEASE" != "true" ]] && [[ "$AWS_RELEASE" != "false" ]]; then
local AWS_RELEASE=true
fi
if [[ "$CI" != "true" ]] && [[ -z "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
log-info "You are running this without a DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN environment variable."
log-info "Doing so disables uploading releases to S3, which may be necessary for installing private plugins."
while true; do
read -rp "Do you wish to continue? " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
[Yy]*) break ;;
[Nn]*) exit ;;
*) echo "Please answer yes or no." ;;
esac
done
fi
if [[ -n "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
if [[ "$AWS_RELEASE" == "true" ]]; then
fn-require-bin "aws"
fn-require-bin "curl"
if [[ -z "$DOKKU_PLUGIN_S3_BUCKET" ]]; then
@@ -131,19 +135,19 @@ EOF
patch=$(echo "$CURRENT_VERSION" | awk '{split($0,a,"."); print a[3]}')
if [[ "$RELEASE" == "major" ]]; then
major=$((major + 1));
major=$((major + 1))
minor="0"
patch="0"
elif [[ "$RELEASE" == "minor" ]]; then
minor=$((minor + 1));
minor=$((minor + 1))
patch="0"
elif [[ "$RELEASE" == "patch" ]]; then
patch=$((patch + 1));
patch=$((patch + 1))
else
log-error "Invalid release type specified"
return 1
fi
NEXT_VERSION="${major}.${minor}.${patch}"
NEXT_VERSION="${major}.${minor}.${patch}"
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" plugin.toml
git add plugin.toml
@@ -156,14 +160,14 @@ EOF
REPO_NAME="$(echo "$ORG_REPO_NAME" | cut -d'/' -f2)"
FILENAME="${REPO_NAME}-${NEXT_VERSION}.tar.gz"
if [[ -n "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
if [[ "$AWS_RELEASE" == "true" ]]; then
DOKKU_PLUGIN_S3_BUCKET="${DOKKU_PLUGIN_S3_BUCKET%/}"
DOKKU_PLUGIN_S3_PATH="${DOKKU_PLUGIN_S3_PATH%/}"
if [[ "$DOKKU_PLUGIN_S3_PATH" != "/" ]]; then
DOKKU_PLUGIN_S3_PATH="${DOKKU_PLUGIN_S3_PATH}/"
fi
fn-github-download-release "$ORG_REPO_NAME" "$NEXT_VERSION" > "${TMP_WORK_DIR}/${FILENAME}"
fn-github-download-release "$ORG_REPO_NAME" "$NEXT_VERSION" >"${TMP_WORK_DIR}/${FILENAME}"
aws s3 cp "${TMP_WORK_DIR}/${FILENAME}" "s3://${DOKKU_PLUGIN_S3_BUCKET}/${DOKKU_PLUGIN_S3_PATH}${FILENAME}" --acl public-read
fi
}

138
deb.mk
View File

@@ -1,6 +1,8 @@
BUILD_DIRECTORY ?= /tmp
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
HEROKUISH_VERSION ?= 0.4.5
HEROKUISH_VERSION ?= 0.4.9
HEROKUISH_ARCHITECTURE = amd64
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
@@ -14,18 +16,6 @@ DOKKU_UPDATE_VERSION ?= 0.1.0
DOKKU_UPDATE_ARCHITECTURE = amd64
DOKKU_UPDATE_PACKAGE_NAME = dokku-update_$(DOKKU_UPDATE_VERSION)_$(DOKKU_UPDATE_ARCHITECTURE).deb
define PLUGN_DESCRIPTION
Hook system that lets users extend your application with plugins
Plugin triggers are simply scripts that are executed by the system.
You can use any language you want, so long as the script is
executable and has the proper language requirements installed
endef
PLUGN_REPO_NAME ?= dokku/plugn
PLUGN_VERSION ?= 0.3.0
PLUGN_ARCHITECTURE = amd64
PLUGN_PACKAGE_NAME = plugn_$(PLUGN_VERSION)_$(PLUGN_ARCHITECTURE).deb
PLUGN_URL = https://github.com/dokku/plugn/releases/download/v$(PLUGN_VERSION)/plugn_$(PLUGN_VERSION)_linux_x86_64.tgz
define SSHCOMMAND_DESCRIPTION
Turn SSH into a thin client specifically for your app
Simplifies running a single command over SSH, and
@@ -54,35 +44,34 @@ ifndef IS_RELEASE
IS_RELEASE = true
endif
export PLUGN_DESCRIPTION
export SIGIL_DESCRIPTION
export SSHCOMMAND_DESCRIPTION
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-dokku-update deb-plugn deb-setup deb-sshcommand deb-sigil
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-dokku-update deb-setup deb-sshcommand deb-sigil
install-from-deb:
@echo "--> Initial apt-get update"
sudo apt-get update -qq > /dev/null
sudo apt-get update -qq >/dev/null
sudo apt-get install -qq -y apt-transport-https
@echo "--> Installing docker"
wget -nv -O - https://get.docker.com/ | sh
@echo "--> Installing dokku"
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
@echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ $(shell lsb_release -cs 2> /dev/null || echo "trusty") main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq > /dev/null
wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -
@echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ $(shell lsb_release -cs 2>/dev/null || echo "trusty") main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq >/dev/null
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku
deb-all: deb-setup deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil deb-dokku-update
mv /tmp/*.deb .
deb-all: deb-setup deb-herokuish deb-dokku deb-sshcommand deb-sigil deb-dokku-update
mv $(BUILD_DIRECTORY)/*.deb .
@echo "Done"
deb-setup:
@echo "-> Updating deb repository and installing build requirements"
@sudo apt-get update -qq > /dev/null
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 lintian > /dev/null 2>&1
@command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
@sudo apt-get update -qq >/dev/null
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 lintian >/dev/null 2>&1
@command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
@ssh -o StrictHostKeyChecking=no git@github.com || true
deb-herokuish:
@@ -93,16 +82,16 @@ deb-herokuish:
@echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install
@echo "sleep 5" >> /tmp/tmp/post-install
@echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ ! -z $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ -n $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ -n $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo 'if [[ -n $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install
@echo "sudo docker pull gliderlabs/herokuish:v${HEROKUISH_VERSION} && sudo docker tag gliderlabs/herokuish:v${HEROKUISH_VERSION} gliderlabs/herokuish:latest" >> /tmp/tmp/post-install
@echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n herokuish \
-v $(HEROKUISH_VERSION) \
-a $(HEROKUISH_ARCHITECTURE) \
-p $(HEROKUISH_PACKAGE_NAME) \
--version $(HEROKUISH_VERSION) \
--architecture $(HEROKUISH_ARCHITECTURE) \
--package $(BUILD_DIRECTORY)/$(HEROKUISH_PACKAGE_NAME) \
--deb-pre-depends 'docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1) | docker-ce | docker-ee' \
--deb-pre-depends sudo \
--after-install /tmp/tmp/post-install \
@@ -110,55 +99,21 @@ deb-herokuish:
--description $(HEROKUISH_DESCRIPTION) \
--license 'MIT License' \
.
mv *.deb /tmp
deb-dokku:
rm -rf /tmp/tmp /tmp/build dokku_*_$(DOKKU_ARCHITECTURE).deb
mkdir -p /tmp/tmp /tmp/build
deb-dokku: /tmp/build-dokku/var/lib/dokku/GIT_REV
rm -f $(BUILD_DIRECTORY)/dokku_*_$(DOKKU_ARCHITECTURE).deb
cp -r debian /tmp/build/DEBIAN
mkdir -p /tmp/build/usr/share/bash-completion/completions
mkdir -p /tmp/build/usr/bin
mkdir -p /tmp/build/usr/share/doc/dokku
mkdir -p /tmp/build/usr/share/dokku/contrib
mkdir -p /tmp/build/usr/share/lintian/overrides
mkdir -p /tmp/build/usr/share/man/man1
mkdir -p /tmp/build/var/lib/dokku/core-plugins/available
cp dokku /tmp/build/usr/bin
cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
cp contrib/bash-completion /tmp/build/usr/share/bash-completion/completions/dokku
find . -name ".DS_Store" -depth -exec rm {} \;
$(MAKE) go-build
cp common.mk /tmp/build/var/lib/dokku/core-plugins/common.mk
cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do cd /tmp/build/var/lib/dokku/core-plugins/available/$$plugin && if [ -e Makefile ]; then $(MAKE) src-clean; fi; done
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done
rm /tmp/build/var/lib/dokku/core-plugins/common.mk
$(MAKE) help2man
$(MAKE) addman
cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1
gzip -9 /tmp/build/usr/share/man/man1/dokku.1
cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
ifeq ($(DOKKU_VERSION),master)
git describe --tags > /tmp/build/var/lib/dokku/VERSION
else
echo $(DOKKU_VERSION) > /tmp/build/var/lib/dokku/VERSION
endif
cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
cat /tmp/build-dokku/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build-dokku/var/lib/dokku/STABLE_VERSION
ifneq (,$(findstring false,$(IS_RELEASE)))
sed -i.bak -e "s/^/`date +%s`:/" /tmp/build/var/lib/dokku/STABLE_VERSION && rm /tmp/build/var/lib/dokku/STABLE_VERSION.bak
sed -i.bak -e "s/^/`date +%s`:/" /tmp/build-dokku/var/lib/dokku/STABLE_VERSION && rm /tmp/build-dokku/var/lib/dokku/STABLE_VERSION.bak
endif
rm -f /tmp/build/DEBIAN/lintian-overrides
cp debian/lintian-overrides /tmp/build/usr/share/lintian/overrides/dokku
ifdef DOKKU_GIT_REV
echo "$(DOKKU_GIT_REV)" > /tmp/build/var/lib/dokku/GIT_REV
else
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
endif
sed -i.bak "s/^Version: .*/Version: `cat /tmp/build/var/lib/dokku/STABLE_VERSION`/g" /tmp/build/DEBIAN/control && rm /tmp/build/DEBIAN/control.bak
dpkg-deb --build /tmp/build "/tmp/dokku_`cat /tmp/build/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb"
lintian "/tmp/dokku_`cat /tmp/build/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb"
cp -r debian /tmp/build-dokku/DEBIAN
rm -f /tmp/build-dokku/DEBIAN/lintian-overrides
cp debian/lintian-overrides /tmp/build-dokku/usr/share/lintian/overrides/dokku
sed -i.bak "s/^Version: .*/Version: `cat /tmp/build-dokku/var/lib/dokku/STABLE_VERSION`/g" /tmp/build-dokku/DEBIAN/control && rm /tmp/build-dokku/DEBIAN/control.bak
dpkg-deb --build /tmp/build-dokku "$(BUILD_DIRECTORY)/dokku_`cat /tmp/build-dokku/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb"
lintian "$(BUILD_DIRECTORY)/dokku_`cat /tmp/build-dokku/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb"
deb-dokku-update:
rm -rf /tmp/dokku-update*.deb dokku-update*.deb
@@ -166,38 +121,13 @@ deb-dokku-update:
sudo fpm -t deb -s dir -n dokku-update \
--version $(DOKKU_UPDATE_VERSION) \
--architecture $(DOKKU_UPDATE_ARCHITECTURE) \
--package $(DOKKU_UPDATE_PACKAGE_NAME) \
--package $(BUILD_DIRECTORY)/$(DOKKU_UPDATE_PACKAGE_NAME) \
--depends 'dokku' \
--url "https://github.com/$(DOKKU_UPDATE_REPO_NAME)" \
--description $(DOKKU_UPDATE_DESCRIPTION) \
--license 'MIT License' \
contrib/dokku-update=/usr/local/bin/dokku-update \
contrib/dokku-update-version=/var/lib/dokku-update/VERSION
mv *.deb /tmp
deb-plugn:
rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
@echo "-> Downloading package"
wget -q -O /tmp/tmp/plugn-$(PLUGN_VERSION).tgz $(PLUGN_URL)
cd /tmp/tmp/ && tar zxf /tmp/tmp/plugn-$(PLUGN_VERSION).tgz
@echo "-> Copying files into place"
cp /tmp/tmp/plugn /tmp/build/usr/bin/plugn && chmod +x /tmp/build/usr/bin/plugn
@echo "-> Creating $(PLUGN_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n plugn \
--version $(PLUGN_VERSION) \
--architecture $(PLUGN_ARCHITECTURE) \
--package $(PLUGN_PACKAGE_NAME) \
--url "https://github.com/$(PLUGN_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category utils \
--description "$$PLUGN_DESCRIPTION" \
--license 'MIT License' \
.
mv *.deb /tmp
deb-sshcommand:
rm -rf /tmp/tmp /tmp/build $(SSHCOMMAND_PACKAGE_NAME)
@@ -215,14 +145,13 @@ deb-sshcommand:
sudo fpm -t deb -s dir -C /tmp/build -n sshcommand \
--version $(SSHCOMMAND_VERSION) \
--architecture $(SSHCOMMAND_ARCHITECTURE) \
--package $(SSHCOMMAND_PACKAGE_NAME) \
--package $(BUILD_DIRECTORY)/$(SSHCOMMAND_PACKAGE_NAME) \
--url "https://github.com/$(SSHCOMMAND_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category admin \
--description "$$SSHCOMMAND_DESCRIPTION" \
--license 'MIT License' \
.
mv *.deb /tmp
deb-sigil:
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
@@ -239,11 +168,10 @@ deb-sigil:
sudo fpm -t deb -s dir -C /tmp/build -n gliderlabs-sigil \
--version $(SIGIL_VERSION) \
--architecture $(SIGIL_ARCHITECTURE) \
--package $(SIGIL_PACKAGE_NAME) \
--package $(BUILD_DIRECTORY)/$(SIGIL_PACKAGE_NAME) \
--url "https://github.com/$(SIGIL_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category utils \
--description "$$SIGIL_DESCRIPTION" \
--license 'MIT License' \
.
mv *.deb /tmp

5
debian/config vendored
View File

@@ -1,5 +1,6 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
set -eo pipefail
[[ $TRACE ]] && set -x
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
@@ -14,7 +15,7 @@ db_go || true
db_get "dokku/web_config"
if [ $RET = "true" ]; then
exit 0
exit 0
fi
db_input "high" "dokku/nginx_enable" || true

2
debian/control vendored
View File

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

29
debian/postinst vendored
View File

@@ -1,5 +1,6 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
set -eo pipefail
[[ $TRACE ]] && set -x
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
@@ -26,10 +27,10 @@ call-sshcommand() {
}
case "$1" in
abort-upgrade|abort-remove|abort-deconfigure)
;;
abort-upgrade | abort-remove | abort-deconfigure) ;;
configure)
\
configure)
mandb
[ ! -x /usr/bin/docker.io ] || ln -sf /usr/bin/docker.io /usr/local/bin/docker
modprobe aufs || echo "WARNING: Restart server to finish installing dokku!"
@@ -55,7 +56,7 @@ case "$1" in
elif [ -f ${DOKKU_LIB_ROOT}/plugins/$plugin/.core ]; then
rm -rf ${DOKKU_LIB_ROOT}/plugins/$plugin
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available;
mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available
fi
done
@@ -66,7 +67,7 @@ case "$1" in
echo "Skipping enable of nginx-vhosts plugin"
continue
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
fi
@@ -75,7 +76,7 @@ case "$1" in
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
echo "Ensure proper sshcommand path"
echo '/usr/bin/dokku' > "${DOKKU_ROOT}/.sshcommand"
echo '/usr/bin/dokku' >"${DOKKU_ROOT}/.sshcommand"
if [[ -f .ssh/authorized_keys ]]; then
sed -i.bak 's#/usr/local/bin/dokku#/usr/bin/dokku#' "${DOKKU_ROOT}/.ssh/authorized_keys"
rm "${DOKKU_ROOT}/.ssh/authorized_keys"
@@ -96,8 +97,8 @@ case "$1" in
systemctl enable dokku-installer
fi
installer_status="$(service dokku-installer status 2> /dev/null || true)"
if echo $installer_status | grep -Eq "(inactive|waiting)" > /dev/null; then
installer_status="$(service dokku-installer status 2>/dev/null || true)"
if echo $installer_status | grep -Eq "(inactive|waiting)" >/dev/null; then
echo "Starting dokku-installer"
service dokku-installer start || echo "Unable to start dokku-installer"
fi
@@ -114,19 +115,19 @@ case "$1" in
else
db_get "dokku/vhost_enable"
if [ "$RET" = "true" ]; then
db_get "dokku/hostname"
echo "Setting VHOST contents to $RET"
echo "$RET" > "${DOKKU_ROOT}/VHOST"
db_get "dokku/hostname"
echo "Setting VHOST contents to $RET"
echo "$RET" >"${DOKKU_ROOT}/VHOST"
fi
fi
db_get "dokku/hostname"
echo "$RET" > "${DOKKU_ROOT}/HOSTNAME"
echo "$RET" >"${DOKKU_ROOT}/HOSTNAME"
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/key_file"
if [ -f "$RET" ]; then
call-sshcommand acl-add dokku default < "$RET" || true
call-sshcommand acl-add dokku default <"$RET" || true
fi
fi
;;

3
debian/postrm vendored
View File

@@ -1,5 +1,6 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
set -eo pipefail
[[ $TRACE ]] && set -x
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091

28
debian/preinst vendored
View File

@@ -1,5 +1,6 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
set -eo pipefail
[[ $TRACE ]] && set -x
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
@@ -23,10 +24,13 @@ case "$1" in
echo ' proxy_pass http://dokku-installer;'
echo ' }'
echo '}'
} >> $NGINX_CONF
} >>$NGINX_CONF
rm -f /etc/nginx/sites-enabled/*
DOKKU_DISTRO="$(. /etc/os-release > /dev/null 2>&1 || true ; echo "$ID")"
DOKKU_DISTRO="$(
. /etc/os-release >/dev/null 2>&1 || true
echo "$ID"
)"
case "$DOKKU_DISTRO" in
debian)
NGINX_INIT="/usr/sbin/invoke-rc.d"
@@ -44,21 +48,21 @@ case "$1" in
if [ -z "${DEBCONF_RECONFIGURE}" ] && [ "$RET" != "true" ]; then
db_get "dokku/key_file"
if [ ! -f "$RET" ]; then
echo "Error: keyfile '$RET' not found."
echo " you can enter a new keyfile path when you restart the installation."
db_reset "dokku/key_file"
exit 1
echo "Error: keyfile '$RET' not found."
echo " you can enter a new keyfile path when you restart the installation."
db_reset "dokku/key_file"
exit 1
fi
fi
;;
upgrade)
;;
upgrade) ;;
abort-upgrade)
;;
\
abort-upgrade) ;;
*)
\
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;

33
debian/prerm vendored
View File

@@ -1,34 +1,35 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
set -eo pipefail
[[ $TRACE ]] && set -x
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
ps_backtrace() {
if [ $# -lt 1 ]; then
echo "Usage: $0 PID" > /dev/stderr
echo "Usage: $0 PID" >/dev/stderr
exit 1
fi
declare -i pid=$1;
ppid=0;
header_modifier="";
while : ; do
declare -i pid=$1
ppid=0
header_modifier=""
while :; do
if [ $ppid -ne 0 ]; then
header_modifier=h;
fi;
ppid=$(ps -o ppid= $pid);
ps uww $header_modifier -p $pid;
header_modifier=h
fi
ppid=$(ps -o ppid= $pid)
ps uww $header_modifier -p $pid
if [ $pid -eq 1 ]; then
break;
fi;
pid=$ppid;
done;
break
fi
pid=$ppid
done
}
main() {
# HACK: Ensure that we only delete data when purging dokku from the system
if ps_backtrace $BASHPID 2> /dev/null | grep dpkg | grep -- "--purge" > /dev/null; then
if ps_backtrace $BASHPID 2>/dev/null | grep dpkg | grep -- "--purge" >/dev/null; then
echo "Processing purge"
echo "Destroying deployed applications"
@@ -40,7 +41,7 @@ main() {
echo "Disabling all core plugins"
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
rm ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
rm ${DOKKU_LIB_ROOT}/plugins/available/$plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn disable $plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn disable $plugin
fi

View File

@@ -2,25 +2,52 @@
> 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 at deployment time, but before an app is completely deployed. Common use cases include:
* Checking a database is initialized
* Running database migrations
* Any commands required to set up the server (e.g. something like a Django `collectstatic`)
## `app.json` and `scripts.dokku`
To support this, Dokku provides support for a special `release` command within your app's `Procfile`, as well as a special `scripts.dokku` key inside of your app's `app.json` file. Be aware that all commands are run within the context of the built docker image - no commands affect the host unless there are volume mounts attached to your app.
Dokku accomplishes this by using an `app.json` file. The format in use is similar to format of Heroku's [app.json](https://devcenter.heroku.com/articles/app-json-schema).
However, Dokku currently only supports the nodes `scripts.dokku.predeploy` and `scripts.dokku.postdeploy`.
For buildpack apps, simply place an `app.json` file in the root of your repository.
For dockerfile apps, place `app.json` in the configured `WORKDIR` directory; otherwise Dokku defaults to the buildpack app behavior of looking in `/app`.
Each "phase" has different expectations and limitations:
> NOTE: postdeploy changes are *NOT* committed to the app image.
- `app.json`: `scripts.dokku.predeploy`
- When to use: This should be used if your app does not support arbitrary build commands and you need to make changes to the built image.
- Are changes committed to the image at this phase: Yes
- Example use-cases
- Bundling assets in a slightly different way
- Installing a custom package from source or copying a binary into place
- `app.json`: `scripts.dokku.postdeploy`
- When to use: This should be used in conjunction with external systems to signal the completion of your deploy.
- Are changes committed to the image at this phase: No
- Example use-cases
- Notifying slack that your app is deployed
- Coordinating traffic routing with a central load balancer
- `Procfile`: `release`
- When to use: This should be used in conjunction with external systems to signal the completion of your app image build.
- Are changes committed to the image at this phase: No
- Example use-cases
- Sending CSS, JS, and other assets from your app’s slug to a CDN or S3 bucket
- Priming or invalidating cache stores
- Running database migrations
### Example app.json
Please keep the above in mind when utilizing deployment tasks.
> NOTE: Only the `scripts.dokku.predeploy` and `scripts.dokku.postdeploy` tasks are supported by Dokku at this time. All other fields will be ignored and can be omitted.
> To execute commands on the host during a release phase, see the [plugin creation documentation](/docs/development/plugin-creation) docs for more information on building your own custom plugin.
## `app.json` deployment tasks
Dokku provides limited support for the `app.json` manifest from Heroku (documentation available [here](https://devcenter.heroku.com/articles/app-json-schema)). The keys available for use with Deployment Tasks are:
- `scripts.dokku.predeploy`: This is run _after_ an app's docker image is built, but _before_ any containers are scheduled. Changes made to your image are committed at this phase.
- `scripts.dokku.postdeploy`: This is run _after_ an app's containers are scheduled. Changes made to your image are *not* committed at this phase.
For buildpack-based deployments, the location of the `app.json` file should be at the root of your repository. Dockerfile-based app deploys should have the `app.json` in the configured `WORKDIR` directory; otherwise Dokku defaults to the buildpack app behavior of looking in `/app`.
> Warning: Any failed `app.json` deployment task will fail the deploy. In the case of either phase, a failure will not affect any running containers.
The following is an example `app.json` file. Please note that only the `scripts.dokku.predeploy` and `scripts.dokku.postdeploy` tasks are supported by Dokku at this time. All other fields will be ignored and can be omitted.
```json
{
@@ -32,3 +59,19 @@ For dockerfile apps, place `app.json` in the configured `WORKDIR` directory; oth
}
}
```
## Procfile Release command
> New as of 0.14.0
The `Procfile` also supports a special `release` command which acts in a similar way to the [Heroku Release Phase](https://devcenter.heroku.com/articles/release-phase). This command is executed _after_ an app's docker image is built, but _before_ any containers are scheduled. This is also run _after_ any command executed by `scripts.dokku.predeploy`.
To use the `release` command, simply add a `release` stanza to your Procfile.
```Procfile
release: curl https://some.external.api.service.com/deployment?state=built
```
Unlike the `scripts.dokku.predeploy` command, changes made during by the `release` command are *not* persisted to disk.
> Warning: scaling the release command up will likely result in unspecified issues within your deployment, and is highly discouraged.

View File

@@ -44,7 +44,7 @@ dokku docker-options:add node-js-app run "-v /var/log/node-js-app:/app/logs"
dokku docker-options:remove node-js-app run "-v /var/log/node-js-app:/app/logs"
```
### Displaying docker-options reports about an app
### Displaying docker-options reports for an app
> New as of 0.8.1
@@ -77,9 +77,9 @@ dokku docker-options:report node-js-app
```
=====> node-js-app docker options information
Storage build mounts:
Storage deploy mounts: -v /var/log/node-js-app:/app/logs
Storage run mounts: -v /var/log/node-js-app:/app/logs
Docker options build:
Docker options deploy: -v /var/log/node-js-app:/app/logs
Docker options run: -v /var/log/node-js-app:/app/logs
```
You can pass flags which will output only the value of the specific information you want. For example:
@@ -88,7 +88,6 @@ You can pass flags which will output only the value of the specific information
dokku docker-options:report node-js-app --docker-options-build
```
## Advanced usage
In your applications folder `/home/dokku/app_name` create a file called `DOCKER_OPTIONS_RUN` (or `DOCKER_OPTIONS_BUILD` or `DOCKER_OPTIONS_DEPLOY`).

View File

@@ -65,7 +65,7 @@ dokku storage:mount app-name /var/lib/dokku/data/storage/node-js-app:/app/storag
You can mount one or more directories as desired by following the above pattern.
### Displaying storage reports about an app
### Displaying storage reports for an app
> New as of 0.8.1

View File

@@ -31,31 +31,31 @@ dokku plugin
```
plugn: dev
00_dokku-standard 0.13.4 enabled dokku core standard plugin
20_events 0.13.4 enabled dokku core events logging plugin
apps 0.13.4 enabled dokku core apps plugin
build-env 0.13.4 enabled dokku core build-env plugin
certs 0.13.4 enabled dokku core certificate management plugin
checks 0.13.4 enabled dokku core checks plugin
common 0.13.4 enabled dokku core common plugin
config 0.13.4 enabled dokku core config plugin
docker-options 0.13.4 enabled dokku core docker-options plugin
domains 0.13.4 enabled dokku core domains plugin
enter 0.13.4 enabled dokku core enter plugin
git 0.13.4 enabled dokku core git plugin
logs 0.13.4 enabled dokku core logs plugin
named-containers 0.13.4 enabled dokku core named containers plugin
network 0.13.4 enabled dokku core network plugin
nginx-vhosts 0.13.4 enabled dokku core nginx-vhosts plugin
plugin 0.13.4 enabled dokku core plugin plugin
proxy 0.13.4 enabled dokku core proxy plugin
ps 0.13.4 enabled dokku core ps plugin
repo 0.13.4 enabled dokku core repo plugin
shell 0.13.4 enabled dokku core shell plugin
ssh-keys 0.13.4 enabled dokku core ssh-keys plugin
storage 0.13.4 enabled dokku core storage plugin
tags 0.13.4 enabled dokku core tags plugin
tar 0.13.4 enabled dokku core tar plugin
00_dokku-standard 0.15.0 enabled dokku core standard plugin
20_events 0.15.0 enabled dokku core events logging plugin
apps 0.15.0 enabled dokku core apps plugin
build-env 0.15.0 enabled dokku core build-env plugin
certs 0.15.0 enabled dokku core certificate management plugin
checks 0.15.0 enabled dokku core checks plugin
common 0.15.0 enabled dokku core common plugin
config 0.15.0 enabled dokku core config plugin
docker-options 0.15.0 enabled dokku core docker-options plugin
domains 0.15.0 enabled dokku core domains plugin
enter 0.15.0 enabled dokku core enter plugin
git 0.15.0 enabled dokku core git plugin
logs 0.15.0 enabled dokku core logs plugin
named-containers 0.15.0 enabled dokku core named containers plugin
network 0.15.0 enabled dokku core network plugin
nginx-vhosts 0.15.0 enabled dokku core nginx-vhosts plugin
plugin 0.15.0 enabled dokku core plugin plugin
proxy 0.15.0 enabled dokku core proxy plugin
ps 0.15.0 enabled dokku core ps plugin
repo 0.15.0 enabled dokku core repo plugin
shell 0.15.0 enabled dokku core shell plugin
ssh-keys 0.15.0 enabled dokku core ssh-keys plugin
storage 0.15.0 enabled dokku core storage plugin
tags 0.15.0 enabled dokku core tags plugin
tar 0.15.0 enabled dokku core tar plugin
```
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.

View File

@@ -0,0 +1,381 @@
# Resource Management
> New as of 0.15.0
```
resource:limit [--process-type <process-type>] [RESOURCE_OPTS...] <app> # Limit resources for a given app/process-type combination
resource:limit-clear [--process-type <process-type>] <app> # Limit resources for a given app/process-type combination
resource:report [<app>] [<flag>] # Displays a resource report for one or more apps
resource:reserve [--process-type <process-type>] [RESOURCE_OPTS...] <app> # Reserve resources for a given app/process-type combination
resource:reserve-clear [--process-type <process-type>] <app> # Reserve resources for a given app/process-type combination
```
The resource plugin is meant to allow users to limit or reserve resources for a given app/process-type combination.
## Usage
By default, Dokku allows unlimited resource access to apps deployed on a server. In some cases, it may be desirable to limit this on a per-app or per-process-type basis. The `resource` plugin allows management of both resource "limits" and resource "reservations", where each resource request type has specific meaning to the scheduler in use for a given app.
> The meaning of a values and it's units are specific to the scheduler in use for a given app. If a scheduler does not support a given resource type combination, it will be ignored. All resource commands require an app rebuild or deploy in order to take effect.
Valid resource options include:
- `--cpu`
- `--memory`
- `--memory-swap`
- `--network`
- `--network-ingress`
- `--network-egress`
Resource limits and reservations are applied only during the `run` and `deploy` phases of an application, and will not impact the `build` phase of an application.
### Resource Limits
When specified and supported, a resource limit will ensure that your app does not go _over_ the specified value. If this occurs, the underlying scheduler may either cap resource utilization, or it may decide to terminate and reschedule your process.
Resource limits may be set via the `resource:limit` command:
```shell
dokku resource:limit --memory 100 node-js-app
```
```
=====> Setting resource limits for node-js-app
memory: 100
```
Multiple resources can be limited in a single call:
```shell
dokku resource:limit --cpu 100 --memory 100 node-js-app
```
```
=====> Setting resource limits for node-js-app
cpu: 100
memory: 100
```
Resources can also be limited on a per-process type basis. If specified, this will override any generic limits set for the app.
```shell
dokku resource:limit --cpu 100 --memory 100 --process-type worker node-js-app
```
```
=====> Setting resource limits for node-js-app (worker)
cpu: 100
memory: 100
```
#### Displaying Resource Limits
Running the `resource:limits` command without any flags will display the currently configured app reservation.
```shell
dokku resource:limits node-js-app
=====> resource limits node-js-app information
cpu: 100
memory: 100
memory-swap:
network:
network-ingress:
network-egress:
```
#### Global Resource Limits
By default, Dokku does not limit any resources, though these can be specified at the server level via the `--global` flag on the `resource:limit` command.
```shell
dokku resource:limit --global --memory 200
```
```
=====> Setting default resource limits
memory: 200
```
This may also be combined with the `--process-type` flag to set global limits on a process-type level:
```shell
dokku resource:limit --global --memory 150 --process-type web node-js-app
```
```
=====> Setting default resource limits (web)
memory: 150
```
#### Displaying Global Resource Limits
Running the `resource:limit` command with only the `--global` flag will display the currently configured default limits.
```shell
dokku resource:limit --global
```
```
=====> resource limits default information
cpu:
memory: 200
memory-swap:
network:
network-ingress:
network-egress:
```
This may also be combined with the `--process-type` flag to see global limits on a process-type level:
```shell
dokku resource:limit --global --process-type web
```
```
=====> resource limits default information (web)
cpu:
memory-swap:
memory: 150
network-egress:
network-ingress:
network:
```
#### Clearing Resource Limits
In cases where the values are incorrect - or there is no desire to limit resources - resource limits may be cleared using the `resource:limit-clear` command.
```shell
dokku resource:limit-clear node-js-app
```
```
-----> Clearing resource limit for node-js-app
```
Defaults can also be cleared by leaving the app unspecified.
```shell
dokku resource:limit-clear
```
```
-----> Clearing default resource limits
```
### Resource Reservations
When specified and supported, a resource reservation will ensure that your server has _at least_ the specified resources before placing a given app's process. If there a resource exhaustion, future rebuilds and deploys may fail.
Resource reservations may be set via the `resource:reserve` command:
```shell
dokku resource:reserve --memory 100 node-js-app
```
```
=====> Setting resource reservation for node-js-app
memory: 100
```
Multiple resources can be limited in a single call:
```shell
dokku resource:reserve --cpu 100 --memory 100 node-js-app
```
```
=====> Setting resource reservation for node-js-app
cpu: 100
memory: 100
```
Resources can also be limited on a per-process type basis. If specified, this will override any generic limits set for the app.
```shell
dokku resource:reserve --cpu 100 --memory 100 --process-type worker node-js-app
```
```
=====> Setting resource reservation for node-js-app (worker)
cpu: 100
memory: 100
```
#### Displaying Resource Reservations
Running the `resource:reserve` command without any flags will display the currently configured app reservation.
```shell
dokku resource:reserve node-js-app
=====> resource reservation node-js-app information
cpu: 100
memory: 100
memory-swap:
network:
network-ingress:
network-egress:
```
#### Global Resource Reservations
By default, Dokku does not reserve any resources, though these can be specified at the server level via the `--global` flag on the `resource:reserve` command.
```shell
dokku resource:reserve --global --memory 200
```
```
=====> Setting default resource reservation
memory: 200
```
This may also be combined with the `--process-type` flag to set global reservations on a process-type level:
```shell
dokku resource:reserve --global --memory 150 --process-type web node-js-app
```
```
=====> Setting default resource reservation (web)
memory: 150
```
#### Displaying Global Resource Reservations
Running the `resource:reserve` command with only the `--global` flag will display the currently configured default reservation.
```shell
dokku resource:reserve --global
```
```
=====> resource reservation default information
cpu:
memory: 200
memory-swap:
network:
network-ingress:
network-egress:
```
This may also be combined with the `--process-type` flag to see global reservations on a process-type level:
```shell
dokku resource:reserve --global --process-type web
```
```
=====> resource reservation default information (web)
cpu:
memory-swap:
memory: 150
network-egress:
network-ingress:
network:
```
#### Clearing Resource Reservations
In cases where the values are incorrect - or there is no desire to reserve resources - resource reservations may be cleared using the `resource:reserve-clear` command.
```shell
dokku resource:reserve-clear node-js-app
```
```
-----> Clearing resource reservation for node-js-app
```
Defaults can also be cleared by leaving the app unspecified.
```shell
dokku resource:reserve-clear
```
```
-----> Clearing default resource reservation
```
### Displaying resource reports for an app
You can get a report about the app's resource status using the `resource:report` command:
```shell
dokku resource:report
```
```
=====> node-js-app resource information
web limit cpu:
web limit memory: 1024
web limit memory swap: 0
web limit network: 10
web limit network ingress:
web limit network egress:
web reservation cpu:
web reservation memory: 512
web reservation memory swap:
web reservation network: 8
web reservation network ingress:
web reservation network egress:
=====> python-sample resource information
web limit cpu:
web limit memory:
web limit memory swap:
web limit network:
web limit network ingress:
web limit network egress:
web reservation cpu:
web reservation memory:
web reservation memory swap:
web reservation network:
web reservation network ingress:
web reservation network egress:
=====> ruby-sample resource information
web limit cpu:
web limit memory:
web limit memory swap:
web limit network:
web limit network ingress:
web limit network egress:
web reservation cpu:
web reservation memory:
web reservation memory swap:
web reservation network:
web reservation network ingress:
web reservation network egress:
```
You can run the command for a specific app also.
```shell
dokku resource:report node-js-app
```
```
=====> node-js-app resource information
web limit cpu:
web limit memory: 1024
web limit memory swap: 0
web limit network: 10
web limit network ingress:
web limit network egress:
web reservation cpu:
web reservation memory: 512
web reservation memory swap:
web reservation network: 8
web reservation network ingress:
web reservation network egress:
```
You can pass flags which will output only the value of the specific information you want. For example:
```shell
# Note the periods in the flag name
dokku resource:report node-js-app --resource-web.limit.memory
```
```
1024
```

View File

@@ -53,3 +53,17 @@ This plugin implements various functionality through `plugn` triggers to integra
- `scheduler-stop`
- `scheduler-tags-create`
- `scheduler-tags-destroy`
## Supported Resource Management Properties
The `docker-local` scheduler supports a minimal list of resource _limits_ and _reservations_. The following properties are supported:
### Resource Limits
- cpu: (docker option: `--cpus`), and is specified in number of CPUs a process can access.
- memory: (docker option: `--memory`) and should be specified with a suffix of `b` (bytes), `k` (kilobytes), `m` (megabytes), `g` (gigabytes)
- memory-swap: (docker option: `--memory-swap`) and should be specified with a suffix of `b` (bytes), `k` (kilobytes), `m` (megabytes), `g` (gigabytes)
### Resource Reservations
- memory: (docker option: `--memory-reservation`) and should be specified with a suffix of `b` (bytes), `k` (kilobytes), `m` (megabytes), `g` (gigabytes)

View File

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

View File

@@ -2,37 +2,37 @@
"name": "Dokku",
"icons": [
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.4\/docs\/assets\/favicons\/android-chrome-36x36.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.0\/docs\/assets\/favicons\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.4\/docs\/assets\/favicons\/android-chrome-48x48.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.0\/docs\/assets\/favicons\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.4\/docs\/assets\/favicons\/android-chrome-72x72.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.0\/docs\/assets\/favicons\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.4\/docs\/assets\/favicons\/android-chrome-96x96.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.0\/docs\/assets\/favicons\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.4\/docs\/assets\/favicons\/android-chrome-144x144.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.0\/docs\/assets\/favicons\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.13.4\/docs\/assets\/favicons\/android-chrome-192x192.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.0\/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.rawgit.com/dokku/dokku/v0.13.4/docs/assets/dokku.png);
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/dokku.png);
text-indent: 40px;
}
.blurb {
color: #424242;
background-color: #ededed;
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/gplaypattern.png);
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/gplaypattern.png);
padding: 45px 0;
text-align: center;
}
@@ -177,7 +177,8 @@ h1 {
.featurette img {
width: 400px;
}
.slack-channel {
.slack-channel,
.sponsors {
background-color: #EEF1F7;
font-size: 1.6em;
font-weight: 300;
@@ -199,28 +200,35 @@ h1 {
.slack-button img {
height: 1em;
}
.team-members img {
-moz-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
-webkit-border-radius: 3px;
-webkit-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
border-radius: 3px;
border: 8px solid white;
box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
display: block;
height: 200px;
margin: 20px auto 20px auto;
.sponsors {
background-color: #272822;
color: #FCFCFC;
}
.team-members .fund-link {
.sponsors a {
color: #f0ad4e;
}
.sponsors .backer img,
.sponsors .sponsor img {
-webkit-border-radius: 3px;
border-radius: 3px;
border: 8px solid gray;
margin: 20px auto 20px auto;
max-width: 192px;
}
.sponsors .backer img {
-webkit-border-radius: 50%;
border-radius: 50%;
border: 0;
}
.sponsors img:hover {
-moz-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
-webkit-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 32px 0px rgba(0,0,0,0.75);
}
.sponsors .fund-link {
display: block;
font-size: .8em;
}
.team-member {
min-height: 320px;
}
.team-member-image img:last-child { display: none }
.team-member-image:hover img:first-child { display: none; }
.team-member-image:hover img:last-child { display: inline-block; }
.list-group-item {
border: none;
font-size: 1.1em;

View File

@@ -1,15 +1,17 @@
{
"max-versions": [
"0.3.26",
"0.4.14",
"0.5.8",
"0.6.5",
"0.7.2",
"0.8.2",
"0.9.4",
"0.10.5",
"0.11.6",
"0.12.13",
"0.13.4"
"0.3.26",
"0.4.14",
"0.5.8",
"0.6.5",
"0.7.2",
"0.8.2",
"0.9.4",
"0.10.5",
"0.11.6",
"0.12.13",
"0.13.4",
"0.14.6",
"0.15.0"
]
}

View File

@@ -126,6 +126,8 @@ The following plugins are available and provided by Dokku maintainers. Where not
[Zenedith]: https://github.com/Zenedith
[fteychene]: https://github.com/fteychene
[sarendsen]: https://github.com/sarendsen
[baikunz]: https://github.com/baikunz
[lazyatom]: https://github.com/lazyatom
### Datastores
@@ -165,6 +167,7 @@ The following plugins are available and provided by Dokku maintainers. Where not
| [FakeSNS](https://github.com/cu12/dokku-fake_sns) | [cu12][] | 0.5.0+ |
| [InfluxDB](https://github.com/basgys/dokku-influxdb) | [basgys][] | 0.4.x |
| [RethinkDB](https://github.com/stuartpb/dokku-rethinkdb-plugin) | [stuartpb][] | 0.3.x |
| [Headless Chrome](https://github.com/lazyatom/dokku-chrome) | [lazyatom][] | 0.8.1+ |
[dccee02]: https://github.com/jeffutter/dokku-riakcs-plugin/commit/dccee02702e7001851917b7814e78a99148fb709
[c77cbf1]: https://github.com/dokku/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
@@ -194,6 +197,7 @@ The following plugins are available and provided by Dokku maintainers. Where not
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>3</sup> | [cedricziel][] | 0.4.0+ |
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>4</sup> | [cedricziel][] | 0.3.x |
| [Application build hook](https://github.com/fteychene/dokku-build-hook) | [fteychene][] | 0.4.0+ |
| [Post Deploy Script](https://github.com/baikunz/dokku-post-deploy-script) | [baikunz][] | 0.4.0+ |
[217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7

View File

@@ -75,7 +75,7 @@ dokku domains:remove node-js-app dokku.me
dokku domains:set node-js-app dokku.me dokku.org
```
## Displaying domains reports about an app
## Displaying domains reports for an app
> New as of 0.8.1
@@ -88,12 +88,12 @@ dokku domains:report
```
=====> node-js-app domains information
Domains app enabled: true
Domains app vhosts: ruby-sample.dokku.org
Domains app vhosts: node-js-sample.dokku.org
Domains global enabled: true
Domains global vhosts: dokku.org
=====> python-sample domains information
Domains app enabled: true
Domains app vhosts: ruby-sample.dokku.org
Domains app vhosts: python-sample.dokku.org
Domains global enabled: true
Domains global vhosts: dokku.org
=====> ruby-sample domains information

View File

@@ -6,6 +6,67 @@ Dokku uses nginx as its server for routing requests to specific applications. By
nginx:access-logs <app> [-t] # Show the nginx access logs for an application (-t follows)
nginx:build-config <app> # (Re)builds nginx config for given app
nginx:error-logs <app> [-t] # Show the nginx error logs for an application (-t follows)
nginx:validate [<app>] [--clean] # Validates and optionally cleans up invalid nginx configurations
```
## Checking access logs
You may check nginx access logs via the `nginx:access-logs` command. This assumes that app access logs are being stored in `/var/log/nginx/$APP-access.log`, as is the default in the generated `nginx.conf`.
```shell
dokku nginx:access-logs node-js-app
```
You may also follow the logs by specifying the `-t` flag.
```shell
dokku nginx:access-logs node-js-app -t
```
## Checking error logs
You may check nginx error logs via the `nginx:access-logs` command. This assumes that app error logs are being stored in `/var/log/nginx/$APP-error.log`, as is the default in the generated `nginx.conf`.
```shell
dokku nginx:error-logs node-js-app
```
You may also follow the logs by specifying the `-t` flag.
```shell
dokku nginx:error-logs node-js-app -t
```
## Regenerating nginx config
In certain cases, your app nginx configs may drift from the correct config for your app. You may regenerate the config at any point via the `nginx:build-config` command. This may fail if there are no current web listeners for your app.
```shell
dokku nginx:build-config node-js-app
```
## Validating nginx configs
It may be desired to validate an nginx config outside of the deployment process. To do so, run the `nginx:validate` command. With no arguments, this will validate all app nginx configs, one at a time. A minimal wrapper nginx config is generated for each app's nginx config, upon which `nginx -t` will be run.
```shell
dokku nginx:validate
```
As app nginx configs are actually executed within a shared context, it is possible for an individual config to be invalid when being validated standalone but _also_ be valid within the global server context. As such, the exit code for the `nginx:validate` command is the exit code of `nginx -t` against the server's real nginx config.
The `nginx:validate` command also takes an optional `--clean` flag. If specified, invalid nginx configs will be removed.
> Warning: Invalid app nginx config's will be removed _even if_ the config is valid in the global server context.
```shell
dokku nginx:validate --clean
```
The `--clean` flag may also be specified for a given app:
```shell
dokku nginx:validate node-js-app --clean
```
## Customizing the nginx configuration

View File

@@ -56,7 +56,7 @@ If you decide to obtain a CA signed certificate, you can import that certificate
The `certs:remove` command only works on app-specific certificates. It will `rm` the app-specific tls directory, rebuild the nginx configuration, and reload nginx.
### Displaying certificate reports about an app
### Displaying certificate reports for an app
> New as of 0.8.1

View File

@@ -1,6 +1,6 @@
# Deploying to Dokku
> Note: This document uses the hostname `dokku.me` in commands. For your server please
> Note: This document uses the hostname `dokku.me` in commands. For your server, please
> substitute your server's hostname instead.
## Deploy tutorial
@@ -15,7 +15,7 @@ git clone git@github.com:heroku/ruby-rails-sample.git
### Create the app
Create the application on the Dokku host. You will need to ssh onto the host to run this command.
Create the application on the Dokku host. You will need to SSH onto the host to run this command.
```shell
# on the Dokku host
@@ -32,26 +32,29 @@ When you create a new app, Dokku by default *does not* provide any datastores su
# plugin installation requires root, hence the user change
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
# create a postgres service with the name rails-database
dokku postgres:create rails-database
# create a postgres service with the name railsdatabase
dokku postgres:create railsdatabase
```
> Each service may take a few moments to create.
### Linking backing services to applications
Once the service creation is complete, set the `POSTGRES_URL` environment variable by linking the service.
Once the service creation is complete, set the `DATABASE_URL` environment variable by linking the service.
```shell
# on the Dokku host
# each official datastore offers a `link` method to link a service to any application
dokku postgres:link rails-database ruby-rails-sample
dokku postgres:link railsdatabase ruby-rails-sample
```
> You can link a single service to multiple applications or use one service per application.
### Deploy the app
> Warning: Your application *should* respect the `PORT` environment variable or it may not respond to web requests.
> Please see the [port management documentation](/docs/networking/port-management.md) for details.
Now you can deploy the `ruby-rails-sample` app to your Dokku server. All you have to do is add a remote to name the app. Applications are created on-the-fly on the Dokku server.
```shell
@@ -97,7 +100,7 @@ Total 231 (delta 93), reused 147 (delta 53)
When the deploy finishes, the application's URL will be shown as seen above.
Dokku supports deploying applications via [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) with [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks) or using a project's [dockerfile](https://docs.docker.com/reference/builder/).
Dokku supports deploying applications via [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) with [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks) or using a project's [Dockerfile](https://docs.docker.com/reference/builder/).
### Skipping deployment
@@ -109,9 +112,9 @@ If you only want to rebuild and tag a container, you can skip the deployment pha
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
```
### Re-Deploying / restarting
### Redeploying or restarting
If you need to re-deploy (or restart) your app:
If you need to redeploy (or restart) your app:
```shell
# on the Dokku host
@@ -122,7 +125,7 @@ See the [process scaling documentation](/docs/deployment/process-management.md)
### Deploying with private git submodules
Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
Dokku uses Git locally (i.e. not a Docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private Git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add `github.com` (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
```shell
# on the Dokku host
@@ -131,7 +134,7 @@ ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
ssh -T git@github.com
```
Note that if the buildpack or dockerfile build process require ssh key access for other reasons, the above may not always apply.
Note that if the buildpack or Dockerfile build process require SSH key access for other reasons, the above may not always apply.
## Deploying to subdomains
@@ -177,9 +180,9 @@ git push dokku master
remote: -----> Application deployed:
remote: http://dokku.me
## Dokku/Docker Container Management Compatibility
## Dokku/Docker container management compatibility
Dokku is, at its core, a docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the docker daemon. One thing to note as in [issue #1220](https://github.com/dokku/dokku/issues/1220), dokku executes a cleanup function prior to every deployment.
Dokku is, at its core, a Docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the Docker daemon. One thing to note as in [issue #1220](https://github.com/dokku/dokku/issues/1220), Dokku executes a cleanup function prior to every deployment.
As of 0.5.x, this function removes all containers with the label `dokku` where the status is either `dead` or `exited`, as well as all `dangling` images. Previous versions would remove `dead` or `exited` containers, regardless of their label.
@@ -193,11 +196,11 @@ See the [nginx documentation](/docs/configuration/nginx.md#default-site).
## Deploying non-master branch
See the [git documentation](/docs/deployment/methods/git.md#changing-the-deploy-branch).
See the [Git documentation](/docs/deployment/methods/git.md#changing-the-deploy-branch).
## Dockerfile deployment
See the [dockerfile documentation](/docs/deployment/methods/dockerfiles.md).
See the [Dockerfile documentation](/docs/deployment/methods/dockerfiles.md).
## Image tagging

View File

@@ -17,7 +17,7 @@ apps:unlock <app> # Unlocks an app for deployment
## Usage
### Listing Applications
### Listing applications
> New as of 0.8.1. Use the `apps` command for older versions.
@@ -33,7 +33,7 @@ node-js-app
python-app
```
Note that you can easily hide extra output from Dokku commands by using the `--quiet` flag, which makes it easier to parse on the command-line.
Note that you can easily hide extra output from Dokku commands by using the `--quiet` flag, which makes it easier to parse on the command line.
```shell
dokku --quiet apps:list
@@ -72,9 +72,9 @@ Creating node-js-app... done
Once created, you can configure the application as normal, and deploy the application whenever ready. This is useful for cases where you may wish to do any of the following kinds of tasks:
- configure domain names and ssl certificates
- create and link datastores
- set environment variables
- Configure domain names and SSL certificates.
- Create and link datastores.
- Set environment variables.
### Removing a deployed app
@@ -103,7 +103,6 @@ dokku --force apps:destroy node-js-app
Destroying node-js-app (including all add-ons)
```
Destroying an application will unlink all linked services and destroy any config related to the application. Note that linked services will retain their data for later use (or removal).
### Renaming a deployed app
@@ -149,9 +148,14 @@ dokku apps:clone node-js-app io-js-app
Cloning node-js-app to io-js-app... done
```
This will copy all of your app's contents into a new app directory with the name of your choice and then rebuild the new version of the app and deploy it. All of your config variables, including database urls, will be preserved.
This will copy all of your app's contents into a new app directory with the name of your choice and then rebuild the new version of the app and deploy it with the following caveats:
> Warning: If you have exposed specific ports via docker-options, added generic domains, or performed anything that cannot be done against multiple applications, `apps:clone` may result in errors.
- All of your environment variables, including database urls, will be preserved.
- Custom domains are not applied to the new app.
- SSL certificates will not be copied to the new app.
- Port mappings with the scheme `https` and host-port `443` will be skipped.
> Warning: If you have exposed specific ports via `docker-options` plugin, or performed anything that cannot be done against multiple applications, `apps:clone` may result in errors.
By default, Dokku will deploy this new application, though you can skip the deploy by using the `--skip-deploy` flag:
@@ -159,7 +163,7 @@ By default, Dokku will deploy this new application, though you can skip the depl
dokku apps:clone --skip-deploy node-js-app io-js-app
```
Finally, if the application already exists, you may wish to ignore errors resulting from attempting to clone over it. To do so, you can use the `--ignore-existing` flag. A warning will be emitted, but the command will return 0.
Finally, if the application already exists, you may wish to ignore errors resulting from attempting to clone over it. To do so, you can use the `--ignore-existing` flag. A warning will be emitted, but the command will return `0`.
```shell
dokku apps:clone --ignore-existing node-js-app io-js-app
@@ -186,7 +190,7 @@ dokku apps:lock node-js-app
In some cases, it may be necessary to remove an existing deploy lock. This can be performed via the `apps:unlock` command.
> Warning: Removing the deploy lock _will not_ stop in progress deploys. At this time, in progress deploys will need to be manually terminated by someone with server access.
> Warning: Removing the deploy lock *will not* stop in progress deploys. At this time, in progress deploys will need to be manually terminated by someone with server access.
```shell
dokku apps:unlock node-js-app
@@ -213,7 +217,7 @@ dokku apps:locked node-js-app
Deploy lock does not exist
```
### Displaying reports about an app
### Displaying reports for an app
> New as of 0.8.1

View File

@@ -7,7 +7,7 @@ logs:failed [<app>] # Shows the last failed deploy
## Usage
### App Logs
### Application logs
You can easily get logs of an app using the `logs` command:
@@ -31,9 +31,10 @@ You can use these modifiers as follows:
```shell
dokku logs node-js-app -t -p web
```
will show logs continually from the web process.
### Failed Deploy Logs
### Failed deploy logs
> Warning: The default `docker-local` scheduler will "store" these until the next deploy or until the old containers are garbage collected - whichever runs first. If you require the logs beyond this point in time, please ship the logs to a centralized log server.

View File

@@ -1,13 +1,165 @@
# Buildpack Deployment
Dokku normally defaults to using [heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) for deployment, though this may be overridden by committing a valid `Dockerfile` to the root of your repository and pushing the repository to your Dokku installation. To avoid this automatic `Dockerfile` deployment detection, you may do one of the following:
> Subcommands new as of 0.15.0
- Use `dokku config:set` to set the `BUILDPACK_URL` environment variable.
- Add `BUILDPACK_URL` to a committed `.env` file in the root of your repository.
- See the [environment variable documentation](/docs/configuration/environment-variables.md) for more details.
```
buildpacks:add [--index 1] <app> <buildpack> # Add new app buildpack while inserting into list of buildpacks if necessary
buildpacks:clear <app> # Clear all buildpacks set on the app
buildpacks:list <app> # List all buildpacks for an app
buildpacks:remove <app> <buildpack> # Remove a buildpack set on the app
buildpacks:report [<app>] [<flag>] # Displays a buildpack report for one or more apps
buildpacks:set [--index 1] <app> <buildpack> # Set new app buildpack at a given position defaulting to the first buildpack if no index is specified
```
> Warning: If using the `buildpacks` plugin, be sure to unset any `BUILDPACK_URL` and remove any such entries from a committed `.env` file. A specified `BUILDPACK_URL` will always override a `.buildpacks` file or the buildpacks plugin.
Dokku normally defaults to using [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) for deployment, though this may be overridden by committing a valid `Dockerfile` to the root of your repository and pushing the repository to your Dokku installation. To avoid this automatic `Dockerfile` deployment detection, you may do one of the following:
- Set a `BUILDPACK_URL` environment variable
- This can be done via `dokku config:set` or via a committed `.env` file in the root of the repository. See the [environment variable documentation](/docs/configuration/environment-variables.md) for more details.
- Create a `.buildpacks` file in the root of your repository.
- This can be via a committed `.buildpacks` file or managed via the `buildpacks` plugin commands.
## Switching from Dockerfile deployments
This page will cover usage of the `buildpacks` plugin.
## Usage
### Listing Buildpacks in Use
The `buildpacks:list` command can be used to show buildpacks that have been set for an app. This will omit any auto-detected buildpacks.
```shell
# running for an app with no buildpacks specified
dokku buildpacks:list node-js-app
```
```
-----> test buildpack urls
```
```shell
# running for an app with two buildpacks specified
dokku buildpacks:list node-js-app
```
```
-----> test buildpack urls
https://github.com/heroku/heroku-buildpack-python.git
https://github.com/heroku/heroku-buildpack-nodejs.git
```
### Adding custom buildpacks
> Please check the documentation for your particular buildpack as you may need to include configuration files (such as a Procfile) in your project root.
To add a custom buildpack, use the `buildpacks:add` command:
```shell
dokku buildpacks:add node-js-app https://github.com/heroku/heroku-buildpack-nodejs.git
```
When no buildpacks are currently specified, the specified buildpack will be the only one executed for detection and compilation.
Multiple buildpacks may be specified by using the `buildpacks:add` command multiple times.
```shell
dokku buildpacks:add node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
dokku buildpacks:add node-js-app https://github.com/heroku/heroku-buildpack-nodejs.git
```
Buildpacks are executed in order, may be inserted at a specified index via the `--index` flag. This flag is specified starting at a 1-index value.
```shell
# will add the golang buildpack at the second position, bumping all proceeding ones by 1 position
dokku buildpacks:add --index 2 node-js-app https://github.com/heroku/heroku-buildpack-golang.git
```
### Overwriting a buildpack position
In some cases, it may be necessary to swap out a given buildpack. Rather than needing to re-specify each buildpack, the `buildpacks:set` command can be used to overwrite a buildpack at a given position.
```shell
dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
```
By default, this will overwrite the _first_ buildpack specified. To specify an index, the `--index` flag may be used. This flag is specified starting at a 1-index value, and defaults to `1`.
```shell
# the following are equivalent commands
dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
dokku buildpacks:set --index 1 node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
```
If the index specified is larger than the number of buildpacks currently configured, the buildpack will be appended to the end of the list.
```shell
dokku buildpacks:set --index 99 node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
```
### Removing a buildpack
> At least one of a buildpack or index must be specified
A single buildpack can be removed by name via the `buildpacks:remove` command.
```shell
dokku buildpacks:remove node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
```
Buildpacks can also be removed by index via the `--index` flag. This flag is specified starting at a 1-index value.
```shell
dokku buildpacks:remove node-js-app --index 1
```
### Clearing all buildpacks
> This does not affect automatically detected buildpacks, nor does it impact any specified `BUILDPACK_URL` environment variable.
The `buildpacks:clear` command can be used to clear all configured buildpacks for a specified app.
```shell
dokku buildpacks:clear node-js-app
```
### Displaying buildpack reports for an app
You can get a report about the app's buildpacks status using the `buildpacks:report` command:
```shell
dokku buildpacks:report
```
```
=====> node-js-app buildpacks information
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> python-sample buildpacks information
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git,https://github.com/heroku/heroku-buildpack-python.git
=====> ruby-sample buildpacks information
Buildpacks list:
```
You can run the command for a specific app also.
```shell
dokku buildpacks:report node-js-app
```
```
=====> node-js-app buildpacks information
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git
```
You can pass flags which will output only the value of the specific information you want. For example:
```shell
dokku buildpacks:report node-js-app --buildpacks-list
```
## Errata
### Switching from Dockerfile deployments
If an application was previously deployed via Dockerfile, the following commands should be run before a buildpack deploy will succeed:
@@ -15,54 +167,25 @@ If an application was previously deployed via Dockerfile, the following commands
dokku config:unset --no-restart node-js-app DOKKU_DOCKERFILE_CMD DOKKU_DOCKERFILE_ENTRYPOINT DOKKU_PROXY_PORT_MAP
```
## Specifying a custom buildpack
In certain cases you may want to specify a custom buildpack. While Dokku uses herokuish to support all the [official heroku buildpacks](https://github.com/gliderlabs/herokuish#buildpacks), it is possible that the buildpack detection does not work well for your application. As well, you may wish to use a custom buildpack to handle specific application logic.
To use a specific buildpack, you can run the following Dokku command:
```shell
# replace REPOSITORY_URL with your buildpack's url
dokku config:set node-js-app BUILDPACK_URL=REPOSITORY_URL
# example: using a specific ruby buildpack version
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v142
```
Please check the documentation for your particular buildpack as you may need to include configuration files (such as a Procfile) in your project root.
## Using multiple buildpacks
You can only set a single buildpack using the `BUILDPACK_URL`, though there may be times when you wish to use multiple buildpacks. To do so, simply create a `.buildpacks` file in the base of your repository. This file should list all the buildpacks, one-per-line. For instance, if you wish to use both the `nodejs` and `ruby` buildpacks, your `.buildpacks` file should contain the following:
```shell
https://github.com/heroku/heroku-buildpack-nodejs.git#v87
https://github.com/heroku/heroku-buildpack-ruby.git#v142
```
### Using a specific buildpack version
> Always remember to pin your buildpack versions when using the multi-buildpacks method, or you may find deploys changing your deployed environment.
You may also choose to set just a single buildpack in this file, though that is up to you.
Please check the documentation for your particular buildpack(s) as you may need to include configuration files (such as a Procfile) in your project root.
## Using a specific buildpack version
As Dokku pins all buildpacks via herokuish releases, there may be occasions where a local buildpack version is out of date. If you wish to use a more recent version of the buildpack, you may use any of the above methods to specify a buildpack **without** the git sha attached like so:
By default, Dokku uses the [gliderlabs/herokuish](https://github.com/gliderlabs/herokuish/) project, which pins all of it's vendored buildpacks. There may be occasions where the pinned version results in a broken deploy, or does not have a particular feature that is required to build your project. To use a more recent version of a given buildpack, the buildpack may be specified *without* a Git commit SHA like so:
```shell
# using the latest nodejs buildpack
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs
dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-nodejs
```
You may also wish to use a **specific** version of a buildpack, which is also simple
This will use the latest commit on the `master` branch of the specified buildpack. To pin to a newer version of a buildpack, a sha may also be specified by using the form `REPOSITORY_URL#COMMIT_SHA`, where `COMMIT_SHA` is any tree-ish git object - usually a git tag.
```shell
# using v87 of the nodejs buildpack
dokku config:set node-js-app BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v87
dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-nodejs#v87
```
## Specifying commands via Procfile
### Specifying commands via Procfile
While many buildpacks have a default command that is run when a detected repository is pushed, it is possible to override this command via a Procfile. A Procfile can also be used to specify multiple commands, each of which is subject to process scaling. See the [process scaling documentation](/docs/deployment/process-management.md) for more details around scaling individual processes.
@@ -87,17 +210,18 @@ importantworker: env QUEUE=important bundle exec rake resque:work
The `web` process type holds some significance in that it is the only process type that is automatically scaled to `1` on the initial application deploy. See the [process scaling documentation](/docs/deployment/process-management.md) for more details around scaling individual processes.
## Curl Build Timeouts
Certain buildpacks may time out in retrieving dependencies via curl. This can happen when your network connection is poor or if there is significant network congestion. You may see a message similar to `gzip: stdin: unexpected end of file` after a curl command.
### `curl` build timeouts
If you see output similar this when deploying , you may need to override the curl timeouts to increase the length of time allotted to those tasks. You can do so via the `config` plugin:
Certain buildpacks may time out in retrieving dependencies via `curl`. This can happen when your network connection is poor or if there is significant network congestion. You may see a message similar to `gzip: stdin: unexpected end of file` after a `curl` command.
If you see output similar this when deploying , you may need to override the `curl` timeouts to increase the length of time allotted to those tasks. You can do so via the `config` plugin:
```shell
dokku config:set --global CURL_TIMEOUT=1200
dokku config:set --global CURL_CONNECT_TIMEOUT=180
```
## Clearing buildpack cache
### Clearing buildpack cache
See the [repository management documentation](/docs/advanced-usage/repository-management.md#clearing-app-cache).

View File

@@ -2,26 +2,26 @@
> New as of 0.3.15
While Dokku normally defaults to using [heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) for deployment, you can also use docker's native `Dockerfile` system to define a container.
While Dokku normally defaults to using [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) for deployment, you can also use Docker's native `Dockerfile` system to define a container.
> Dockerfile support is considered a **Power User** feature. By using Dockerfile-based deployment, you agree that you will not have the same comfort as that enjoyed by Buildpack users, and Dokku features may work differently. Differences between the two systems will be documented here.
> Dockerfile support is considered a *power user* feature. By using Dockerfile-based deployment, you agree that you will not have the same comfort as that enjoyed by buildpack users, and Dokku features may work differently. Differences between the two systems will be documented here.
To use a dockerfile for deployment, commit a valid `Dockerfile` to the root of your repository and push the repository to your Dokku installation. If this file is detected, Dokku will default to using it to construct containers **except** in the following two cases:
To use a Dockerfile for deployment, commit a valid `Dockerfile` to the root of your repository and push the repository to your Dokku installation. If this file is detected, Dokku will default to using it to construct containers *except* in the following two cases:
- The application has a `BUILDPACK_URL` environment variable set via the `dokku config:set` command or in a committed `.env` file. In this case, Dokku will use your specified buildpack.
- The application has a `.buildpacks` file in the root of the repository. In this case, Dokku will use your specified buildpack(s).
## Switching from Buildpack deployments
## Switching from buildpack deployments
If an application was previously deployed via Buildpacks, the following commands should be run before a Dockerfile deploy will succeed:
If an application was previously deployed via buildpacks, the following commands should be run before a Dockerfile deploy will succeed:
```shell
dokku config:unset --no-restart node-js-app DOKKU_PROXY_PORT_MAP
```
## Build-time Configuration Variables
## Build-time configuration variables
For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available only during runtime.
For security reasons - and as per [Docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available only during runtime.
For users that require customization in the `build` phase, you may use build arguments via the [docker-options plugin](docs/advanced-usage/docker-options.md):
@@ -61,7 +61,7 @@ RUN echo $NODE_ENV
## Customizing the run command
By default no arguments are passed to `docker run` when deploying the container and the `CMD` or `ENTRYPOINT` defined in the `Dockerfile` are executed. You can take advantage of docker ability of overriding the `CMD` or passing parameters to your `ENTRYPOINT` setting `$DOKKU_DOCKERFILE_START_CMD`. Let's say for example you are deploying a base nodejs image, with the following `ENTRYPOINT`:
By default no arguments are passed to `docker run` when deploying the container and the `CMD` or `ENTRYPOINT` defined in the `Dockerfile` are executed. You can take advantage of docker ability of overriding the `CMD` or passing parameters to your `ENTRYPOINT` setting `$DOKKU_DOCKERFILE_START_CMD`. Let's say for example you are deploying a base Node.js image, with the following `ENTRYPOINT`:
```Dockerfile
ENTRYPOINT ["node"]
@@ -73,18 +73,17 @@ You can do:
dokku config:set node-js-app DOKKU_DOCKERFILE_START_CMD="--harmony server.js"
```
To tell docker what to run.
To tell Docker what to run.
Setting `$DOKKU_DOCKERFILE_CACHE_BUILD` to `true` or `false` will enable or disable docker's image layer cache. Lastly, for more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`.
Setting `$DOKKU_DOCKERFILE_CACHE_BUILD` to `true` or `false` will enable or disable Docker's image layer cache. Lastly, for more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`.
### Procfiles and Multiple Processes
### Procfiles and multiple processes
> New as of 0.5.0
You can also customize the run command using a `Procfile`, much like you would on Heroku or
with a buildpack deployed app. The `Procfile` should contain one or more lines defining [process
types and associated commands](https://devcenter.heroku.com/articles/procfile#declaring-process-types).
When you deploy your app a Docker image will be built, the `Procfile` will be extracted from the image
with a buildpack deployed app. The `Procfile` should contain one or more lines defining [process types and associated commands](https://devcenter.heroku.com/articles/procfile#declaring-process-types).
When you deploy your app, a Docker image will be built. The `Procfile` will be extracted from the image
(it must be in the folder defined in your `Dockerfile` as `WORKDIR` or `/app`) and the commands
in it will be passed to `docker run` to start your process(es). Here's an example `Procfile`:

View File

@@ -1,4 +1,4 @@
# GIT Deployment
# Git Deployment
> Subcommands new as of 0.12.0
@@ -8,11 +8,11 @@ git:report [<app>] [<flag>] # Displays a git report for one or more
git:set <app> <key> (<value>) # Set or clear a git property for an app
```
GIT-based deployment has been the traditional method of deploying applications in Dokku. As of v0.12.0, Dokku introduces a few ways to customize the experience of deploying via `git push`. A GIT-based deployment currently supports building applications via both [Buildpack](/docs/deployment/methods/buildpacks.md) and [Dockerfile](/docs/deployment/methods/dockerfiles.md).
Git-based deployment has been the traditional method of deploying applications in Dokku. As of v0.12.0, Dokku introduces a few ways to customize the experience of deploying via `git push`. A Git-based deployment currently supports building applications via both [Buildpack](/docs/deployment/methods/buildpacks.md) and [Dockerfile](/docs/deployment/methods/dockerfiles.md).
## Usage
### Initializing an Application
### Initializing an application
When an application is created via `git push`, Dokku will create the proper `pre-receive` hook in order to execute the build pipeline. In certain cases - such as when fronting deploys with the [`git-http-backend`](https://git-scm.com/docs/git-http-backend) - this may not be correctly created. As an alternative, the `git:initialize` command can be used to trigger this creation:
@@ -23,13 +23,13 @@ When an application is created via `git push`, Dokku will create the proper `pre
dokku git:initialize node-js-app
```
In order for the above command to succeed, the application _must_ already exist.
In order for the above command to succeed, the application *must* already exist.
> Warning: If the pre-receive hook was customized in any way, this will overwrite that hook with the current defaults for Dokku.
> Warning: If the `pre-receive` hook was customized in any way, this will overwrite that hook with the current defaults for Dokku.
### Changing the Deploy Branch
### Changing the deploy branch
By default, Dokku will deploy code pushed to the `master` branch. In order to quickly deploy a different local branch, the following GIT command can be used:
By default, Dokku will deploy code pushed to the `master` branch. In order to quickly deploy a different local branch, the following Git command can be used:
```shell
# on the local machine
@@ -53,11 +53,11 @@ dokku git:set node-js-app deploy-branch SOME_BRANCH_NAME
Pushing multiple branches can also be supported by creating a [receive-branch](/docs/development/plugin-triggers.md#receive-branch) plugin trigger in a custom plugin.
### Configuring the GIT_REV Environment Variable
### Configuring the `GIT_REV` environment variable
> New as of 0.12.0
Application deployments will include a special `GIT_REV` environment variable containing the current deployment sha being deployed. For rebuilds, this sha will remain the same.
Application deployments will include a special `GIT_REV` environment variable containing the current deployment sha being deployed. For rebuilds, this SHA will remain the same.
To configure the name of the `GIT_REV` environment variable, run the `git:set` command as follows:

View File

@@ -9,14 +9,14 @@ tags:deploy <app> <tag> # Deploy tagged app image
tags:destroy <app> <tag> # Remove app image tag
```
The Dokku tags plugin allows you to add docker image tags to the currently deployed app image for versioning and subsequent deployment.
The Dokku tags plugin allows you to add Docker image tags to the currently deployed app image for versioning and subsequent deployment.
> When triggering `dokku ps:rebuild APP` on an application deployed via the `tags` plugin, the following may occur:
>
> - Applications previously deployed via another method (`git`/`tar`): The application may revert to a state before the latest custom image tag was deployed.
> - Applications that were only ever deployed via the `tags` plugin: No action will be taken against your application.
>
> Please use the `tags:deploy` command when redeploying an application deployed via docker image.
> Please use the `tags:deploy` command when redeploying an application deployed via Docker image.
## Usage
@@ -40,7 +40,7 @@ dokku/node-js-app latest 936a42f25901 About a minute ago
### Creating a tag
You can also create new tags for that app using the `tags:create` function. Tags should conform to the docker tagging specification for your docker version. As of 1.10, that specification is available [here](https://github.com/docker/docker/blob/master/image/spec/v1.1.md), while users of older versions can check the documentation [here](https://github.com/docker/docker/blob/master/image/spec/v1.md).
You can also create new tags for that app using the `tags:create` function. Tags should conform to the Docker tagging specification for your Docker version. As of 1.10, that specification is available [here](https://github.com/docker/docker/blob/master/image/spec/v1.1.md), while users of older versions can check the documentation [here](https://github.com/docker/docker/blob/master/image/spec/v1.md).
```shell
dokku tags:create node-js-app v1
@@ -65,7 +65,9 @@ dokku/node-js-app v1 936a42f25901 About a minute ago
### Deploying an image tag
Finally, you can also deploy a local image using the `tags:deploy` command.
Finally, you can also deploy a local image using the `tags:deploy` command. When specifying a tag that is not `latest`, the released image will be retagged as the `latest` image tag for the app.
> Warning: For images based on Herokuish, using the `tags:deploy` command will reset environment variables written into the image, causing a retag to occur. This will - on average - add two extra layers to your deployed image. Note that this does not affect Dockerfile-based images, which are the majority of images deployed via the `tags` command.
```shell
dokku tags:deploy node-js-app v1
@@ -98,31 +100,31 @@ dokku tags:deploy node-js-app v1
http://node-js-app.dokku.me
```
## Image Workflows
## Image workflows
### Deploying from a Docker Registry
### Deploying from a Docker registry
You can alternatively add image pulled from a docker Registry and deploy app from it by using tagging feature. In this example, we are deploying from Docker Hub.
You can alternatively add image pulled from a Docker registry and deploy from it by using tagging feature. In this example, we are deploying from Docker Hub.
1. Create Dokku app as usual
1. Create Dokku app as usual.
```shell
dokku apps:create test-app
```
2. Pull image from Docker Hub
2. Pull image from Docker Hub.
```shell
docker pull demo-repo/some-image:v12
```
3. Retag the image to match the created app
3. Retag the image to match the created app.
```shell
docker tag demo-repo/some-image:v12 dokku/test-app:v12
```
4. Deploy tag
4. Deploy tag.
```shell
dokku tags:deploy test-app v12
@@ -135,22 +137,22 @@ artifacts in your repository. For some projects however, building artifacts duri
to Dokku may affect the performance of running applications.
One solution is to build a finished Docker image on a CI service (or even locally) and deploy
it directly to the host running dokku.
it directly to the host running Dokku.
1. Build image on CI (or locally)
1. Build image on CI (or locally).
```shell
docker build -t dokku/test-app:v12 .
# Note: The image must be tagged `dokku/<app-name>:<version>`
```
2. Deploy image to Dokku host
2. Deploy image to Dokku host.
```shell
docker save dokku/test-app:v12 | ssh my.dokku.host "docker load | dokku tags:deploy test-app v12"
```
> Note: You can also use a Docker Registry to push and pull
> Note: You can also use a Docker registry to push and pull
> the image rather than uploading it directly.
Here's a more complete example using the above method:
@@ -161,10 +163,10 @@ docker build -t dokku/test-app:v12 .
# copy the image to the dokku host
docker save dokku/test-app:v12 | bzip2 | ssh my.dokku.host "bunzip2 | docker load"
# tag and deploy the image
ssh my.dokku.host "dokku tags:create test-app previous; dokku tags:deploy test-app v12 && dokku tags:create test-app latest"
ssh my.dokku.host "dokku tags:create test-app previous; dokku tags:deploy test-app v12"
```
## Related articles
- [Setting up Persistent Storage](/docs/advanced-usage/persistent-storage.md)
- [Defining Environment Variables](/docs/configuration/environment-variables.md)
- [Setting up the Ports](/docs/advanced-usage/proxy-management.md)
- [Setting up persistent storage](/docs/advanced-usage/persistent-storage.md)
- [Defining environment variables](/docs/configuration/environment-variables.md)
- [Setting up the ports](/docs/advanced-usage/proxy-management.md)

View File

@@ -18,7 +18,7 @@ tar:in <app> # Reads an tarball containing the
### Deploying from a tarball
In some cases, it may be useful to deploy an application from a tarball. For instance, if you implemented a non-git based deployment plugin, tarring the generated artifact may be an easier route to interface with the existing Dokku infrastructure.
In some cases, it may be useful to deploy an application from a tarball. For instance, if you implemented a non-Git based deployment plugin, tarring the generated artifact may be an easier route to interface with the existing Dokku infrastructure.
You can place the tarball on an external webserver and deploy via the `tar:from` command.

View File

@@ -61,7 +61,7 @@ dokku --rm run node-js-app some-command
dokku --rm-container run node-js-app some-command
```
For tasks that should not be interrupted, run is the **preferred** method of handling cron tasks, as the container will continue running even during a deploy or scaling event. The trade-off is that there will be an increase in memory usage if there are multiple concurrent tasks running.
For tasks that should not be interrupted, run is the *preferred* method of handling cron tasks, as the container will continue running even during a deploy or scaling event. The trade-off is that there will be an increase in memory usage if there are multiple concurrent tasks running.
## Entering existing containers
@@ -79,7 +79,7 @@ dokku enter node-js-app web.1
dokku enter node-js-app --container-id ID
```
Additionally, you can run `enter` with no container-type. If only a single container-type is defined in your app, you will be dropped into the only running container. This behavior is not supported when specifying a custom command; as described below.
Additionally, you can run `enter` with no `<container-type>`. If only a single `<container-type>` is defined in your app, you will be dropped into the only running container. This behavior is not supported when specifying a custom command; as described below.
By default, it runs a `/bin/bash`, but can also be used to run a custom command:
@@ -93,7 +93,7 @@ dokku enter node-js-app web python script/background-worker.py
### Using `enter` for cron tasks
Your procfile can have the following entry:
Your Procfile can have the following entry:
```Procfile
cron: sleep infinity
@@ -113,28 +113,28 @@ dokku enter node-js-app cron some-command
Note that you can also run multiple commands at the same time to reduce memory usage, though that may result in polluting the container environment.
For tasks that will properly resume, you **should** use the above method, as running tasks will be interrupted during deploys and scaling events, and subsequent commands will always run with the latest container. Note that if you scale the cron container down, this may interrupt proper running of the task.
For tasks that will properly resume, you *should* use the above method, as running tasks will be interrupted during deploys and scaling events, and subsequent commands will always run with the latest container. Note that if you scale the cron container down, this may interrupt proper running of the task.
## General Cron Recommendations
## General cron recommendations
Regularly scheduled tasks can be a bit of a pain with dokku. The following are general recommendations to follow to help ensure successful task runs.
Regularly scheduled tasks can be a bit of a pain with Dokku. The following are general recommendations to follow to help ensure successful task runs.
- Use the `dokku` user's crontab
- If you do not, the `dokku` binary will attempt to execute with `sudo` dokku, and your cron run with fail with `sudo: no tty present and no askpass program specified`
- Use the `dokku` user's crontab.
- If you do not, the `dokku` binary will attempt to execute with `sudo`, and your cron run with fail with `sudo: no tty present and no askpass program specified`.
- Add a `MAILTO` environment variable to ship cron emails to yourself.
- Add a `PATH` environment variable or specify the full path to binaries on the host.
- Add a `SHELL` environment variable to specify bash when running commands.
- Add a `SHELL` environment variable to specify Bash when running commands.
- Keep your cron tasks in time-sorted order.
- Keep your server time in UTC so you don't need to translate daylight saving's time when reading the cronfile.
- Keep your server time in UTC so you don't need to translate daylight savings time when reading the cronfile.
- Run tasks at the lowest traffic times if possible.
- Use cron to **trigger** jobs, not run them. Use a real queuing system such as rabbitmq to actually process jobs.
- Use cron to *trigger* jobs, not run them. Use a real queuing system such as rabbitmq to actually process jobs.
- Try to keep tasks quiet so that mails only send on errors.
- Do not silence standard error or standard out. If you silence the former, you will miss failures. Silencing the latter means you should actually make application changes to handle log levels.
- Use a service such as [Dead Man's Snitch](https://deadmanssnitch.com) to verify that cron tasks completed successfully.
- Add lots of comments to your cronfile, including what a task is doing, so that you don't spend time deciphering the file later.
- Place your cronfiles in a pattern such as `/etc/cron.d/APP`.
- Do not use non-ascii characters in your cronfile names. Cron is finicky.
- Remember to have trailing newlines in your cronfile! Cron is finicky.
- Do not use non-ASCII characters in your cronfile names. cron is finicky.
- Remember to have trailing newlines in your cronfile! cron is finicky.
The following is a sample cronfile that you can use for your applications:

View File

@@ -21,7 +21,7 @@ ps:stopall # Stop all app container(s)
By default, Dokku will only start a single `web` process - if defined - though process scaling can be managed by the `ps` plugin or [via a custom `DOKKU_SCALE` file](/docs/deployment/process-management.md#manually-managing-process-scaling).
> The `web` proctype is the only proctype that will invoke custom checks as defined by a CHECKS file. It is also the only process type that will be launched in a container that is either proxied via nginx or bound to an external port.
> The `web` proctype is the only proctype that will invoke custom checks as defined by a `CHECKS` file. It is also the only process type that will be launched in a container that is either proxied via nginx or bound to an external port.
## Usage
@@ -37,7 +37,7 @@ dokku ps node-js-app
> New as of 0.13.0
A common administrative task to perform is calling `docker inspect` on the containers that are running for an application. This can be an error-prone task to perform, and may also reveal sensitive environment variables if not done correctly. Dokku provides a wrapper around this command via the `ps:inspect` subcommand:
A common administrative task to perform is calling `docker inspect` on the containers that are running for an application. This can be an error-prone task to perform, and may also reveal sensitive environment variables if not done correctly. Dokku provides a wrapper around this command via the `ps:inspect` command:
```shell
dokku ps:inspect node-js-app
@@ -47,7 +47,7 @@ This command will gather all the running container IDs for your application and
### Rebuilding applications
There are some Dokku commands which will not automatically rebuild an application's environment, or which can be told to skip a rebuild. For instance, you may wish to run multiple `config:set` commands without a restart so as to speed up configuration. In these cases, you can ultimately trigger an application rebuild using `ps:rebuild`
There are some Dokku commands which will not automatically rebuild an application's environment, or which can be told to skip a rebuild. For instance, you may wish to run multiple `config:set` commands without a restart so as to speed up configuration. In these cases, you can ultimately trigger an application rebuild using `ps:rebuild`
```shell
dokku ps:rebuild node-js-app
@@ -60,13 +60,13 @@ dokku ps:rebuildall
```
> The `ps:rebuild` and `ps:rebuildall` commands only work for applications for which there is a source, and thus
> will only always work deterministically for git-deployed application. Please see
> will only always work deterministically for Git-deployed application. Please see
> the [images documentation](/docs/deployment/methods/images.md) and [tar documentation](/docs/deployment/methods/tar.md)
> in for more information concerning rebuilding those applications.
### Restarting applications
Applications can be restarted, which is functionally identical to calling the `release_and_deploy` function on an application. Please not that any linked containers *must* be started before the application in order to have a successful boot.
Applications can be restarted, which is functionally identical to calling the `release_and_deploy` function on an application. Please note that any linked containers *must* be started before the application in order to have a successful boot.
```shell
dokku ps:restart node-js-app
@@ -108,7 +108,7 @@ dokku ps:scale node-js-app
### Stopping applications
Deployed applications can be stopped using the `ps:stop` command. This turns off all running containers for an application, and will result in a `502 Bad Gateway` response for the default nginx proxy implementation.
Deployed applications can be stopped using the `ps:stop` command. This turns off all running containers for an application, and will result in a **502 Bad Gateway** response for the default nginx proxy implementation.
```shell
dokku ps:stop node-js-app
@@ -130,7 +130,7 @@ dokku ps:start node-js-app
### Starting all applications
In some cases, it may be necessary to start all applications from scratch - eg. if all Docker containers have been manually stopped. This can be executed via the `ps:startall` command, which supports parallelism in the same manner `ps:rebuildall`, `ps:restartall`, and `ps:stopall` do.
In some cases, it may be necessary to start all applications from scratch - e.g. if all Docker containers have been manually stopped. This can be executed via the `ps:startall` command, which supports parallelism in the same manner `ps:rebuildall`, `ps:restartall`, and `ps:stopall` do.
Be aware that no action will be taken if the application containers are running.
@@ -138,7 +138,7 @@ Be aware that no action will be taken if the application containers are running.
dokku ps:startall
```
## Restart Policies
## Restart policies
> New as of 0.7.0
@@ -210,7 +210,7 @@ Restart policies have no bearing on server reboot, and Dokku will always attempt
## Manually managing process scaling
You can optionally _commit_ a `DOKKU_SCALE` file to the root of your repository - *not* to the /home/dokku/APP directory. Dokku expects this file to contain one line for every process defined in your Procfile.
You can optionally *commit* a `DOKKU_SCALE` file to the root of your repository - *not* to the `/home/dokku/APP` directory. Dokku expects this file to contain one line for every process defined in your Procfile.
Example:
@@ -221,4 +221,4 @@ worker=2
If it is not committed to the repository, the `DOKKU_SCALE` file will otherwise be automatically generated based on your `ps:scale` settings.
> *NOTE*: Dokku will always use the DOKKU_SCALE file that ships with the repo to override any local settings.
> *NOTE*: Dokku will always use the `DOKKU_SCALE` file that ships with the repo to override any local settings.

View File

@@ -1,6 +1,6 @@
# Remote Commands
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@dokku.me <command>`
Dokku commands can be run over SSH. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@dokku.me <command>`
The `-t` is used to request a pty. It is highly recommended to do so.
To avoid the need to type the `-t` option each time, simply create/modify a section in the `.ssh/config` on the client side, as follows:
@@ -11,8 +11,8 @@ Host dokku.me
## Behavioral modifiers
Dokku also supports certain command-line arguments that augment it's behavior. If using these over ssh, you must use the form `ssh -t dokku@dokku.me -- <command>`
in order to avoid ssh interpretting Dokku arguments for itself.
Dokku also supports certain command line arguments that augment its behavior. If using these over SSH, you must use the form `ssh -t dokku@dokku.me -- <command>`
in order to avoid SSH interpretting Dokku arguments for itself.
```
--quiet suppress output headers

View File

@@ -8,17 +8,17 @@ ssh-keys:list # List of all authorized Dokku pu
ssh-keys:remove <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.
When pushing to Dokku, SSH key-based authorization is the preferred authentication method, for ease of use and increased security.
Users in Dokku are managed via the `~/dokku/.ssh/authorized_keys` file. It is **highly** recommended that you follow the steps below to manage users on a Dokku server.
Users in Dokku are managed via the `~/dokku/.ssh/authorized_keys` file. It is *highly* recommended that you follow the steps below to manage users on a Dokku server.
> Users of older versions of Dokku may use the `sshcommand` binary to manage keys instead of the `ssh-keys` plugin. Please refer to the Dokku documentation for your version for more details.
## Usage
### Listing SSH Keys
### Listing SSH keys
You can use the `ssh-keys:list` command to show all configured ssh keys. Any key added via the `dokku-installer` will be associated with the `admin` key name.
You can use the `ssh-keys:list` command to show all configured SSH keys. Any key added via the `dokku-installer` will be associated with the `admin` key name.
```shell
dokku ssh-keys:list
@@ -32,11 +32,11 @@ The output contains the following information:
- SSH Key Fingerprint.
- The `KEY_NAME`.
- A comma separated list of ssh options under the `SSHCOMMAND_ALLOWED_KEYS` name.
- A comma separated list of SSH options under the `SSHCOMMAND_ALLOWED_KEYS` name.
### Adding SSH Keys
### 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:
You can add your public key to Dokku with the `ssh-keys:add` command. The output will be the fingerprint of the SSH key:
```shell
dokku ssh-keys:add KEY_NAME path/to/id_rsa.pub
@@ -48,7 +48,7 @@ b7:76:27:4f:30:90:21:ae:d4:1e:70:20:35:3f:06:d6
`KEY_NAME` is the name you want to use to refer to this particular key. Including the word `admin` in the name will grant the user privileges to add additional keys remotely.
> `KEY_NAME` is a unique name which is used to identify public keys. Attempting to re-use a key name will result in an error. The ssh (git) user is *always* `dokku`, as this is the system user that the `dokku` binary uses to perform all it's actions.
> `KEY_NAME` is a unique name which is used to identify public keys. Attempting to re-use a key name will result in an error. The SSH (Git) user is *always* `dokku`, as this is the system user that the `dokku` binary uses to perform all its actions.
Admin users and root can add keys remotely by specifying the `dokku` bin on their `ssh` command:
@@ -56,15 +56,15 @@ Admin users and root can add keys remotely by specifying the `dokku` bin on thei
cat ~/.ssh/id_rsa.pub | ssh root@dokku.me dokku ssh-keys:add KEY_NAME
```
If you are using the vagrant installation, you can also use the `make vagrant-acl-add` target to add your public key to Dokku (it will use your host username as the `USER`):
If you are using the Vagrant installation, you can also use the `make vagrant-acl-add` target to add your public key to Dokku (it will use your host username as the `USER`):
```shell
cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
```
### Removing SSH Keys
### Removing SSH keys
As key names are unique, they can be used to remove a public ssh key.
As key names are unique, they can be used to remove a public SSH key.
```SHELL
dokku ssh-keys:remove KEY_NAME
@@ -76,7 +76,7 @@ Keys are given unique names, which can be used in conjunction with the [user-aut
## Granting other Unix user accounts Dokku access
Any Unix user account which belongs to the 'sudo' Unix group can run Dokku. However, you may want to give them Dokku access but not full sudo privileges.
Any Unix user account which belongs to the `sudo` Unix group can run Dokku. However, you may want to give them Dokku access but not full sudo privileges.
To allow other Unix user accounts to be able to run Dokku commands, without giving them full sudo access, modify your sudoers configuration.

View File

@@ -11,7 +11,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 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.
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.
@@ -19,17 +19,17 @@ You may both create user-defined checks for web processes using a `CHECKS` file,
> as the Django framework - checks for specific hostnames or header values, these
> checks will fail. To avoid this:
>
> - Remove such checks from your code: Modify your application to remove the hostname check completely
> - Allow checks from all hostnames: Modify your application to accept a dynamically provided hostname
> - Specify the domain within the check: See below for further documentation
> - Remove such checks from your code: Modify your application to remove the hostname check completely.
> - Allow checks from all hostnames: Modify your application to accept a dynamically provided hostname.
> - Specify the domain within the check: See below for further documentation.
## Configuring Check Settings using the `config` plugin
## Configuring check settings using the `config` plugin
There are certain settings that can be configured via environment variables:
- `DOKKU_DEFAULT_CHECKS_WAIT`: (default: `10`) If no user-defined checks are specified - or if the process being checked is not a `web` process - this is the period of time Dokku will wait before checking that a container is still running.
- `DOKKU_DOCKER_STOP_TIMEOUT`: (default: `10`) Configurable grace period given to the `docker stop` command. If a container has not stopped by this time, a `kill -9` signal or equivalent is sent in order to force-terminate the container. Both the `ps:stop` and `apps:destroy` commands _also_ respect this value. If not specified, the docker defaults for the [docker stop command](https://docs.docker.com/engine/reference/commandline/stop/) will be used.
- `DOKKU_WAIT_TO_RETIRE`: (default: `60`) After a successful deploy, the grace period given to old containers before they are stopped/terminated. This is useful for ensuring completion of long-running http connections.
- `DOKKU_DOCKER_STOP_TIMEOUT`: (default: `10`) Configurable grace period given to the `docker stop` command. If a container has not stopped by this time, a `kill -9` signal or equivalent is sent in order to force-terminate the container. Both the `ps:stop` and `apps:destroy` commands *also* respect this value. If not specified, the Docker defaults for the [`docker stop` command](https://docs.docker.com/engine/reference/commandline/stop/) will be used.
- `DOKKU_WAIT_TO_RETIRE`: (default: `60`) After a successful deploy, the grace period given to old containers before they are stopped/terminated. This is useful for ensuring completion of long-running HTTP connections.
The following settings may also be specified in the `CHECKS` file, though are available as environment variables in order to ease application reuse.
@@ -56,7 +56,7 @@ dokku checks:skip node-js-app worker,web
DOKKU_CHECKS_SKIPPED: worker,web
```
Zero-downtime checks can also be disabled completely. This will stop old containers **before** new ones start, which may result in broken connections and downtime if your application fails to boot properly.
Zero downtime checks can also be disabled completely. This will stop old containers *before* new ones start, which may result in broken connections and downtime if your application fails to boot properly.
```shell
dokku checks:disable node-js-app worker
@@ -70,7 +70,7 @@ dokku checks:disable node-js-app worker
DOKKU_CHECKS_SKIPPED: web
```
### Displaying checks reports about an app
### Displaying checks reports for an app
> New as of 0.8.1
@@ -110,22 +110,22 @@ You can pass flags which will output only the value of the specific information
dokku checks:report node-js-sample --checks-disabled-list
```
## Customizing Checks
## Customizing checks
If your application needs a longer period to boot up - perhaps to load data into memory, or because of slow boot time - you may also use dokku's `checks` functionality to more precisely check whether an application can serve traffic or not.
If your application needs a longer period to boot up - perhaps to load data into memory, or because of slow boot time - you may also use Dokku's `checks` functionality to more precisely check whether an application can serve traffic or not.
Checks are run against the detected `web` process from your application's `Procfile`. For non-web processes, Dokku will fallback to the aforementioned process uptime check.
To specify checks, add a `CHECKS` file to the root of your project directory. The `CHECKS` file should be plain text and may contain:
- Check instructions
- Settings (NAME=VALUE)
- Comments (lines starting with #)
- Empty lines
- check instructions
- settings (NAME=VALUE)
- comments (lines starting with #)
- empty lines
> For dockerfile-based deploys, the file *must* be in `/app/CHECKS` within the container. `/app` is used by default as the root container directory for buildpack-based deploys.
> For Dockerfile-based deploys, the file *must* be in `/app/CHECKS` within the container. `/app` is used by default as the root container directory for buildpack-based deploys.
### Check Instructions
### Check instructions
The format of a check instruction is a path or relative URL, optionally followed by the expected content:
@@ -156,9 +156,9 @@ https://admin.dokku.me Admin Dashboard
https://static.dokku.me/logo.png
```
While a full url may be used in order to invoke checks, if you are using relative urls, the port *must* be omitted.
While a full URL may be used in order to invoke checks, if you are using relative URLs, the port *must* be omitted.
### Check Settings
### Check settings
The default behavior is to wait for `5` seconds before running the checks, to timeout the checks after `30` seconds, and to attempt the checks `5` times. If the checks fail `5` times, the deployment is considered failed and the old container will continue serving traffic.
@@ -172,7 +172,7 @@ ATTEMPTS=10 # Attempt checks 10 times
/ My Amazing App
```
## Manually Invoking Checks
## Manually invoking checks
Checks can also be manually invoked via the `checks:run` command. This can be used to check the status of an application via cron to provide integration with external healthchecking software.
@@ -220,7 +220,7 @@ dokku checks:run node-js-app worker
-----> Default container check successful!
```
An app process id may also be specified:
An app process ID may also be specified:
```shell
dokku checks:run node-js-app web.2
@@ -247,7 +247,7 @@ dokku checks:run node-js-app non-existent
Invalid process type specified (APP.non-existent)
```
Non-existent process ids will *also* result in an error
Non-existent process IDs will *also* result in an error
```shell
dokku checks:run node-js-app web.3
@@ -258,11 +258,11 @@ dokku checks:run node-js-app web.3
Invalid container id specified (APP.web.3)
```
## Example: Successful Rails Deployment
## Example: Successful Rails deployment
In this example, a Rails application is successfully deployed to dokku. The initial round of checks fails while the server is starting, but once it starts they succeed and the deployment is successful. `WAIT` is set to `10` because our application takes a while to boot up. `ATTEMPTS` is set to `6`, but the third attempt succeeds.
In this example, a Rails application is successfully deployed to Dokku. The initial round of checks fails while the server is starting, but once it starts they succeed and the deployment is successful. `WAIT` is set to `10` because our application takes a while to boot up. `ATTEMPTS` is set to `6`, but the third attempt succeeds.
### CHECKS file
### `CHECKS` file
```
WAIT=10
@@ -276,9 +276,9 @@ For this check to work, we've added a line to `config/routes.rb` that simply ret
get '/check.txt', to: proc {[200, {}, ['simple_check']]}
```
### Deploy Output
### Deploy output
> Note: The output has been trimmed for brevity
> Note: The output has been trimmed for brevity.
```shell
git push dokku master
@@ -334,13 +334,13 @@ curl: (7) Failed to connect to 172.17.0.155 port 5000: Connection refused
http://myapp.dokku.me
```
## Example: Failing Rails Deployment
## Example: Failing Rails deployment
In this example, a Rails application fails to deploy. The reason for the failure is that the postgres database connection fails. The initial checks will fail while we wait for the server to start up, just like in the above example. However, once the server does start accepting connections, we will see an error 500 due to the postgres database connection failure.
In this example, a Rails application fails to deploy. The reason for the failure is that the PostgreSQL database connection fails. The initial checks will fail while we wait for the server to start up, just like in the above example. However, once the server does start accepting connections, we will see an error 500 due to the PostgreSQL database connection failure.
Once the attempts have been exceeded, the deployment fails and we see the container output, which shows the Postgres connection errors.
Once the attempts have been exceeded, the deployment fails and we see the container output, which shows the PostgreSQL connection errors.
### CHECKS file
### `CHECKS` file
```
WAIT=10
@@ -348,11 +348,11 @@ ATTEMPTS=6
/
```
> The check to the root url '/' would normally access the database.
> The check to the root url `/` would normally access the database.
### Deploy Output
### Deploy output
> Note: The output has been trimmed for brevity
> Note: The output has been trimmed for brevity.
```shell
git push dokku master

View File

@@ -45,7 +45,7 @@ hello_main_cmd() {
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
[[ ! -z $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
[[ -n $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@
##
@@ -73,7 +73,7 @@ hello_world_cmd() {
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
[[ ! -z $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
[[ -n $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@
##

View File

@@ -248,6 +248,8 @@ echo 'derp.dkr.ecr.us-east-1.amazonaws.com'
### `docker-args-build`
> Warning: Deprecated, please use `docker-args-process-build` instead
- Description:
- Invoked by: `internal function dokku_build() (build phase)`
- Arguments: `$APP $IMAGE_SOURCE_TYPE`
@@ -271,6 +273,8 @@ echo -n "$STDIN$output"
### `docker-args-deploy`
> Warning: Deprecated, please use `docker-args-process-deploy` instead
- Description:
- Invoked by: `dokku deploy`
- Arguments: `$APP $IMAGE_TAG [$PROC_TYPE $CONTAINER_INDEX]`
@@ -289,6 +293,8 @@ verify_app_name "$APP"
### `docker-args-run`
> Warning: Deprecated, please use `docker-args-process-run` instead
- Description:
- Invoked by: `dokku run`
- Arguments: `$APP $IMAGE_TAG`
@@ -305,6 +311,42 @@ verify_app_name "$APP"
# TODO
```
### `docker-args-process-deploy`
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options.
- Invoked by: `dokku deploy`
- Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE [$PROC_TYPE $CONTAINER_INDEX]`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
# TODO
```
### `docker-args-process-run`
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker run options.
- Invoked by: `dokku run`
- Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE [$PROC_TYPE $CONTAINER_INDEX]`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
# TODO
```
### `git-post-pull`
- Description:
@@ -559,6 +601,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `post-app-clone-setup`
- Description: Allows you to run commands after an app is setup, and before it is rebuild. This is useful for cleaning up tasks, or ensuring configuration from an old app is copied to the new app
- Invoked by: `dokku apps:clone`
- Arguments: `$OLD_APP_NAME $NEW_APP_NAME`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `post-app-rename`
- Description: Allows you to run commands after an app was renamed.
@@ -745,7 +802,7 @@ APP="$1"; verify_app_name "$APP"
TMP_WORK_DIR="$2"
REV="$3" # optional, may not be sent for tar-based builds
pushd "$TMP_WORK_DIR" > /dev/null
pushd "$TMP_WORK_DIR" >/dev/null
touch Procfile
echo "clock: some-command" >> Procfile
```
@@ -789,12 +846,12 @@ verify_app_name "$APP"
dokku_log_info1 "Installing $CONTAINER_PACKAGE..."
CMD="cat > gm && \
dpkg -s CONTAINER_PACKAGE > /dev/null 2>&1 || \
dpkg -s CONTAINER_PACKAGE >/dev/null 2>&1 || \
(apt-get update && apt-get install -y CONTAINER_PACKAGE && apt-get clean)"
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE > /dev/null
docker commit $ID $IMAGE >/dev/null
```
### `post-release-dockerfile`
@@ -904,7 +961,7 @@ verify_app_name "$APP"
dokku_log_info1 "Running gulp"
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $IMAGE /bin/bash -c "cd /app && gulp default")
test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null
docker commit $id $IMAGE >/dev/null
dokku_log_info1 "Building UI Complete"
```
@@ -980,12 +1037,12 @@ verify_app_name "$APP"
dokku_log_info1 "Installing GraphicsMagick..."
CMD="cat > gm && \
dpkg -s graphicsmagick > /dev/null 2>&1 || \
dpkg -s graphicsmagick >/dev/null 2>&1 || \
(apt-get update && apt-get install -y graphicsmagick && apt-get clean)"
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE > /dev/null
docker commit $ID $IMAGE >/dev/null
```
### `pre-release-dockerfile`
@@ -1137,11 +1194,27 @@ APP=${refname/*\//}.$reference_app
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
REFERENCE_REPO="$DOKKU_ROOT/$reference_app"
git clone --bare --shared --reference "$REFERENCE_REPO" "$REFERENCE_REPO" "$DOKKU_ROOT/$APP" > /dev/null
git clone --bare --shared --reference "$REFERENCE_REPO" "$REFERENCE_REPO" "$DOKKU_ROOT/$APP" >/dev/null
fi
plugn trigger receive-app $APP $newrev
```
### `resource-get-property`
- Description: Fetches a given resource property value
- Invoked by:
- Arguments: `$APP` `$PROC_TYPE` `$RESOURCE_TYPE` `$PROPERTY`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"; PROC_TYPE="$2" RESOURCE_TYPE="$3" PROPERTY="$4"
# TODO
```
### `retire-container-failed`
- Description: Allows you to run commands if/when retiring old containers has failed

View File

@@ -5,13 +5,12 @@ Dokku is released in intervals *at most* three weeks apart, though may be releas
To propose a release, the following tasks need to be performed:
```shell
export PACKAGECLOUD_API_TOKEN=SOME_TOKEN
export PACKAGECLOUD_TOKEN=SOME_TOKEN
# supports major/minor/patch/betafish
contrib/release
contrib/release-dokku
```
> If you are a maintainer and need the PACKAGECLOUD_API_TOKEN in order to make a release, please contact @josegonzalez to get this information.
> If you are a maintainer and need the PACKAGECLOUD_TOKEN in order to make a release, please contact @josegonzalez to get this information.
As well, the ArchLinux package description *must* be updated via `vagrant up build-arch` (needs to be done after the tag is pushed to GitHub, because it is based on that)
@@ -30,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.13.4-2 (Mon Feb 22 23:20:37 CET 2016)"
# wait for "==> build-arch: ==> Finished making: dokku 0.15.0-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

@@ -46,3 +46,39 @@ make deploy-test-nodejs-express
```
For a full list of test make targets check out `tests.mk` in the root of the Dokku repository.
## Executing a single test suite
When working on a particular plugin, it may be useful to run _only_ a particular test suite. This can be done by specifying the test suite path:
```shell
bats tests/unit/10_apps.bats
```
It is also possible to target multiple test suites at a time.
```shell
bats tests/unit/10_apps.bats tests/unit/10_certs.bats
```
## Executing a single test
In order to increase testing velocity, a wrapper script around bats is available that can be used to run a single testcase within a suite.
Tests within a suite may be listed by specifying the suite as a parameter to the `tests/bats-exec-test-single` script.
```shell
tests/bats-exec-test-single 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.
```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 the test names listed when no second character is invoked, so executing a test with a more specific name will work as expected.
```shell
tests/bats-exec-test-single tests/unit/10_apps.bats clone_-2d-2dskip-2ddeploy
```

View File

@@ -1,6 +1,6 @@
# Advanced installation
You can always install Dokku straight from the latest - potentially unstable - master release via the following bash command:
You can always install Dokku straight from the latest - potentially unstable - `master` branch via the following Bash command:
```shell
# using a branch results in installing from source
@@ -10,7 +10,7 @@ sudo DOKKU_BRANCH=master bash bootstrap.sh
## Development
If you plan on developing dokku, the easiest way to install from your own repository is cloning the repository and calling the install script. Example:
If you plan on developing Dokku, the easiest way to install from your own repository is cloning the repository and calling the install script. Example:
```shell
git clone https://github.com/yourusername/dokku.git
@@ -34,9 +34,9 @@ chmod +x bootstrap.sh
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
```
## Custom herokuish build
## Custom Herokuish build
Dokku ships with a pre-built version of version of the [herokuish](https://github.com/gliderlabs/herokuish) component by default. If you want to build your own version you can specify that with an env variable.
Dokku ships with a pre-built version of version of the [Herokuish](https://github.com/gliderlabs/herokuish) component by default. If you want to build your own version you can specify that with an environment variable.
```shell
git clone https://github.com/dokku/dokku.git
@@ -44,29 +44,29 @@ cd dokku
sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make install
```
## Skipping herokuish installation
## Skipping Herokuish installation
The `herokuish` package is recommended but not required if not using Heroku Buildpacks for deployment. Debian-based OS users can run the bootstrap installer via `sudo DOKKU_NO_INSTALL_RECOMMENDS=true bash bootstrap.sh` to skip the dependency. Please note that this will _also_ skip installation of other recommended dependencies.
The Herokuish package is recommended but not required if not using Heroku buildpacks for deployment. Debian-based OS users can run the bootstrap installer via `sudo DOKKU_NO_INSTALL_RECOMMENDS=true bash bootstrap.sh` to skip the dependency. Please note that this will _also_ skip installation of other recommended dependencies.
## Configuring an unattended installation
Once Dokku is installed, if you are not using the web-installer, you'll want to configure a the virtualhost setup as well as the push user. If you do not, your installation will be considered incomplete and you will not be able to deploy applications.
Once Dokku is installed, if you are not using the web-installer, you'll want to configure the virtualhost setup as well as the push user. If you do not, your installation will be considered incomplete and you will not be able to deploy applications.
For Debian, unattended installation is described [Debian installation guide](/docs/getting-started/install/debian.md).
*You should also stop and disable the `dokku-installer` service to remove public access to adding SSH keys.*
Set up a domain using your preferred vendor and a wildcard domain pointing to the host running dokku. You can manage this global domain using the [domains plugin](/docs/configuration/domains.md).
Set up a domain using your preferred vendor and a wildcard domain pointing to the host running Dokku. You can manage this global domain using the [domains plugin](/docs/configuration/domains.md).
Follow the [user management documentation](/docs/deployment/user-management.md) in order to add ssh keys for users to Dokku, or to give other Unix accounts access to Dokku.
Follow the [user management documentation](/docs/deployment/user-management.md) in order to add SSH keys for users to Dokku, or to give other Unix accounts access to Dokku.
## VMs with less than 1GB of memory
## VMs with less than 1 GB of memory
Having less than 1GB of system memory available for Dokku and its containers may result in unexpected errors, such as **! [remote rejected] master -> master (pre-receive hook declined)** during installation of NPM dependencies (https://github.com/npm/npm/issues/3867).
Having less than 1 GB of system memory available for Dokku and its containers may result in unexpected errors, such as `! [remote rejected] master -> master (pre-receive hook declined)` during installation of NPM dependencies (https://github.com/npm/npm/issues/3867).
To work around this issue, it might suffice to augment the linux swap file size to a maximum of twice the physical memory size.
To work around this issue, it might suffice to augment the Linux swap file size to a maximum of twice the physical memory size.
To resize the swap file of a 512MB machine to 1GB, follow these steps while in SSH within your machine:
To resize the swap file of a 512 MB machine to 1 GB, follow these steps while in SSH within your machine:
```shell
cd /var

View File

@@ -1,11 +1,11 @@
# Microsoft Azure
- If you don't already have one [generate an SSH key pair](https://help.github.com/articles/generating-ssh-keys/).
1. If you don't already have one [generate an SSH key pair](https://help.github.com/articles/generating-ssh-keys/).
- Go to the [Dokku on azure deployment page](https://github.com/azure/azure-quickstart-templates/tree/master/dokku-vm) and click **Deploy to Azure**.
2. Go to the [Dokku on Azure deployment page](https://github.com/azure/azure-quickstart-templates/tree/master/dokku-vm) and click **Deploy to Azure**.
- You'll be prompted to enter a few parameters, including a unique storage account name and a unique name for the sub-domain used for your public IP address. For the `sshKeyData` parameter, copy and paste the contents of the **public** key file you just created. After a few minutes the Dokku instance will be deployed.
3. You'll be prompted to enter a few parameters, including a unique storage account name and a unique name for the subdomain used for your public IP address. For the `sshKeyData` parameter, copy and paste the contents of the *public* key file you just created. After a few minutes the Dokku instance will be deployed.
- In your browser of choice, navigate to `http://[[dnsNameForPublicIP]].[[location]].cloudapp.azure.com`. Where `[[dnsNameForPublicIP]]` and `[[location]]` are template parameters you used to deploy the template.
4. In your browser of choice, navigate to `http://[dnsNameForPublicIP].[location].cloudapp.azure.com`. Where `[dnsNameForPublicIP]` and `[location]` are template parameters you used to deploy the template.
- Finish your Dokku setup like you normally would by creating a **new** public/private key pair for your deployments using `ssh-keygen` (don't use the same one as you created in the first step). You should select 'Use Virtual Host Naming' and set the `Hostname` to a **public dns name** that you own such as one you would purchase from [namecheap](http://namecheap.com). Alternatively thanks to [xip.io]( http://xip.io/) you can just use yourAzurePublicIP.xip.io for free. For example, if your public IP is `44.44.44.44` then you would set it to `44.44.44.44.xip.io`.
5. Finish your Dokku setup like you normally would by creating a *new* public/private key pair for your deployments using `ssh-keygen` (don't use the same one as you created in the first step). You should select **Use Virtual Host Naming** and set the **Hostname** to a *public DNS name* that you own such as one you would purchase from [Namecheap](http://namecheap.com). Alternatively thanks to [xip.io](http://xip.io/) you can just use `[yourAzurePublicIP].xip.io` for free. For example, if your public IP is `44.44.44.44` then you would set it to `44.44.44.44.xip.io`.

View File

@@ -1,28 +1,28 @@
# Debian Package Installation Notes
As of 0.3.18, Dokku defaults to being installed via debian package. While certain hosts may require extra work to get running, you may optionally wish to automate the installation of Dokku without the use of our `bootstrap.sh` bash script. The following are the steps run by said script:
As of 0.3.18, Dokku defaults to being installed via Debian package. While certain hosts may require extra work to get running, you may optionally wish to automate the installation of Dokku without the use of our `bootstrap.sh` Bash script. The following are the steps run by said script:
```shell
# install prerequisites
sudo apt-get update -qq > /dev/null
sudo apt-get update -qq >/dev/null
sudo apt-get install -qq -y apt-transport-https
# install docker
wget -nv -O - https://get.docker.com/ | sh
# install dokku
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")"
wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -
OS_ID="$(lsb_release -cs 2>/dev/null || echo "trusty")"
echo "trusty utopic vivid wily xenial yakkety zesty artful bionic" | grep -q "$OS_ID" || OS_ID="trusty"
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ ${OS_ID} main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq > /dev/null
sudo apt-get update -qq >/dev/null
sudo apt-get install -qq -y dokku
sudo dokku plugin:install-dependencies --core
```
## Unattended installation
In case you want to perform an unattended installation of dokku, this is made possible through [debconf](https://en.wikipedia.org/wiki/Debconf_%28software_package%29), which allows you to configure a package before installing it.
In case you want to perform an unattended installation of Dokku, this is made possible through [debconf](https://en.wikipedia.org/wiki/Debconf_%28software_package%29), which allows you to configure a package before installing it.
You can set any of the below options through the `debconf-set-selections` command, for example to enable vhost-based deployments:
@@ -37,7 +37,7 @@ After setting the desired options, proceed with the installation as described ab
| Name | Type | Default | Description |
| ------------------ | ------- | --------------------- | ------------------------------------------------------------------------ |
| dokku/web_config | boolean | true | Use web-based config for below options |
| dokku/vhost_enable | boolean | false | Use vhost-based deployments (e.g., <app>.dokku.me) |
| dokku/vhost_enable | boolean | false | Use vhost-based deployments (e.g. `[yourapp].dokku.me`) |
| dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
| dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. |
| dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) |

View File

@@ -1,22 +1,22 @@
# Digital Ocean Droplet
# DigitalOcean Droplet
[Digital Ocean](https://www.digitalocean.com/products/compute/) offers a pre-installed Dokku image. You can run this image on any sized droplet, although larger droplets will allow you to run larger applications.
[DigitalOcean](https://www.digitalocean.com/products/compute/) offers a pre-installed Dokku image. You can run this image on any sized Droplet, although larger Droplets will allow you to run larger applications.
> **Please disable IPv6**. There are known issues with IPv6 on Digital Ocean and Docker. If you would like to run Dokku on an IPv6 Digital Ocean Droplet, please consult [this guide](https://jeffloughridge.wordpress.com/2015/01/17/native-ipv6-functionality-in-docker/).
> **Please disable IPv6**. There are known issues with IPv6 on DigitalOcean and Docker. If you would like to run Dokku on an IPv6 DigitalOcean Droplet, please consult [this guide](https://jeffloughridge.wordpress.com/2015/01/17/native-ipv6-functionality-in-docker/).
1. Login to your [Digital Ocean](https://m.do.co/c/fe06b043a083) account
1. Login to your [DigitalOcean](https://m.do.co/c/fe06b043a083) account.
2. Click **Create a Droplet**.
3. Under **Choose an image > One-click apps** and choose the latest **Dokku** release for 16.04 _(version numbers may vary)_.
4. Under **Choose a size** and select your a machine spec. We recommend a machine with _at least_ 1GB of memory.
5. Under **Choose a datacenter region** select your region.
6. Add an SSH Key
3. Under **Choose an image > One-click apps**, choose the latest **Dokku** release for 16.04 _(version numbers may vary)_.
4. Under **Choose a size**, select your machine spec.
5. Under **Choose a datacenter region**, select your region.
6. Add an SSH Key.
* New Keys
1. Under **Add your SSH keys** click **New SSH Key** _(this opens a dialog)_
2. From your terminal, execute `cat $HOME/.ssh/id_rsa.pub`
3. Copy the output and paste it into the **New SSH Key** dialog, provide a name and click **Add SSH Key**
1. Under **Add your SSH keys** click **New SSH Key** _(this opens a dialog)_.
2. From your terminal, execute `cat $HOME/.ssh/id_rsa.pub`.
3. Copy the output and paste it into the **New SSH Key** dialog, provide a name and click **Add SSH Key**.
* Existing Keys
1. Simply add a checkmark next to the existing keys you'd like to add.
7. Under **Finalize and create**, give your droplet a hostname _(not required)_ and click **Create**.
7. Under **Finalize and create**, give your Droplet a hostname _(not required)_ and click **Create**.
8. Once created, copy the IP address to your clipboard.
9. In a browser, go to the IP address you copied above and fill out the presented form to complete configuration. **Failure to do so may allow others to reconfigure SSH access on your server.**
10. Once the web ui has been submitted, you will be redirected to our [application deployment tutorial](/docs/deployment/application-deployment.md), which will guide you through deploying a sample application to your Dokku server.
9. In a browser, go to the IP address you copied above and fill out the presented form to complete configuration. _Failure to do so may allow others to reconfigure SSH access on your server._
10. Once the web UI has been submitted, you will be redirected to our [application deployment tutorial](/docs/deployment/application-deployment.md), which will guide you through deploying a sample application to your Dokku server.

View File

@@ -5,9 +5,9 @@ Dreamhost (or any other OpenStack-compatible cloud with minimal
changes).
A new server instance can be created on DreamHost Cloud from the command line
using openstack client or from the web UI and with the same command
use a cloud-init script to install Dokku. Install the [openstack
cli](https://help.dreamhost.com/hc/en-us/articles/216185658-How-to-Install-the-OpenStack-command-line-clients),
using OpenStack client or from the web UI and with the same command
use a cloud-init script to install Dokku. Install the [OpenStack
CLI](https://help.dreamhost.com/hc/en-us/articles/216185658-How-to-Install-the-OpenStack-command-line-clients),
download the [DreamHost Cloud credentials
file](https://iad2.dreamcompute.com/project/access_and_security/api_access/openrc/)
before proceeding and make sure your public SSH key is added to the
@@ -17,10 +17,10 @@ cloud.
source openrc.sh # Set the environment variables for DreamHost Cloud
```
This allows openstack client to connect to DreamHost API endpoints.
This allows OpenStack client to connect to DreamHost API endpoints.
The command below creates a new server instance named `my-dokku-instance`
based on Ubuntu 14.04, with 2GB RAM and 1CPU (the flavor called
`supersonic`), opening network port access to http and ssh (the
based on Ubuntu 14.04, with 2 GB RAM and 1 CPU (the flavor called
`supersonic`), opening network port access to HTTP and SSH (the
`default` security group), and the name of the chosen SSH key. This
key will be automatically added to the new server in the
`authorized_keys` for the default SSH user (`ubuntu`), and it will
@@ -185,13 +185,11 @@ packages:
```
Shortly after running the create command you will get a confirmation that the
instance has been created, and after about a minute it should be ready to login.
Check the IP of the instance through the web UI or by running:
instance has been created, and after about a minute it should be ready to login. Check the IP of the instance through the web UI or by running:
```sh
nova list
```
SSH with the `ubuntu` username and the public key previously added.
Keep in mind that if you logged in quick enough dokku might still be installing
in the background, and not be ready. The installation takes a few minutes.
Keep in mind that if you logged in quick enough Dokku might still be installing in the background, and not be ready. The installation takes a few minutes.

View File

@@ -4,7 +4,7 @@
>**Warning:** Web installer is not available on CentOS. You will need to configure [SSH keys](/docs/deployment/user-management.md#adding-ssh-keys) and [virtual hosts](/docs/configuration/domains.md#customizing-hostnames) using dokku command line interface.
Dokku defaults to being installed via RPM package on CentOS 7. While certain hosts may require extra work to get running, you may optionally wish to automate the installation of Dokku without the use of our `bootstrap.sh` bash script. The following are the steps run by said script:
Dokku defaults to being installed via RPM package on CentOS 7. While certain hosts may require extra work to get running, you may optionally wish to automate the installation of Dokku without the use of our `bootstrap.sh` Bash script. The following are the steps run by said script:
```shell
# Install docker

View File

@@ -1,14 +1,16 @@
# Install Dokku using Vagrant
- Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
- Download and install [Vagrant](http://www.vagrantup.com/downloads.html)
- Clone Dokku
1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
2. Download and install [Vagrant](http://www.vagrantup.com/downloads.html).
3. Clone Dokku.
```shell
git clone https://github.com/dokku/dokku.git
```
- Create VM
4. Create VM.
```shell
# Optional ENV arguments:
@@ -27,18 +29,17 @@
vagrant up dokku-windows
```
- Setup SSH Config in `~/.ssh/config`.
5. Setup SSH Config in `~/.ssh/config`.
```ini
Host dokku.me
Port 22
```
> For users that have customized the IP address of their VM - either in a custom `Vagrantfile` or via the `DOKKU_IP` environment variable - and are not using `10.0.0.2` for the Vagrant IP, you'll need to instead use the output of `vagrant ssh-config dokku` for your ~/.ssh/config entry.
> For users that have customized the IP address of their VM - either in a custom `Vagrantfile` or via the `DOKKU_IP` environment variable - and are not using `10.0.0.2` for the Vagrant IP, you'll need to instead use the output of `vagrant ssh-config dokku` for your `~/.ssh/config` entry.
- Copy your SSH key via `cat ~/.ssh/id_rsa.pub | pbcopy` and paste it into the dokku-installer at http://dokku.me . Change the `Hostname` field on the Dokku Setup screen to your domain and then check the box that says `Use virtualhost naming`. Then click *Finish Setup* to install your key. You'll be directed to application deployment instructions from here.
6. Copy your SSH key via `cat ~/.ssh/id_rsa.pub | pbcopy` and paste it into the dokku-installer at http://dokku.me . Change the `Hostname` field on the Dokku Setup screen to your domain and then check the box that says **Use virtualhost naming**. Then click **Finish Setup** to install your key. You'll be directed to application deployment instructions from here.
Please note, the `dokku.me` domain is setup to point to `10.0.0.2` along with all subdomains (ie yourapp.dokku.me). If you change the `DOKKU_IP` in your vagrant setup you'll need to update your `/etc/hosts` file to point your reconfigured ip address.
Please note, the `dokku.me` domain is setup to point to `10.0.0.2` along with all subdomains (i.e. `yourapp.dokku.me`). If you change the `DOKKU_IP` in your Vagrant setup you'll need to update your `/etc/hosts` file to point your reconfigured IP address.
You are now ready to deploy an app or install plugins.

View File

@@ -7,7 +7,7 @@ Dokku is an extensible, open source Platform as a Service that runs on a single
To start using Dokku, you'll need a system that meets the following minimum requirements:
- A fresh installation of [Ubuntu 16.04 x64](https://www.ubuntu.com/download), [Ubuntu 14.04 x64](https://www.ubuntu.com/download), [Debian 8.2 x64](https://www.debian.org/distrib/) or [CentOS 7 x64](https://www.centos.org/download/) *(experimental)* with the FQDN set <sup>[1]</sup>
- At least `1GB` of system memory <sup>[2]</sup>
- At least 1 GB of system memory <sup>[2]</sup>
You can *optionally* have a domain name pointed at the host's IP, though this is not necessary.
@@ -15,19 +15,19 @@ Dokku is designed for usage on a fresh VM installation, and should install all n
### Installing the latest stable version
#### 1. Install dokku
#### 1. Install Dokku
To install the latest stable version of dokku, you can run the following shell commands:
To install the latest stable version of Dokku, you can run the following shell commands:
```shell
# for debian systems, installs Dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.4/bootstrap.sh;
sudo DOKKU_TAG=v0.13.4 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.15.0/bootstrap.sh;
sudo DOKKU_TAG=v0.15.0 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.
If you're using Debian 8 or Ubuntu 14.04, make sure your package manager is configured to install a sufficiently recent version of nginx<sup>[3]</sup>, otherwise, the installation may fail due to "unmet dependencies" relating nginx.
If you're using Debian 8 or Ubuntu 14.04, make sure your package manager is configured to install a sufficiently recent version of nginx<sup>[3]</sup>, otherwise, the installation may fail due to `unmet dependencies` relating nginx.
#### 2. Setup SSH key and Virtualhost Settings
@@ -47,11 +47,11 @@ Once you save your settings, the web admin will self-terminate and you should be
For various reasons, certain hosting providers may have other steps that should be preferred to the above. If hosted on any of the following popular hosts, please follow the linked to instructions:
- [Digital Ocean Installation Notes](/docs/getting-started/install/digitalocean.md)
- [DigitalOcean Installation Notes](/docs/getting-started/install/digitalocean.md)
- [DreamHost Cloud Installation Notes](/docs/getting-started/install/dreamhost.md)
- [Microsoft Azure Installation Notes](/docs/getting-started/install/azure.md)
As well, you may wish to customize your installation in some other fashion. or experiment with vagrant. The guides below should get you started:
As well, you may wish to customize your installation in some other fashion. or experiment with Vagrant. The guides below should get you started:
- [Debian Package Installation Notes](/docs/getting-started/install/debian.md)
- [RPM Package Installation Notes](/docs/getting-started/install/rpm.md)

View File

@@ -1,6 +1,6 @@
# Troubleshooting
__Symptom:__ I deployed my app but I am getting the default nginx page
__Symptom:__ I deployed my app but I am getting the default nginx page.
__Solution:__
@@ -11,7 +11,7 @@ nginx -t
## nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
```
If you get a similar error just edit __/etc/nginx/nginx.conf__ and add the following line to your http section:
If you get a similar error just edit `/etc/nginx/nginx.conf` and add the following line to your `http` section:
```nginx
http {
@@ -35,7 +35,7 @@ Save the file and try stopping nginx and starting it again:
***
__Symptom:__ I want to deploy my app, but while pushing I get the following error
__Symptom:__ I want to deploy my app, but while pushing I get the following error.
! [remote rejected] master -> master (pre-receive hook declined)
@@ -50,30 +50,30 @@ To enable Dokku tracing, simply run the following command:
dokku trace on
```
In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following :
In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following:
```shell
export DOKKU_TRACE=1
```
This will trace all of dokku's activity. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue.
This will trace all of Dokku's activity. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue.
***
__Symptom:__ I get the aforementioned error in the build phase (after turning on Dokku tracing)
__Symptom:__ I get the aforementioned error in the build phase (after turning on Dokku tracing).
Most errors that happen in this phase are due to transient network issues (either locally or remotely) buildpack bugs.
Most errors that happen in this phase are due to transient network issues (either locally or remotely) buildpack bugs.
__Solution (Less solution, more helpful troubleshooting steps):__
Find the failed phase's container image (*077581956a92* in this example)
Find the failed phase's container image (`077581956a92` in this example).
```shell
docker ps -a | grep build
## 94d9515e6d93 077581956a92 "/build" 29 minutes ago Exited (0) 25 minutes ago cocky_bell
```
Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known)
Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known).
```shell
docker run -ti 077581956a92 /bin/bash
@@ -84,38 +84,37 @@ tar tzf node-v0.10.30-linux-x64.tar.gz
## ...
```
Sometimes (especially on DO) deploying again seems to get past these seemingly transient issues
Additionally we've seen issues if changing networks that have different DNS resolvers. In this case, you can run the following to update your resolv.conf
Sometimes (especially on DigitalOcean) deploying again seems to get past these seemingly transient issues. Additionally we've seen issues if changing networks that have different DNS resolvers. In this case, you can run the following to update your `resolv.conf`.
```shell
resolvconf -u
```
Please see https://github.com/dokku/dokku/issues/841 and https://github.com/dokku/dokku/issues/649
Please see https://github.com/dokku/dokku/issues/841 and https://github.com/dokku/dokku/issues/649.
***
__Symptom:__ I want to deploy my app but I am getting asked for the password of the git user and the error message
__Symptom:__ I want to deploy my app but I am getting asked for the password of the Git user and the error message.
fatal: 'NAME' does not appear to be a git repository
fatal: Could not read from remote repository.
__Solution:__
You get asked for a password because your ssh secret key can't be found. This may happen if the private key corresponding to the public key you added with `sshcommand acl-add` is not located in the default location `~/.ssh/id_rsa`.
You get asked for a password because your SSH secret key can't be found. This may happen if the private key corresponding to the public key you added with `sshcommand acl-add` is not located in the default location `~/.ssh/id_rsa`.
You have to point ssh to the correct secret key for your domain name. Add the following to your `~/.ssh/config`:
You have to point SSH to the correct secret key for your domain name. Add the following to your `~/.ssh/config`:
```ini
Host DOKKU_HOSTNAME
IdentityFile "~/.ssh/KEYNAME"
```
Also see [issue #116](https://github.com/dokku/dokku/issues/116)
Also see [issue #116](https://github.com/dokku/dokku/issues/116).
***
__Symptom:__ I successfully deployed my application with no deployment errors and receiving Bad Gateway when attempting to access the application
__Symptom:__ I successfully deployed my application with no deployment errors and receiving **Bad Gateway** when attempting to access the application.
__Solution:__
@@ -127,11 +126,11 @@ When specifying your port you may want to use something similar to:
var port = process.env.PORT || 3000
```
Please see https://github.com/dokku/dokku/issues/282
Please see https://github.com/dokku/dokku/issues/282.
***
__Symptom:__ Deployment fails because of slow internet connection, messages shows `gzip: stdin: unexpected end of file`
__Symptom:__ Deployment fails because of slow internet connection, messages shows `gzip: stdin: unexpected end of file`.
__Solution:__
@@ -146,16 +145,16 @@ If you see output similar this when deploying:
! tar: Error is not recoverable: exiting now
```
it might that the curl command that is supposed to fetch the buildpack (anything in the low megabyte file size range) takes too long to finish, due to slowish connection. To overwrite the default values (connection timeout: 90 seconds, total maximum time for operation: 600 seconds), set the following environment variables:
it might that the cURL command that is supposed to fetch the buildpack (anything in the low megabyte file size range) takes too long to finish, due to slowish connection. To overwrite the default values (connection timeout: 90 seconds, total maximum time for operation: 600 seconds), set the following environment variables:
```shell
dokku config:set --global CURL_TIMEOUT=1200
dokku config:set --global CURL_CONNECT_TIMEOUT=180
```
Please see https://github.com/dokku/dokku/issues/509
Please see https://github.com/dokku/dokku/issues/509.
Another reason for this error (although it may respond immediately ruling out a timeout issue) may be because you've set the config setting `SSL_CERT_FILE`. Using a config setting with this key interferes with the buildpack's ability to download it's dependencies, so you must rename the config setting to something else, e.g. `MY_APP_SSL_CERT_FILE`.
Another reason for this error (although it may respond immediately ruling out a timeout issue) may be because you've set the config setting `SSL_CERT_FILE`. Using a config setting with this key interferes with the buildpack's ability to download its dependencies, so you must rename the config setting to something else, e.g. `MY_APP_SSL_CERT_FILE`.
***
@@ -163,7 +162,7 @@ __Symptom:__ Build fails with `Killed` message.
__Solution:__
This generally occurs when the server runs out of memory. You can either add more ram to your server or setup swap space. The follow script will create 2gb of swap space.
This generally occurs when the server runs out of memory. You can either add more RAM to your server or setup swap space. The follow script will create 2 GB of swap space.
```shell
sudo install -o root -g root -m 0600 /dev/null /swapfile
@@ -181,13 +180,13 @@ __Symptom:__ I successfully deployed my application with no deployment errors bu
__Solution:__
This can occur if Dokku is running on a system with a firewall like ufw enabled (some OS versions like Ubuntu 16.04 have this enabled by default). You can check if this is your case by running the following script:
This can occur if Dokku is running on a system with a firewall like UFW enabled (some OS versions like Ubuntu 16.04 have this enabled by default). You can check if this is your case by running the following script:
```shell
sudo ufw status
```
If the previous script returned `Status: active` and a list of ports, ufw is enabled and is probably the cause of the symptom described above. To disable it, run:
If the previous script returned `Status: active` and a list of ports, UFW is enabled and is probably the cause of the symptom described above. To disable it, run:
```shell
sudo ufw disable
@@ -201,6 +200,6 @@ __Solution:__
This isn't usually an issue with Dokku, but rather an app config problem. This can happen when your application is configured to enforce secure connections/HSTS, but you don't have SSL set up for the app.
In Rails at least, if your `application.rb` or `environmnents/production.rb` include the line `configure.force_ssl = true`, which includes HSTS try commenting that out and redeploying.
In Rails at least, if your `application.rb` or `environmnents/production.rb` include the line `configure.force_ssl = true` which includes HSTS, try commenting that out and redeploying.
If this solves the issue temporarily, longer term you should consider [configuring SSL](http://dokku.viewdocs.io/dokku/configuration/ssl/).

View File

@@ -4,7 +4,7 @@ If your version of Dokku is pre 0.3.0 (check with `dokku version`), we recommend
## Security Updates
For any security related updates, please follow our [twitter account](https://twitter.com/dokku). As Dokku does not run any daemons, the security risk introduced by our software is minimal.
For any security related updates, please follow our [Twitter account](https://twitter.com/dokku). As Dokku does not run any daemons, the security risk introduced by our software is minimal.
Your operating system may occasionally provide security updates. We recommend setting unattended upgrades for your operating system. Here are some helpful links:
@@ -101,7 +101,7 @@ sudo make install
dokku ps:rebuildall # rebuilds all applications
```
To upgrade herokuish from source, upgrade with:
To upgrade Herokuish from source, upgrade with:
```shell
cd /tmp

View File

@@ -6,7 +6,7 @@ If you’re stuck, there are a number of places you can get help:
- [http://dokku.viewdocs.io/dokku/](/docs/)
The Official Dokku website is always a great place to visit. It features links to oft-used developer tools, community plugins, and guides on using dokku.
The Official Dokku website is always a great place to visit. It features links to oft-used developer tools, community plugins, and guides on using Dokku.
## The IRC and Slack Channels

View File

@@ -10,32 +10,61 @@
<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.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.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.15.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.15.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.15.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.15.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.15.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.15.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.15.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.15.0/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.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.15.0/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/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.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/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.rawgit.com/dokku/dokku/v0.13.4/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<style>
.sponsors {
background-color: #272822;
color: #FCFCFC;
}
.sponsors a {
color: #f0ad4e;
}
.sponsors .backer img,
.sponsors .sponsor img {
-webkit-border-radius: 3px;
border-radius: 3px;
border: 8px solid gray;
margin: 20px auto 20px auto;
max-width: 192px;
}
.sponsors .backer img {
-webkit-border-radius: 50%;
border-radius: 50%;
border: 0;
}
.sponsors img:hover {
-moz-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
-webkit-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 32px 0px rgba(0,0,0,0.75);
}
.sponsors .fund-link {
display: block;
font-size: .8em;
}
</style>
</head>
<body>
@@ -98,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.13.4/bootstrap.sh</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.15.0/bootstrap.sh</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.13.4 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.15.0 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>
@@ -125,7 +154,7 @@
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -</span>
<span class="command">wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -</span>
</p>
<p class="line">
<span class="path"></span>
@@ -135,7 +164,7 @@
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">export OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")"</span>
<span class="command">export OS_ID="$(lsb_release -cs 2>/dev/null || echo "trusty")"</span>
</p>
<p class="line">
<span class="path"></span>
@@ -236,40 +265,54 @@
</div>
</div>
<div class="container-fluid slack-channel team-members">
<h3>Meet the core team</h3>
<div class="container-fluid slack-channel sponsors">
<h3>Sponsor Dokku</h3>
<div class="row">
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-2 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/progrium-hidden.jpg" alt="Jeff Lindsay">
<img src="./assets/team/progrium.jpg" alt="Jeff Lindsay">
</div>
Jeff Lindsay
<a class="fund-link" href="https://www.patreon.com/progrium">Sponsor people they sponsor</a>
</div>
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-0 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/josegonzalez-hidden.jpg" alt="Morris Jobke">
<img src="./assets/team/josegonzalez.jpg" alt="Morris Jobke">
</div>
Jose Diaz-Gonzalez
<a class="fund-link" href="http://www.amazon.com/registry/wishlist/36RYHSXCFYDTG/">Buy him something nice</a>
</div>
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-2 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/michaelshobbs-hidden.jpg" alt="Michael Hobbs">
<img src="./assets/team/michaelshobbs.jpg" alt="Michael Hobbs">
</div>
Michael Hobbs
<a class="fund-link" href="https://gratipay.com/~michaelshobbs/">Fund on gratipay</a>
<div class="col-md-12">
<p>Here are a few of our sponsors and backers. Join them and <a href="https://opencollective.com/dokku#sponsor" target="_blank">become a sponsor</a> on OpenCollective!</p>
<p class="sponsor">
<a href="https://opencollective.com/dokku/sponsor/0/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/0/avatar.svg" style="max-width: 192px"></a>
<a href="https://opencollective.com/dokku/sponsor/1/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/1/avatar.svg" style="max-width: 192px"></a>
<a href="https://opencollective.com/dokku/sponsor/2/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/2/avatar.svg" style="max-width: 192px"></a>
<a href="https://opencollective.com/dokku/sponsor/3/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/3/avatar.svg" style="max-width: 192px"></a>
</p>
<p class="backer">
<a href="https://opencollective.com/dokku/backer/0/website" target="_blank"><img src="https://opencollective.com/dokku/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/1/website" target="_blank"><img src="https://opencollective.com/dokku/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/2/website" target="_blank"><img src="https://opencollective.com/dokku/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/3/website" target="_blank"><img src="https://opencollective.com/dokku/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/4/website" target="_blank"><img src="https://opencollective.com/dokku/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/5/website" target="_blank"><img src="https://opencollective.com/dokku/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/6/website" target="_blank"><img src="https://opencollective.com/dokku/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/7/website" target="_blank"><img src="https://opencollective.com/dokku/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/8/website" target="_blank"><img src="https://opencollective.com/dokku/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/9/website" target="_blank"><img src="https://opencollective.com/dokku/backer/9/avatar.svg"></a>
</p>
<p class="backer">
<a href="https://opencollective.com/dokku/backer/10/website" target="_blank"><img src="https://opencollective.com/dokku/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/11/website" target="_blank"><img src="https://opencollective.com/dokku/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/12/website" target="_blank"><img src="https://opencollective.com/dokku/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/13/website" target="_blank"><img src="https://opencollective.com/dokku/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/14/website" target="_blank"><img src="https://opencollective.com/dokku/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/15/website" target="_blank"><img src="https://opencollective.com/dokku/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/16/website" target="_blank"><img src="https://opencollective.com/dokku/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/17/website" target="_blank"><img src="https://opencollective.com/dokku/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/18/website" target="_blank"><img src="https://opencollective.com/dokku/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/19/website" target="_blank"><img src="https://opencollective.com/dokku/backer/19/avatar.svg"></a>
</p>
<p>You can also <a href="https://www.patreon.com/dokku" target="_blank">back us anonymously</a> on Patreon.</p>
</div>
</div>
</div>
<div class="container">
<footer>
<p>&copy; 2013-2018 Dokku</p>
<p>&copy; 2013-2019 Dokku</p>
</footer>
</div>
<script>

View File

@@ -85,7 +85,7 @@ CONTAINER ID IMAGE COMMAND CREATED
d6499edb0edb dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute 0.0.0.0:49153->5000/tcp node-js-app.web.1
```
### Displaying network reports about an app
### Displaying network reports for an app
You can get a report about the app's network status using the `network:report` command:

View File

@@ -19,7 +19,7 @@ In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into
From Dokku versions `0.5.0` until `0.11.0`, enabling or disabling an application's proxy would **also** control whether or not the application was bound to all interfaces - e.g. `0.0.0.0`. As of `0.11.0`, this is now controlled by the network plugin. Please see the [network documentation](/docs/networking/network.md#container-network-interface-binding) for more information.
### Displaying proxy reports about an app
### Displaying proxy reports for an app
> New as of 0.8.1

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.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.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.15.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.15.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.15.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.15.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.15.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.15.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.15.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.15.0/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.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.15.0/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/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.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.13.4/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/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.rawgit.com/dokku/dokku/v0.13.4/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.0/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>
@@ -121,7 +121,7 @@
<a href="/{{NAME}}/deployment/application-management/" class="list-group-item">Application Management</a>
<a href="/{{NAME}}/deployment/logs/" class="list-group-item">Application Logs</a>
<a href="/{{NAME}}/deployment/remote-commands/" class="list-group-item">Remote Commands</a>
<a href="/{{NAME}}/deployment/one-off-processes/" class="list-group-item">One Off Processes/Cron</a>
<a href="/{{NAME}}/deployment/one-off-processes/" class="list-group-item">One-Off Processes/Cron</a>
<a href="/{{NAME}}/deployment/process-management/" class="list-group-item">Process Scaling</a>
<a href="/{{NAME}}/deployment/user-management/" class="list-group-item">User Management</a>
<a href="/{{NAME}}/deployment/zero-downtime-deploys/" class="list-group-item">Zero Downtime Deploy Checks</a>

50
dokku
View File

@@ -31,7 +31,10 @@ export DOKKU_HOST_ROOT=${DOKKU_HOST_ROOT:=$DOKKU_ROOT}
export DOKKU_DISTRO
# shellcheck disable=SC1091
DOKKU_DISTRO=$(. /etc/os-release > /dev/null 2>&1 || true ; echo "$ID")
DOKKU_DISTRO=$(
. /etc/os-release >/dev/null 2>&1 || true
echo "$ID"
)
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
@@ -63,6 +66,9 @@ skip_arg=false
if [[ "${args[0]}" =~ ^--.* ]]; then
for arg in "$@"; do
$skip_arg && skip_arg=false && continue
if [[ "$arg" == "--version" ]]; then
continue
fi
if [[ "$arg" == "--app" ]]; then
shift 2 && skip_arg=true
elif [[ "$arg" =~ ^--.* ]]; then
@@ -103,7 +109,7 @@ if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
fi
fi
if ! dokku_auth "$@" ; then
if ! dokku_auth "$@"; then
dokku_log_fail "Access denied"
exit 1
fi
@@ -112,27 +118,28 @@ execute_dokku_cmd() {
declare desc="executes dokku sub-commands"
local PLUGIN_NAME="$1"
local PLUGIN_CMD=$PLUGIN_NAME
local implemented=0; local script
local implemented=0
local script
local argv=("$@")
case "$PLUGIN_NAME" in
events|events:*)
events | events:*)
local PLUGIN_NAME=${PLUGIN_NAME/events/20_events}
;;
nginx|nginx:*)
nginx | nginx:*)
local PLUGIN_NAME=${PLUGIN_NAME/nginx/nginx-vhosts}
;;
deploy|delete|ls|run|cleanup)
deploy | delete | ls | run | cleanup)
local PLUGIN_NAME="00_dokku-standard"
;;
trace|url|urls|report|version)
trace | url | urls | report)
local PLUGIN_NAME="00_dokku-standard"
;;
esac
if [[ "$(readlink -f "$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}")" == *core-plugins* ]] ; then
if [[ "$(readlink -f "$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}")" == *core-plugins* ]]; then
[[ ${argv[0]} == "$PLUGIN_CMD" ]] && shift 1
if [[ ! -z $DOKKU_APP_NAME ]]; then
if [[ -n $DOKKU_APP_NAME ]]; then
if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then
shift 1
set -- "--no-restart" "$DOKKU_APP_NAME" "$@"
@@ -154,9 +161,12 @@ execute_dokku_cmd() {
implemented=1
fi
if [[ $implemented -eq 0 ]];then
if [[ $implemented -eq 0 ]]; then
for script in $PLUGIN_ENABLED_PATH/*/commands; do
set +e; $script "$@" ; exit_code=$? ; set -e
set +e
$script "$@"
exit_code=$?
set -e
if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
continue
fi
@@ -175,18 +185,18 @@ execute_dokku_cmd() {
}
case "$1" in
help|'')
help | '')
export LC_ALL=C # so sort will respect non alpha characters
ALL_PLUGIN_COMMANDS=$(find -L "$PLUGIN_PATH/enabled" -name commands 2> /dev/null || true)
ALL_PLUGIN_COMMANDS=$(find -L "$PLUGIN_PATH/enabled" -name commands 2>/dev/null || true)
# build list of core plugin command files
for plugin_command in $ALL_PLUGIN_COMMANDS;do
for plugin_command in $ALL_PLUGIN_COMMANDS; do
if [[ "$(readlink -f "$plugin_command")" == *core-plugins* ]]; then
CORE_PLUGIN_COMMANDS+="$plugin_command "
fi
done
# build list of non-core plugin command files
for plugin_command in $ALL_PLUGIN_COMMANDS;do
for plugin_command in $ALL_PLUGIN_COMMANDS; do
if [[ "$(readlink -f "$plugin_command")" != *core-plugins* ]]; then
COMMUNITY_PLUGIN_COMMANDS+="$plugin_command "
fi
@@ -200,7 +210,7 @@ case "$1" in
dokku_log_quiet "Commands:"
dokku_log_quiet ""
if [[ "$2" == "--all" ]] ; then
if [[ "$2" == "--all" ]]; then
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
$core_plugin_command help
done | sort | column -c2 -t -s,
@@ -213,7 +223,7 @@ case "$1" in
else
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
$core_plugin_command help
# When done, sort, sed cuts arugments out of strings and colum make it pretty
# When done, sort, sed cuts arugments out of strings and colum make it pretty
done | sort | sed -e '/^.*:/d' -e 's/\s[\[\<\-\(].*,/,/' | column -c2 -t -s,
if [[ -n "$COMMUNITY_PLUGIN_COMMANDS" ]]; then
dokku_log_quiet ""
@@ -226,6 +236,12 @@ case "$1" in
fi
;;
version | -v | --version)
test -f "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version"
DOKKU_VERSION=$(cat "${DOKKU_ROOT}/VERSION")
echo "dokku version ${DOKKU_VERSION}"
;;
*)
execute_dokku_cmd "$@"
;;

35
package.mk Normal file
View File

@@ -0,0 +1,35 @@
/tmp/build-dokku/var/lib/dokku/GIT_REV:
mkdir -p /tmp/build-dokku
mkdir -p /tmp/build-dokku/usr/share/bash-completion/completions
mkdir -p /tmp/build-dokku/usr/bin
mkdir -p /tmp/build-dokku/usr/share/doc/dokku
mkdir -p /tmp/build-dokku/usr/share/dokku/contrib
mkdir -p /tmp/build-dokku/usr/share/lintian/overrides
mkdir -p /tmp/build-dokku/usr/share/man/man1
mkdir -p /tmp/build-dokku/var/lib/dokku/core-plugins/available
cp dokku /tmp/build-dokku/usr/bin
cp LICENSE /tmp/build-dokku/usr/share/doc/dokku/copyright
cp contrib/bash-completion /tmp/build-dokku/usr/share/bash-completion/completions/dokku
find . -name ".DS_Store" -depth -exec rm {} \;
$(MAKE) go-build
cp common.mk /tmp/build-dokku/var/lib/dokku/core-plugins/common.mk
cp -r plugins/* /tmp/build-dokku/var/lib/dokku/core-plugins/available
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do cd /tmp/build-dokku/var/lib/dokku/core-plugins/available/$$plugin && if [ -e Makefile ]; then $(MAKE) src-clean; fi; done
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build-dokku/var/lib/dokku/core-plugins/available/$$plugin/.core; done
rm /tmp/build-dokku/var/lib/dokku/core-plugins/common.mk
$(MAKE) help2man
$(MAKE) addman
cp /usr/local/share/man/man1/dokku.1 /tmp/build-dokku/usr/share/man/man1/dokku.1
gzip -9 /tmp/build-dokku/usr/share/man/man1/dokku.1
cp contrib/dokku-installer.py /tmp/build-dokku/usr/share/dokku/contrib
ifeq ($(DOKKU_VERSION),master)
git describe --tags > /tmp/build-dokku/var/lib/dokku/VERSION
else
echo $(DOKKU_VERSION) > /tmp/build-dokku/var/lib/dokku/VERSION
endif
ifdef DOKKU_GIT_REV
echo "$(DOKKU_GIT_REV)" > /tmp/build-dokku/var/lib/dokku/GIT_REV
else
git rev-parse HEAD > /tmp/build-dokku/var/lib/dokku/GIT_REV
endif

View File

@@ -1,13 +1,14 @@
#!/usr/bin/env bash
[[ " help help:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
case "$1" in
help|run:help|trace:help|url:help|urls:help|version:help)
help | run:help | trace:help | url:help | urls:help | version:help)
[[ $(echo "$1" | sed '/.*:help/!d') ]] && help_topic="${1%\:help}"
help_content_func () {
help_content_func() {
declare desc="return standard plugin help content"
cat<<help_content
cat <<help_content
run <app> <cmd>, Run a command in a new container using the current application image
trace [on/off], Enable dokku tracing
url <app>, Show the first URL for an application (compatibility)
@@ -17,10 +18,10 @@ case "$1" in
help_content
}
if [[ $help_topic ]] ; then
help_content_func | sed "/^\s*$help_topic\s/!d" | sort | sed '/^.*:/d' | column -c2 -t -s,
if [[ $help_topic ]]; then
help_content_func | sed "/^\s*$help_topic\s/!d" | sort | sed '/^.*:/d' | column -c2 -t -s,
else
help_content_func
help_content_func
fi
;;

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/config/functions"
app_user_docker_args() {

View File

@@ -1,102 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
get_phase_script() {
declare desc="extracts app.json from app image and returns the appropriate json key/value"
local IMAGE="$1"; local PHASE_SCRIPT_KEY="$2"
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_get_phase_script.XXXX")
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
trap 'rm -rf "$GET_PHASE_SCRIPT_TMP_WORK_DIR" > /dev/null' RETURN INT TERM
copy_from_image "$IMAGE" "app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true
if [[ -f "$APP_JSON_FILE" ]];then
local VALUE=$(get_json_value "scripts.dokku.${PHASE_SCRIPT_KEY}" < "$APP_JSON_FILE")
else
return 0
fi
echo "$VALUE"
}
execute_script() {
declare desc="executes appropriate phase script key from app.json"
local APP="$1"; local IMAGE_TAG="$2"; local PHASE_SCRIPT_KEY="$3"
local IMAGE id
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
local SCRIPT_CMD=$(get_phase_script "$IMAGE" "$PHASE_SCRIPT_KEY" 2>/dev/null)
if [[ -n "$SCRIPT_CMD" ]];then
dokku_log_info1 "Running '$SCRIPT_CMD' in app container"
local COMMAND
COMMAND="set -eo pipefail; [[ \$DOKKU_TRACE ]] && set -x ; "
COMMAND+=" if [[ -d '/app' ]]; then "
COMMAND+=" export HOME=/app ; "
COMMAND+=" cd \$HOME ; "
COMMAND+=" fi ; "
COMMAND+=" if [[ -d '/app/.profile.d' ]]; then "
COMMAND+=" for file in /app/.profile.d/*; do source \$file; done ; "
COMMAND+=" fi ; "
COMMAND+=" if [[ -d '/cache' ]]; then "
COMMAND+=" echo restoring installation cache... ; "
COMMAND+=" rm -rf /tmp/cache ; "
COMMAND+=" ln -sf /cache /tmp/cache ; "
COMMAND+=" fi ; "
if [[ "$SCRIPT_CMD" == /* ]]; then
local SCRIPT_BIN="$(echo "$SCRIPT_CMD" | cut -d' ' -f1)"
COMMAND+=" if [[ ! -x \"$SCRIPT_BIN\" ]]; then "
COMMAND+=" echo specified binary is not executable ; "
COMMAND+=" exit 1 ; "
COMMAND+=" fi "
fi
COMMAND+=" $SCRIPT_CMD || exit 1;"
COMMAND+=" if [[ -d '/cache' ]]; then "
COMMAND+=" echo removing installation cache... ; "
COMMAND+=" rm -f /tmp/cache ; "
COMMAND+=" fi "
local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
local CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$APP/cache"
[[ -d $CACHE_DIR ]] || mkdir -p "$CACHE_DIR"
local DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG")
# strip --restart args from DOCKER_ARGS
local DOCKER_ARGS=$(sed -e "s/--restart=[[:graph:]]\+[[:blank:]]\?//g" <<< "$DOCKER_ARGS")
# eval args as array to respect escapes
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
local DOKKU_APP_SHELL="/bin/bash"
DOKKU_APP_SHELL="$(config_get --global DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")"
DOKKU_APP_SHELL="$(config_get "$APP" DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")"
[[ -z "$DOKKU_APP_SHELL" ]] && DOKKU_APP_SHELL="/bin/bash"
id=$(docker run "$DOKKU_GLOBAL_RUN_ARGS" -e DOKKU_TRACE="$DOKKU_TRACE" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_HOST_DIR:/cache" "${ARG_ARRAY[@]}" "$IMAGE" "$DOKKU_APP_SHELL" -c "$COMMAND")
if test "$(docker wait "$id")" -eq 0; then
dokku_container_log_verbose_quiet "$id"
if [[ "$PHASE_SCRIPT_KEY" != "postdeploy" ]];then
if ! is_image_herokuish_based "$IMAGE"; then
local DOKKU_DOCKERFILE_ENTRYPOINT=$(config_get "$APP" DOKKU_DOCKERFILE_ENTRYPOINT)
local DOKKU_DOCKERFILE_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_CMD)
[[ -z "$DOKKU_DOCKERFILE_ENTRYPOINT" ]] && DOKKU_DOCKERFILE_ENTRYPOINT="$(get_entrypoint_from_image "$IMAGE")"
[[ -z "$DOKKU_DOCKERFILE_CMD" ]] && DOKKU_DOCKERFILE_CMD="$(get_cmd_from_image "$IMAGE")"
[[ -n "$DOKKU_DOCKERFILE_ENTRYPOINT" ]] && local DOCKER_COMMIT_ENTRYPOINT_CHANGE_ARG="--change='$DOKKU_DOCKERFILE_ENTRYPOINT'"
[[ -n "$DOKKU_DOCKERFILE_CMD" ]] && local DOCKER_COMMIT_CMD_CHANGE_ARG="--change='$DOKKU_DOCKERFILE_CMD'"
local DOCKER_COMMIT_ARGS="$DOCKER_COMMIT_ENTRYPOINT_CHANGE_ARG $DOCKER_COMMIT_CMD_CHANGE_ARG"
fi
# shellcheck disable=SC2086
eval docker commit $DOCKER_COMMIT_ARGS "$id" "$IMAGE" > /dev/null
fi
else
dokku_container_log_verbose_quiet "$id"
dokku_log_fail "execution of '$SCRIPT_CMD' failed!"
fi
fi
}

View File

@@ -1,20 +1,21 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
hostname -f > "$DOKKU_ROOT/HOSTNAME"
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
hostname -f >"$DOKKU_ROOT/HOSTNAME"
fi
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short "$(<"$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
fi
dokku_path="$(which dokku)"
# temporary hack for https://github.com/dokku/dokku/issues/82
# redeploys all apps after a reboot
if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then
cat<<EOF > /etc/init/dokku-redeploy.conf
if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then
cat <<EOF >/etc/init/dokku-redeploy.conf
description "Dokku app redeploy service"
start on filesystem and started docker
@@ -26,8 +27,8 @@ end script
EOF
fi
if [[ $(systemctl 2> /dev/null) =~ -\.mount ]]; then
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
if [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then
cat <<EOF >/etc/systemd/system/dokku-redeploy.service
[Unit]
Description=Dokku app redeploy service
Requires=docker.service
@@ -42,12 +43,12 @@ ExecStart=$dokku_path ps:restore
WantedBy=docker.service
EOF
if command -v systemctl &>/dev/null; then
systemctl reenable dokku-redeploy
systemctl --quiet reenable dokku-redeploy
fi
fi
mkdir -p /etc/update-motd.d
cat<<EOF > /etc/update-motd.d/99-dokku
cat <<EOF >/etc/update-motd.d/99-dokku
#!/bin/sh
if [ ! -f "/home/dokku/HOSTNAME" ]; then
@@ -63,6 +64,6 @@ chmod +x /etc/update-motd.d/99-dokku
chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
chown dokku:dokku "$DOKKU_ROOT/VHOST"
fi

View File

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

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
exec_app_json_scripts() {
declare desc="core app.json scripts execution"
local trigger="post-deploy app_json_scripts"
local APP="$1"; local IMAGE_TAG="$4"; local PHASE_SCRIPT_KEY="postdeploy"
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
}
exec_app_json_scripts "$@"

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
exec_app_json_scripts() {
declare desc="core app.json scripts execution"
local trigger="pre-deploy app_json_scripts"
local APP="$1"; local IMAGE_TAG="$2"; local PHASE_SCRIPT_KEY="predeploy"
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
}
exec_app_json_scripts "$@"

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_cleanup_cmd() {
@@ -8,8 +9,11 @@ dokku_cleanup_cmd() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
if [[ -z "$APP" ]]; then
APP="--global"
fi
docker_cleanup "$APP" "true"
}
dokku_cleanup_cmd "$@"

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
shift 1

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_report_cmd() {
@@ -16,12 +17,16 @@ dokku_report_cmd() {
docker -D info | sed "s/^/ /"
dokku_log_info1 "sigil version: $(sigil -v)"
dokku_log_info1 "herokuish version: "
docker run --rm -ti gliderlabs/herokuish:latest herokuish version | sed "s/^/ /"
docker run --rm gliderlabs/herokuish:latest herokuish version | sed "s/^/ /"
dokku_log_info1 "dokku version: $(dokku version)"
dokku_log_info1 "dokku plugins: "
dokku plugin:list | sed "s/^/ /"
if [[ -n "$APP" ]]; then
if [[ "$APP" == "--all" ]]; then
for app in $(dokku_apps); do
plugn trigger report "$app"
done
elif [[ -n "$APP" ]]; then
plugn trigger report "$APP"
fi
}

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_trace_cmd() {
@@ -12,7 +13,7 @@ dokku_trace_cmd() {
if [[ "$2" == "on" ]]; then
echo "Enabling dokku trace"
echo "export DOKKU_TRACE=1" > "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
echo "export DOKKU_TRACE=1" >"$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
fi
if [[ "$2" == "off" ]]; then

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_urls_cmd() {

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_version_cmd() {
declare desc="prints dokku version"
local cmd="version"
cat "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version"
}
dokku_version_cmd "$@"

View File

@@ -1,12 +1,13 @@
#!/usr/bin/env bash
[[ " help events:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
case "$1" in
help | events:help)
help_content_func () {
help_content_func() {
declare desc="return events plugin help content"
cat<<help_content
cat <<help_content
events [-t], Show the last events (-t follows)
events:list, List logged events
events:on, Enable events logger
@@ -14,15 +15,15 @@ case "$1" in
help_content
}
if [[ $1 = "events:help" ]] ; then
echo 'Usage: dokku events:COMMAND [-t]'
echo ''
echo 'Interact with Dokku event logger.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
if [[ $1 == "events:help" ]]; then
echo 'Usage: dokku events:COMMAND [-t]'
echo ''
echo 'Interact with Dokku event logger.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
else
help_content_func
help_content_func
fi
;;
@@ -31,4 +32,3 @@ help_content
;;
esac

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename "$0")" "$@"

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
DOKKU_RSYSLOG_FILTER_DIR=/etc/rsyslog.d
@@ -13,7 +14,7 @@ flag_rsyslog_needs_restart=n
# shellcheck disable=SC2174
mkdir -m 775 -p "$DOKKU_LOGS_DIR"
case "$DOKKU_DISTRO" in
arch|debian|centos|rhel)
arch | debian | centos | rhel)
chgrp dokku "$DOKKU_LOGS_DIR"
;;
*)
@@ -21,10 +22,10 @@ case "$DOKKU_DISTRO" in
;;
esac
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
touch "$DOKKU_EVENTS_LOGFILE"
case "$DOKKU_DISTRO" in
arch|debian|centos|rhel)
arch | debian | centos | rhel)
chgrp dokku "$DOKKU_EVENTS_LOGFILE"
;;
*)
@@ -35,7 +36,7 @@ if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
chmod 664 "$DOKKU_EVENTS_LOGFILE"
fi
if [[ -d "$DOKKU_RSYSLOG_FILTER_DIR" && ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then
if [[ -d "$DOKKU_RSYSLOG_FILTER_DIR" && ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then
cat >"$DOKKU_RSYSLOG_FILTER" <<EOF
:syslogtag, contains, "dokku" $DOKKU_EVENTS_LOGFILE
EOF
@@ -59,7 +60,7 @@ $DOKKU_LOGS_DIR/*.log {
}
EOF
if [[ "$DOKKU_DISTRO" = "debian" ]]; then
if [[ "$DOKKU_DISTRO" == "debian" ]]; then
sed -i 's/ syslog dokku$/ root dokku/g' $DOKKU_LOGROTATE_FILE
fi

View File

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

View File

@@ -0,0 +1 @@
hook

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
events_main_cmd() {

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
events_list_cmd() {

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
events_off_cmd() {

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