Compare commits

...

151 Commits

Author SHA1 Message Date
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
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
Jose Diaz-Gonzalez
f5bb99c145 Release 0.13.4
# History

## 0.13.4

Install/update via the bootstrap script:

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

### Bug Fixes

- #3337: @josegonzalez Use correct container id variable for killing containers

### New Features

- #3338: @josegonzalez Redirect ps:retire output to a log file
2018-12-17 17:29:47 -05:00
Jose Diaz-Gonzalez
f61fcbc3b5 Merge pull request #3338 from dokku/redirect-retire-output
Redirect ps:retire output to a log file
2018-12-17 17:28:04 -05:00
Jose Diaz-Gonzalez
73fb626618 feat: Redirect ps:retire output to a log file
This will allow systems to properly monitor whether retiring old containers works.

Note that the file will be logrotated by the 20_events logrotate config.
2018-12-17 17:27:42 -05:00
Jose Diaz-Gonzalez
7a81f89442 Merge pull request #3337 from dokku/fix-cid
Use correct container id variable for killing containers
2018-12-17 17:26:09 -05:00
Jose Diaz-Gonzalez
ba157867c1 fix: Use correct container id variable for killing containers
The first pass at stop/kill would fail as the variable was incorrect.
2018-12-17 17:25:43 -05:00
Jose Diaz-Gonzalez
4f1cd2d30c Release 0.13.3
# History

## 0.13.3

Install/update via the bootstrap script:

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

### Bug Fixes

- #3330: @josegonzalez Ensure chowned properties always have a user and group set

### New Features

- #3334: @josegonzalez refactor: run every 5 minutes instead of 2
2018-12-12 16:05:32 -05:00
Jose Diaz-Gonzalez
803b55c6c2 Merge pull request #3330 from dokku/ensure-permissions
Ensure chowned properties always have a user and group set
2018-12-12 14:08:33 -06:00
Jose Diaz-Gonzalez
d90e7b68dc Merge pull request #3334 from dokku/josegonzalez-patch-1
refactor: run every 5 minutes instead of 2
2018-12-12 12:27:38 -06:00
Jose Diaz-Gonzalez
929f503fa3 refactor: run every 5 minutes instead of 2
2 is a bit agressive, but 5 will ensure there are no runs that coincide with each other.
2018-12-12 13:27:11 -05:00
Jose Diaz-Gonzalez
615119260d fix: ensure chowned properties always have a user and group set
Depending on the execution path, the variables may not be set at the top-level.

Closes #3328
2018-12-12 02:55:38 -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
402 changed files with 4715 additions and 2757 deletions

View File

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

View File

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

4
.gitignore vendored
View File

@@ -4,8 +4,10 @@
.ruby-version .ruby-version
.idea/ .idea/
.vagrant .vagrant
build/
data/ data/
test-results/
stack.tgz stack.tgz
tmp tmp
coverage.out 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/) * 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) * 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 * 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 There are a few guidelines that we need contributors to follow so that we have
a chance of keeping on top of things. a chance of keeping on top of things.

View File

@@ -1,5 +1,189 @@
# History # 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
## 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:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.4/bootstrap.sh
sudo DOKKU_TAG=v0.13.4 bash bootstrap.sh
```
### Bug Fixes
- #3337: @josegonzalez Use correct container id variable for killing containers
### New Features
- #3338: @josegonzalez Redirect ps:retire output to a log file
## 0.13.3
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.3/bootstrap.sh
sudo DOKKU_TAG=v0.13.3 bash bootstrap.sh
```
### Bug Fixes
- #3330: @josegonzalez Ensure chowned properties always have a user and group set
### New Features
- #3334: @josegonzalez refactor: run every 5 minutes instead of 2
## 0.13.2 ## 0.13.2
Install/update via the bootstrap script: Install/update via the bootstrap script:

View File

@@ -1,7 +1,8 @@
DOKKU_VERSION ?= master DOKKU_VERSION ?= master
PROCFILE_VERSION ?= 0.4.0
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v0.4.0/procfile-util_0.4.0_linux_x86_64.tgz 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/v0.3.0/plugn_0.3.0_linux_x86_64.tgz PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_linux_x86_64.tgz
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz
STACK_URL ?= https://github.com/gliderlabs/herokuish.git STACK_URL ?= https://github.com/gliderlabs/herokuish.git

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`: To install the latest stable release, run the following commands as a user who has access to `sudo`:
```shell ```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.2/bootstrap.sh wget https://raw.githubusercontent.com/dokku/dokku/v0.14.5/bootstrap.sh
sudo DOKKU_TAG=v0.13.2 bash bootstrap.sh sudo DOKKU_TAG=v0.14.5 bash bootstrap.sh
``` ```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation. You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.

View File

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

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,4 +1,4 @@
FROM ubuntu:14.04 FROM dokku/build-base:0.0.1
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
@@ -13,7 +13,4 @@ COPY . ${WORKDIR}
RUN make deb-dokku-update rpm-dokku-update RUN make deb-dokku-update rpm-dokku-update
RUN mkdir -p /data \ RUN ls -lha /tmp/
&& cp /tmp/*.deb /data \
&& cp /tmp/*.rpm /data \
&& ls -lha /data/

View File

@@ -1,4 +1,4 @@
FROM ubuntu:14.04 FROM dokku/build-base:0.0.1
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
@@ -36,10 +36,7 @@ RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \
SKIP_GO_CLEAN=true \ SKIP_GO_CLEAN=true \
make version copyfiles \ make version copyfiles \
&& rm -rf plugins/common/*.go plugins/common/glide* plugins/common/vendor/ \ && 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 \ && make deb-dokku deb-plugn deb-sshcommand deb-sigil \
rpm-herokuish rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil rpm-dokku-update rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil
RUN mkdir -p /data \ RUN ls -lha /tmp/
&& cp /tmp/*.deb /data \
&& cp /tmp/*.rpm /data \
&& ls -lha /data/

View File

@@ -1,4 +1,4 @@
FROM ubuntu:14.04 FROM dokku/build-base:0.0.1
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
@@ -13,7 +13,4 @@ COPY . ${WORKDIR}
RUN make deb-herokuish rpm-herokuish RUN make deb-herokuish rpm-herokuish
RUN mkdir -p /data \ RUN ls -lha /tmp/
&& cp /tmp/*.deb /data \
&& cp /tmp/*.rpm /data \
&& ls -lha /data/

View File

@@ -5,7 +5,7 @@ import shutil
import subprocess import subprocess
from requests.auth import HTTPBasicAuth 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): def download_file(filename, url):
@@ -25,7 +25,7 @@ def upload_file(filename):
def main(): 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', base = requests.get('https://packagecloud.io/api/v1/repos/dokku/dokku/packages/deb/ubuntu/trusty.json',
auth=auth) auth=auth)
data = base.json() data = base.json()

View File

@@ -10,7 +10,7 @@ import subprocess
import sys import sys
import threading import threading
VERSION = 'v0.13.2' VERSION = 'v0.14.5'
hostname = '' hostname = ''
try: try:
@@ -21,7 +21,13 @@ try:
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
pass 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 = [] admin_keys = []
if os.path.isfile(key_file): if os.path.isfile(key_file):
@@ -72,6 +78,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self): def do_GET(self):
content = PAGE.replace('{VERSION}', VERSION) content = PAGE.replace('{VERSION}', VERSION)
content = content.replace('{HOSTNAME}', hostname) content = content.replace('{HOSTNAME}', hostname)
content = content.replace('{AUTHORIZED_KEYS_LOCATION}', key_file)
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys)) content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
self.send_response(200) self.send_response(200)
self.end_headers() self.end_headers()
@@ -211,70 +218,147 @@ def main():
PAGE = """ PAGE = """
<html> <html>
<head> <head>
<meta charset="utf-8" />
<title>Dokku Setup</title> <title>Dokku Setup</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <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> </head>
<body> <body>
<div class="container" style="width: 640px;"> <div class="container">
<form id="form" role="form"> <form id="form" role="form">
<h1>Dokku Setup <small>{VERSION}</small></h1> <h1 class="pt-3">Dokku Setup <small class="text-muted">{VERSION}</small></h1>
<div class="form-group"> <div class="alert alert-warning small" role="alert">
<h3><small style="text-transform: uppercase;">Admin Access</small></h3> <strong>Warning:</strong> The SSH key filled out here can grant root access to the server. Please complete the setup as soon as possible.
<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> </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> </div>
<p>Your app URLs will look like:</p>
<pre id="example">http://hostname:port</pre> <div class="row">
</div> <div class="col">
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span style="padding-left: 20px;" id="result"></span> <h3>Hostname Configuration</h3>
</form> <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>
<div id="error-output"></div> <div id="error-output"></div>
<script> <script>
var $ = document.querySelector.bind(document)
function setup() { function setup() {
if ($.trim($("#key").val()) == "") { if ($("#key").value.trim() == "") {
alert("Your admin public key cannot be blank.") alert("Your admin public key cannot be blank.")
return return
} }
if ($.trim($("#hostname").val()) == "") { if ($("#hostname").value.trim() == "") {
alert("Your hostname cannot be blank.") alert("Your hostname cannot be blank.")
return return
} }
data = $("#form").serialize() var data = new FormData($("#form"))
$("input,textarea,button").prop("disabled", true);
$.post('/setup', data) var inputs = [].slice.call(document.querySelectorAll("input, textarea, button"))
.done(function() { inputs.forEach(function (input) {
$("#result").html("Success!") input.disabled = true
window.location.href = "http://dokku.viewdocs.io/dokku~{VERSION}/deployment/application-deployment/"; })
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() { 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.") 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')) { if ($("#vhost").matches(':checked')) {
$("#example").html("http://&lt;app-name&gt;."+$("#hostname").val()) $("#example").textContent = "http://<app-name>."+$("#hostname").value
} else { } else {
$("#example").html("http://"+$("#hostname").val()+":&lt;app-port&gt;") $("#example").textContent = "http://"+$("#hostname").value+":<app-port>"
} }
} }
$("#vhost").change(update); $("#vhost").addEventListener("change", update);
$("#hostname").change(update); $("#hostname").addEventListener("input", update);
update(); update();
</script> </script>
</body> </body>

View File

@@ -79,11 +79,11 @@ main() {
arch) arch)
yaourt -Syyua yaourt -Syyua
;; ;;
debian|ubuntu) debian | ubuntu)
apt-get update -qq > /dev/null apt-get update -qq >/dev/null
apt-get -qq -y --force-yes dist-upgrade apt-get -qq -y --force-yes dist-upgrade
;; ;;
centos|opensuse|rhel) centos | opensuse | rhel)
dokku-log-warn "Updating this operating system is not supported" dokku-log-warn "Updating this operating system is not supported"
;; ;;
*) *)
@@ -94,7 +94,7 @@ main() {
# update all plugins # update all plugins
dokku-log-info "Updating 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" dokku-update-plugin "$PLUGIN_NAME"
done done
dokku plugin:install dokku plugin:install

View File

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

View File

@@ -49,7 +49,7 @@ fn-build-dokku() {
--build-arg IS_RELEASE="$IS_RELEASE" \ --build-arg IS_RELEASE="$IS_RELEASE" \
--build-arg PLUGIN_MAKE_TARGET="build" \ --build-arg PLUGIN_MAKE_TARGET="build" \
--build-arg GOLANG_VERSION="$GOLANG_VERSION" \ --build-arg GOLANG_VERSION="$GOLANG_VERSION" \
-f "contrib/build.Dockerfile" \ -f "contrib/build-dokku.Dockerfile" \
-t "$NAME" . -t "$NAME" .
return "$?" return "$?"
} }
@@ -68,7 +68,7 @@ fn-extract-package() {
[[ "$IS_RELEASE" == "true" ]] && NAME="dokku:build-release" [[ "$IS_RELEASE" == "true" ]] && NAME="dokku:build-release"
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path" 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 "$?" return "$?"
} }
@@ -237,7 +237,7 @@ fn-repo-update-history-and-commit() {
declare desc="Updates the history file and commits the changes" declare desc="Updates the history file and commits the changes"
declare CURRENT_VERSION="$1" NEXT_VERSION="$2" declare CURRENT_VERSION="$1" NEXT_VERSION="$2"
local PULL_REQUEST_ID TITLE AUTHOR TYPE CHANGELOG_TEXT 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 pushd "$ROOT_DIR" >/dev/null
@@ -260,6 +260,8 @@ fn-repo-update-history-and-commit() {
HISTORY_DOCUMENTATION="${HISTORY_DOCUMENTATION}"$'\n'"$CHANGELOG_TEXT" HISTORY_DOCUMENTATION="${HISTORY_DOCUMENTATION}"$'\n'"$CHANGELOG_TEXT"
elif [[ "$TYPE" == "enhancement" ]] || [[ "$TYPE" == "refactor" ]]; then elif [[ "$TYPE" == "enhancement" ]] || [[ "$TYPE" == "refactor" ]]; then
HISTORY_ENHANCEMENT="${HISTORY_ENHANCEMENT}"$'\n'"$CHANGELOG_TEXT" HISTORY_ENHANCEMENT="${HISTORY_ENHANCEMENT}"$'\n'"$CHANGELOG_TEXT"
elif [[ "$TYPE" == "tests" ]]; then
HISTORY_TESTS="${HISTORY_TESTS}"$'\n'"$CHANGELOG_TEXT"
else else
HISTORY_OTHER="${HISTORY_OTHER}"$'\n'"$CHANGELOG_TEXT" HISTORY_OTHER="${HISTORY_OTHER}"$'\n'"$CHANGELOG_TEXT"
fi fi
@@ -288,6 +290,11 @@ fn-repo-update-history-and-commit() {
HISTORY="${HISTORY}"$'\n'"$HISTORY_DOCUMENTATION" HISTORY="${HISTORY}"$'\n'"$HISTORY_DOCUMENTATION"
fi fi
if [[ "$HISTORY_TESTS" ]]; then
HISTORY="${HISTORY}"$'\n\n'"### Tests"
HISTORY="${HISTORY}"$'\n'"$HISTORY_TESTS"
fi
if [[ "$HISTORY_OTHER" ]]; then if [[ "$HISTORY_OTHER" ]]; then
HISTORY="${HISTORY}"$'\n\n'"### Other" HISTORY="${HISTORY}"$'\n\n'"### Other"
HISTORY="${HISTORY}"$'\n'"$HISTORY_OTHER" HISTORY="${HISTORY}"$'\n'"$HISTORY_OTHER"
@@ -313,7 +320,7 @@ fn-require-bin() {
main() { main() {
declare RELEASE="$1" declare RELEASE="$1"
local CURRENT_VERSION NEXT_VERSION IS_RELEASE 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 if [[ "$RELEASE" == '--trace' ]]; then
shift 1 shift 1
@@ -322,39 +329,45 @@ main() {
fi fi
if [[ -z "$RELEASE" ]]; then 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 fi
if ! fn-in-array "$RELEASE" "${VALID_RELEASE_LEVELS[@]}"; then 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 fi
log-info "Creating $RELEASE release"
mkdir -p "build"
fn-require-bin "docker" fn-require-bin "docker"
fn-require-bin "git" fn-require-bin "git"
fn-require-bin "package_cloud" if [[ "$RELEASE" != "build" ]]; then
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable" fn-require-bin "package_cloud"
[[ -n "$PACKAGECLOUD_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_TOKEN environment variable"
fi
CURRENT_VERSION="$(fn-version-current)" CURRENT_VERSION="$(fn-version-current)"
NEXT_VERSION="$(fn-version-next "$CURRENT_VERSION" "$RELEASE")" NEXT_VERSION="$(fn-version-next "$CURRENT_VERSION" "$RELEASE")"
IS_RELEASE="$(fn-is-release "$RELEASE")" IS_RELEASE="$(fn-is-release "$RELEASE")"
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION" fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION" || log-fail "Error building package" 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}_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-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 if [[ "$IS_RELEASE" != "true" ]]; then
git reset -q HEAD plugins/*/plugin.toml git reset -q HEAD plugins/*/plugin.toml
git checkout -- plugins/*/plugin.toml git checkout -- plugins/*/plugin.toml
fi fi
echo "build/dokku_${NEXT_VERSION}_amd64.deb" >build/deb-filename
echo "build/dokku-${NEXT_VERSION}-1.x86_64.rpm" >build/rpm-filename
} }
main "$@" main "$@"

View File

@@ -32,7 +32,7 @@ fn-build-dokku() {
pushd "$ROOT_DIR" >/dev/null pushd "$ROOT_DIR" >/dev/null
docker build \ docker build \
-f "contrib/update-build.Dockerfile" \ -f "contrib/build-dokku-update.Dockerfile" \
-t dokku-update:build . -t dokku-update:build .
return "$?" return "$?"
} }
@@ -47,7 +47,7 @@ fn-extract-package() {
fi fi
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path" 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 "$?" return "$?"
} }
@@ -70,7 +70,7 @@ fn-publish-package() {
EXIT_CODE="$ex" EXIT_CODE="$ex"
fi fi
done done
DIST=debian DIST=debian
OS_IDS=("wheezy" "jessie" "stretch" "buster") OS_IDS=("wheezy" "jessie" "stretch" "buster")
for OS_ID in "${OS_IDS[@]}"; do for OS_ID in "${OS_IDS[@]}"; do
@@ -121,7 +121,7 @@ fn-require-bin() {
main() { main() {
declare RELEASE="$1" declare RELEASE="$1"
local NEXT_VERSION local NEXT_VERSION
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish") local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish" "build")
if [[ "$RELEASE" == '--trace' ]]; then if [[ "$RELEASE" == '--trace' ]]; then
shift 1 shift 1
@@ -130,29 +130,31 @@ main() {
fi fi
if [[ -z "$RELEASE" ]]; then 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 fi
if ! fn-in-array "$RELEASE" "${VALID_RELEASE_LEVELS[@]}"; then 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 fi
mkdir -p "build"
fn-require-bin "docker" fn-require-bin "docker"
fn-require-bin "package_cloud" if [[ "$RELEASE" != "build" ]]; then
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable" 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)" NEXT_VERSION="$(grep DOKKU_UPDATE_VERSION deb.mk | head -n1 | cut -d'=' -f2 | xargs)"
IS_RELEASE="$(fn-is-release "$RELEASE")" IS_RELEASE="$(fn-is-release "$RELEASE")"
fn-build-dokku || log-fail "Error building package" 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}_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-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" 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" "dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package" fn-publish-package "$IS_RELEASE" "rpm" "build/dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fi
} }
main "$@" main "$@"

View File

@@ -32,7 +32,7 @@ fn-build-dokku() {
pushd "$ROOT_DIR" >/dev/null pushd "$ROOT_DIR" >/dev/null
docker build \ docker build \
-f "contrib/herokuish-build.Dockerfile" \ -f "contrib/build-herokuish.Dockerfile" \
-t herokuish:build . -t herokuish:build .
return "$?" return "$?"
} }
@@ -47,7 +47,7 @@ fn-extract-package() {
fi fi
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path" 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 "$?" return "$?"
} }
@@ -70,7 +70,7 @@ fn-publish-package() {
EXIT_CODE="$ex" EXIT_CODE="$ex"
fi fi
done done
DIST=debian DIST=debian
OS_IDS=("wheezy" "jessie" "stretch" "buster") OS_IDS=("wheezy" "jessie" "stretch" "buster")
for OS_ID in "${OS_IDS[@]}"; do for OS_ID in "${OS_IDS[@]}"; do
@@ -121,7 +121,7 @@ fn-require-bin() {
main() { main() {
declare RELEASE="$1" declare RELEASE="$1"
local NEXT_VERSION local NEXT_VERSION
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish") local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish" "build")
if [[ "$RELEASE" == '--trace' ]]; then if [[ "$RELEASE" == '--trace' ]]; then
shift 1 shift 1
@@ -130,27 +130,31 @@ main() {
fi fi
if [[ -z "$RELEASE" ]]; then 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 fi
if ! fn-in-array "$RELEASE" "${VALID_RELEASE_LEVELS[@]}"; then 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 fi
mkdir -p "build"
fn-require-bin "docker" fn-require-bin "docker"
fn-require-bin "package_cloud" if [[ "$RELEASE" != "build" ]]; then
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable" 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)" NEXT_VERSION="$(grep HEROKUISH_VERSION deb.mk | head -n1 | cut -d'=' -f2 | xargs)"
IS_RELEASE="$(fn-is-release "$RELEASE")" IS_RELEASE="$(fn-is-release "$RELEASE")"
fn-build-dokku || log-fail "Error building package" 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}_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-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" if [[ "$RELEASE" != "build" ]]; then
fn-publish-package "$IS_RELEASE" "rpm" "herokuish-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package" 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 "$@" main "$@"

View File

@@ -57,7 +57,7 @@ main() {
local CURRENT_VERSION FILENAME NEXT_VERSION ORG_REPO_NAME REPO_NAME major minor patch local CURRENT_VERSION FILENAME NEXT_VERSION ORG_REPO_NAME REPO_NAME major minor patch
if [[ -z "$RELEASE" ]]; then if [[ -z "$RELEASE" ]]; then
cat<<'EOF' cat <<'EOF'
requirements: requirements:
- this is run in a plugin folder - this is run in a plugin folder
@@ -97,9 +97,9 @@ EOF
while true; do while true; do
read -rp "Do you wish to continue? " yn read -rp "Do you wish to continue? " yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]*) break ;;
[Nn]* ) exit;; [Nn]*) exit ;;
* ) echo "Please answer yes or no.";; *) echo "Please answer yes or no." ;;
esac esac
done done
fi fi
@@ -131,19 +131,19 @@ EOF
patch=$(echo "$CURRENT_VERSION" | awk '{split($0,a,"."); print a[3]}') patch=$(echo "$CURRENT_VERSION" | awk '{split($0,a,"."); print a[3]}')
if [[ "$RELEASE" == "major" ]]; then if [[ "$RELEASE" == "major" ]]; then
major=$((major + 1)); major=$((major + 1))
minor="0" minor="0"
patch="0" patch="0"
elif [[ "$RELEASE" == "minor" ]]; then elif [[ "$RELEASE" == "minor" ]]; then
minor=$((minor + 1)); minor=$((minor + 1))
patch="0" patch="0"
elif [[ "$RELEASE" == "patch" ]]; then elif [[ "$RELEASE" == "patch" ]]; then
patch=$((patch + 1)); patch=$((patch + 1))
else else
log-error "Invalid release type specified" log-error "Invalid release type specified"
return 1 return 1
fi fi
NEXT_VERSION="${major}.${minor}.${patch}" NEXT_VERSION="${major}.${minor}.${patch}"
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" plugin.toml fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" plugin.toml
git add plugin.toml git add plugin.toml
@@ -163,7 +163,7 @@ EOF
DOKKU_PLUGIN_S3_PATH="${DOKKU_PLUGIN_S3_PATH}/" DOKKU_PLUGIN_S3_PATH="${DOKKU_PLUGIN_S3_PATH}/"
fi 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 aws s3 cp "${TMP_WORK_DIR}/${FILENAME}" "s3://${DOKKU_PLUGIN_S3_BUCKET}/${DOKKU_PLUGIN_S3_PATH}${FILENAME}" --acl public-read
fi fi
} }

31
deb.mk
View File

@@ -1,6 +1,8 @@
BUILD_DIRECTORY ?= /tmp
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku' HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
HEROKUISH_VERSION ?= 0.4.5 HEROKUISH_VERSION ?= 0.4.6
HEROKUISH_ARCHITECTURE = amd64 HEROKUISH_ARCHITECTURE = amd64
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
@@ -69,13 +71,13 @@ install-from-deb:
wget -nv -O - https://get.docker.com/ | sh wget -nv -O - https://get.docker.com/ | sh
@echo "--> Installing dokku" @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/ubuntu/ $(shell lsb_release -cs 2> /dev/null || echo "trusty") main" | sudo tee /etc/apt/sources.list.d/dokku.list @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 apt-get update -qq > /dev/null
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku 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 deb-all: deb-setup deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil deb-dokku-update
mv /tmp/*.deb . mv $(BUILD_DIRECTORY)/*.deb .
@echo "Done" @echo "Done"
deb-setup: deb-setup:
@@ -100,9 +102,9 @@ deb-herokuish:
@echo "-> Creating $(HEROKUISH_PACKAGE_NAME)" @echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n herokuish \ sudo fpm -t deb -s dir -C /tmp/build -n herokuish \
-v $(HEROKUISH_VERSION) \ --version $(HEROKUISH_VERSION) \
-a $(HEROKUISH_ARCHITECTURE) \ --architecture $(HEROKUISH_ARCHITECTURE) \
-p $(HEROKUISH_PACKAGE_NAME) \ --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 'docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1) | docker-ce | docker-ee' \
--deb-pre-depends sudo \ --deb-pre-depends sudo \
--after-install /tmp/tmp/post-install \ --after-install /tmp/tmp/post-install \
@@ -110,7 +112,6 @@ deb-herokuish:
--description $(HEROKUISH_DESCRIPTION) \ --description $(HEROKUISH_DESCRIPTION) \
--license 'MIT License' \ --license 'MIT License' \
. .
mv *.deb /tmp
deb-dokku: deb-dokku:
rm -rf /tmp/tmp /tmp/build dokku_*_$(DOKKU_ARCHITECTURE).deb rm -rf /tmp/tmp /tmp/build dokku_*_$(DOKKU_ARCHITECTURE).deb
@@ -157,8 +158,8 @@ else
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
endif 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 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" dpkg-deb --build /tmp/build "$(BUILD_DIRECTORY)/dokku_`cat /tmp/build/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb"
lintian "/tmp/dokku_`cat /tmp/build/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb" lintian "$(BUILD_DIRECTORY)/dokku_`cat /tmp/build/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb"
deb-dokku-update: deb-dokku-update:
rm -rf /tmp/dokku-update*.deb dokku-update*.deb rm -rf /tmp/dokku-update*.deb dokku-update*.deb
@@ -166,14 +167,13 @@ deb-dokku-update:
sudo fpm -t deb -s dir -n dokku-update \ sudo fpm -t deb -s dir -n dokku-update \
--version $(DOKKU_UPDATE_VERSION) \ --version $(DOKKU_UPDATE_VERSION) \
--architecture $(DOKKU_UPDATE_ARCHITECTURE) \ --architecture $(DOKKU_UPDATE_ARCHITECTURE) \
--package $(DOKKU_UPDATE_PACKAGE_NAME) \ --package $(BUILD_DIRECTORY)/$(DOKKU_UPDATE_PACKAGE_NAME) \
--depends 'dokku' \ --depends 'dokku' \
--url "https://github.com/$(DOKKU_UPDATE_REPO_NAME)" \ --url "https://github.com/$(DOKKU_UPDATE_REPO_NAME)" \
--description $(DOKKU_UPDATE_DESCRIPTION) \ --description $(DOKKU_UPDATE_DESCRIPTION) \
--license 'MIT License' \ --license 'MIT License' \
contrib/dokku-update=/usr/local/bin/dokku-update \ contrib/dokku-update=/usr/local/bin/dokku-update \
contrib/dokku-update-version=/var/lib/dokku-update/VERSION contrib/dokku-update-version=/var/lib/dokku-update/VERSION
mv *.deb /tmp
deb-plugn: deb-plugn:
rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME) rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME)
@@ -190,14 +190,13 @@ deb-plugn:
sudo fpm -t deb -s dir -C /tmp/build -n plugn \ sudo fpm -t deb -s dir -C /tmp/build -n plugn \
--version $(PLUGN_VERSION) \ --version $(PLUGN_VERSION) \
--architecture $(PLUGN_ARCHITECTURE) \ --architecture $(PLUGN_ARCHITECTURE) \
--package $(PLUGN_PACKAGE_NAME) \ --package $(BUILD_DIRECTORY)/$(PLUGN_PACKAGE_NAME) \
--url "https://github.com/$(PLUGN_REPO_NAME)" \ --url "https://github.com/$(PLUGN_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \ --maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category utils \ --category utils \
--description "$$PLUGN_DESCRIPTION" \ --description "$$PLUGN_DESCRIPTION" \
--license 'MIT License' \ --license 'MIT License' \
. .
mv *.deb /tmp
deb-sshcommand: deb-sshcommand:
rm -rf /tmp/tmp /tmp/build $(SSHCOMMAND_PACKAGE_NAME) rm -rf /tmp/tmp /tmp/build $(SSHCOMMAND_PACKAGE_NAME)
@@ -215,14 +214,13 @@ deb-sshcommand:
sudo fpm -t deb -s dir -C /tmp/build -n sshcommand \ sudo fpm -t deb -s dir -C /tmp/build -n sshcommand \
--version $(SSHCOMMAND_VERSION) \ --version $(SSHCOMMAND_VERSION) \
--architecture $(SSHCOMMAND_ARCHITECTURE) \ --architecture $(SSHCOMMAND_ARCHITECTURE) \
--package $(SSHCOMMAND_PACKAGE_NAME) \ --package $(BUILD_DIRECTORY)/$(SSHCOMMAND_PACKAGE_NAME) \
--url "https://github.com/$(SSHCOMMAND_REPO_NAME)" \ --url "https://github.com/$(SSHCOMMAND_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \ --maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category admin \ --category admin \
--description "$$SSHCOMMAND_DESCRIPTION" \ --description "$$SSHCOMMAND_DESCRIPTION" \
--license 'MIT License' \ --license 'MIT License' \
. .
mv *.deb /tmp
deb-sigil: deb-sigil:
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME) rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
@@ -239,11 +237,10 @@ deb-sigil:
sudo fpm -t deb -s dir -C /tmp/build -n gliderlabs-sigil \ sudo fpm -t deb -s dir -C /tmp/build -n gliderlabs-sigil \
--version $(SIGIL_VERSION) \ --version $(SIGIL_VERSION) \
--architecture $(SIGIL_ARCHITECTURE) \ --architecture $(SIGIL_ARCHITECTURE) \
--package $(SIGIL_PACKAGE_NAME) \ --package $(BUILD_DIRECTORY)/$(SIGIL_PACKAGE_NAME) \
--url "https://github.com/$(SIGIL_REPO_NAME)" \ --url "https://github.com/$(SIGIL_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \ --maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category utils \ --category utils \
--description "$$SIGIL_DESCRIPTION" \ --description "$$SIGIL_DESCRIPTION" \
--license 'MIT License' \ --license 'MIT License' \
. .
mv *.deb /tmp

5
debian/config vendored
View File

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

2
debian/control vendored
View File

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

29
debian/postinst vendored
View File

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

3
debian/postrm vendored
View File

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

28
debian/preinst vendored
View File

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

33
debian/prerm vendored
View File

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

View File

@@ -2,25 +2,52 @@
> New as of 0.5.0 > New as of 0.5.0
Sometimes you need to run a command on at deployment time, but before an app is completely deployed. Sometimes you need to run a command on at deployment time, but before an app is completely deployed. Common use cases include:
Common use cases include:
* Checking a database is initialized * Checking a database is initialized
* Running database migrations * Running database migrations
* Any commands required to set up the server (e.g. something like a Django `collectstatic`) * 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). Each "phase" has different expectations and limitations:
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`.
> 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. Dockefile-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 ```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

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

View File

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

View File

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

View File

@@ -39,13 +39,13 @@ h1 {
font-size: 1.6em; font-size: 1.6em;
} }
.header .navbar-brand a { .header .navbar-brand a {
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/dokku.png); background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/dokku.png);
text-indent: 40px; text-indent: 40px;
} }
.blurb { .blurb {
color: #424242; color: #424242;
background-color: #ededed; background-color: #ededed;
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/gplaypattern.png); background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/gplaypattern.png);
padding: 45px 0; padding: 45px 0;
text-align: center; text-align: center;
} }
@@ -177,7 +177,8 @@ h1 {
.featurette img { .featurette img {
width: 400px; width: 400px;
} }
.slack-channel { .slack-channel,
.sponsors {
background-color: #EEF1F7; background-color: #EEF1F7;
font-size: 1.6em; font-size: 1.6em;
font-weight: 300; font-weight: 300;
@@ -199,28 +200,35 @@ h1 {
.slack-button img { .slack-button img {
height: 1em; height: 1em;
} }
.team-members img { .sponsors {
-moz-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75); background-color: #272822;
-webkit-border-radius: 3px; color: #FCFCFC;
-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;
} }
.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; display: block;
font-size: .8em; 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 { .list-group-item {
border: none; border: none;
font-size: 1.1em; font-size: 1.1em;

View File

@@ -10,6 +10,7 @@
"0.10.5", "0.10.5",
"0.11.6", "0.11.6",
"0.12.13", "0.12.13",
"0.13.2" "0.13.4",
"0.14.5"
] ]
} }

View File

@@ -88,12 +88,12 @@ dokku domains:report
``` ```
=====> node-js-app domains information =====> node-js-app domains information
Domains app enabled: true 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 enabled: true
Domains global vhosts: dokku.org Domains global vhosts: dokku.org
=====> python-sample domains information =====> python-sample domains information
Domains app enabled: true Domains app enabled: true
Domains app vhosts: ruby-sample.dokku.org Domains app vhosts: python-sample.dokku.org
Domains global enabled: true Domains global enabled: true
Domains global vhosts: dokku.org Domains global vhosts: dokku.org
=====> ruby-sample domains information =====> 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: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: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: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 ## Customizing the nginx configuration

View File

@@ -40,7 +40,7 @@ dokku postgres:create rails-database
### Linking backing services to applications ### 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 ```shell
# on the Dokku host # on the Dokku host

View File

@@ -149,9 +149,9 @@ dokku apps:clone node-js-app io-js-app
Cloning node-js-app to io-js-app... done 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. All of your config variables, including database urls, will be preserved. Custom domains and SSL certificates will not be copied to the new app.
> 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. > Warning: If you have exposed specific ports via docker-options, 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: By default, Dokku will deploy this new application, though you can skip the deploy by using the `--skip-deploy` flag:

View File

@@ -65,7 +65,9 @@ dokku/node-js-app v1 936a42f25901 About a minute ago
### Deploying an image tag ### 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 ```shell
dokku tags:deploy node-js-app v1 dokku tags:deploy node-js-app v1
@@ -161,7 +163,7 @@ docker build -t dokku/test-app:v12 .
# copy the image to the dokku host # copy the image to the dokku host
docker save dokku/test-app:v12 | bzip2 | ssh my.dokku.host "bunzip2 | docker load" docker save dokku/test-app:v12 | bzip2 | ssh my.dokku.host "bunzip2 | docker load"
# tag and deploy the image # 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 ## Related articles

View File

@@ -37,7 +37,7 @@ dokku ps node-js-app
> New as of 0.13.0 > 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 ```shell
dokku ps:inspect node-js-app dokku ps:inspect node-js-app

View File

@@ -559,6 +559,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO # 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` ### `post-app-rename`
- Description: Allows you to run commands after an app was renamed. - Description: Allows you to run commands after an app was renamed.

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: To propose a release, the following tasks need to be performed:
```shell ```shell
export PACKAGECLOUD_API_TOKEN=SOME_TOKEN export PACKAGECLOUD_TOKEN=SOME_TOKEN
# supports major/minor/patch/betafish # 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) 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 ```shell
# having dokku-arch in ../dokku-arch # having dokku-arch in ../dokku-arch
vagrant up build-arch vagrant up build-arch
# wait for "==> build-arch: ==> Finished making: dokku 0.13.2-2 (Mon Feb 22 23:20:37 CET 2016)" # wait for "==> build-arch: ==> Finished making: dokku 0.14.5-2 (Mon Feb 22 23:20:37 CET 2016)"
cd ../dokku-arch cd ../dokku-arch
git add PKGBUILD .SRCINFO git add PKGBUILD .SRCINFO
git commit -m 'Update to dokku 0.9.9' git commit -m 'Update to dokku 0.9.9'

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. 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

@@ -2,10 +2,10 @@
- If you don't already have one [generate an SSH key pair](https://help.github.com/articles/generating-ssh-keys/). - 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**. - 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. - 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.
- 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. - 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`. - 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,6 +1,6 @@
# Debian Package Installation Notes # 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 ```shell
# install prerequisites # install prerequisites
@@ -11,7 +11,7 @@ sudo apt-get install -qq -y apt-transport-https
wget -nv -O - https://get.docker.com/ | sh wget -nv -O - https://get.docker.com/ | sh
# install dokku # install dokku
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add - wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -
OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")" 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 "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 echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ ${OS_ID} main" | sudo tee /etc/apt/sources.list.d/dokku.list
@@ -22,7 +22,7 @@ sudo dokku plugin:install-dependencies --core
## Unattended installation ## 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: 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 | | Name | Type | Default | Description |
| ------------------ | ------- | --------------------- | ------------------------------------------------------------------------ | | ------------------ | ------- | --------------------- | ------------------------------------------------------------------------ |
| dokku/web_config | boolean | true | Use web-based config for below options | | 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/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
| dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. | | dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. |
| dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) | | dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) |

View File

@@ -1,22 +1,22 @@
# Digital Ocean Droplet # Digital Ocean 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. [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.
> **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 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/).
1. Login to your [Digital Ocean](https://m.do.co/c/fe06b043a083) account 1. Login to your [Digital Ocean](https://m.do.co/c/fe06b043a083) account.
2. Click **Create a Droplet**. 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)_. 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. 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. 5. Under **Choose a datacenter region** select your region.
6. Add an SSH Key 6. Add an SSH Key.
* New Keys * New Keys
1. Under **Add your SSH keys** click **New SSH Key** _(this opens a dialog)_ 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` 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** 3. Copy the output and paste it into the **New SSH Key** dialog, provide a name and click **Add SSH Key**.
* Existing Keys * Existing Keys
1. Simply add a checkmark next to the existing keys you'd like to add. 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. 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.** 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. 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). changes).
A new server instance can be created on DreamHost Cloud from the command line 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 using OpenStack client or from the web UI and with the same command
use a cloud-init script to install Dokku. Install the [openstack 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), CLI](https://help.dreamhost.com/hc/en-us/articles/216185658-How-to-Install-the-OpenStack-command-line-clients),
download the [DreamHost Cloud credentials download the [DreamHost Cloud credentials
file](https://iad2.dreamcompute.com/project/access_and_security/api_access/openrc/) 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 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 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` 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 based on Ubuntu 14.04, with 2GB RAM and 1CPU (the flavor called
`supersonic`), opening network port access to http and ssh (the `supersonic`), opening network port access to HTTP and SSH (the
`default` security group), and the name of the chosen SSH key. This `default` security group), and the name of the chosen SSH key. This
key will be automatically added to the new server in the key will be automatically added to the new server in the
`authorized_keys` for the default SSH user (`ubuntu`), and it will `authorized_keys` for the default SSH user (`ubuntu`), and it will

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. >**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 ```shell
# Install docker # Install docker

View File

@@ -34,11 +34,10 @@
Port 22 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. - 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. You are now ready to deploy an app or install plugins.

View File

@@ -17,12 +17,12 @@ Dokku is designed for usage on a fresh VM installation, and should install all n
#### 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 ```shell
# for debian systems, installs Dokku via apt-get # for debian systems, installs Dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.13.2/bootstrap.sh; wget https://raw.githubusercontent.com/dokku/dokku/v0.14.5/bootstrap.sh;
sudo DOKKU_TAG=v0.13.2 bash bootstrap.sh sudo DOKKU_TAG=v0.14.5 bash bootstrap.sh
``` ```
The installation process takes about 5-10 minutes, depending upon internet connection speed. The installation process takes about 5-10 minutes, depending upon internet connection speed.

View File

@@ -10,32 +10,61 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title> <title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/manifest.json"> <link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/favicon.ico"> <link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku"> <meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku"> <meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/mstile-144x144.png"> <meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/favicons/browserconfig.xml"> <meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/dokku/dokku/v0.13.2/docs/assets/style.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.14.5/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> --> <!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<style> <style>
.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> </style>
</head> </head>
<body> <body>
@@ -98,12 +127,12 @@
<p class="line"> <p class="line">
<span class="path"></span> <span class="path"></span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.13.2/bootstrap.sh</span> <span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.14.5/bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="path"></span> <span class="path"></span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.13.2 bash bootstrap.sh</span> <span class="command">sudo DOKKU_TAG=v0.14.5 bash bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span> <span class="output">&nbsp;# go to your server's IP and follow the web installer</span>
@@ -125,7 +154,7 @@
<p class="line"> <p class="line">
<span class="path"></span> <span class="path"></span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">wget -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>
<p class="line"> <p class="line">
<span class="path"></span> <span class="path"></span>
@@ -236,40 +265,54 @@
</div> </div>
</div> </div>
<div class="container-fluid slack-channel team-members"> <div class="container-fluid slack-channel sponsors">
<h3>Meet the core team</h3> <h3>Sponsor Dokku</h3>
<div class="row"> <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="col-md-12">
<div class="team-member-image">
<img src="./assets/team/progrium-hidden.jpg" alt="Jeff Lindsay"> <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>
<img src="./assets/team/progrium.jpg" alt="Jeff Lindsay">
</div> <p class="sponsor">
Jeff Lindsay <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 class="fund-link" href="https://www.patreon.com/progrium">Sponsor people they sponsor</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>
</div> <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>
<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"> <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>
<div class="team-member-image"> </p>
<img src="./assets/team/josegonzalez-hidden.jpg" alt="Morris Jobke">
<img src="./assets/team/josegonzalez.jpg" alt="Morris Jobke"> <p class="backer">
</div> <a href="https://opencollective.com/dokku/backer/0/website" target="_blank"><img src="https://opencollective.com/dokku/backer/0/avatar.svg"></a>
Jose Diaz-Gonzalez <a href="https://opencollective.com/dokku/backer/1/website" target="_blank"><img src="https://opencollective.com/dokku/backer/1/avatar.svg"></a>
<a class="fund-link" href="http://www.amazon.com/registry/wishlist/36RYHSXCFYDTG/">Buy him something nice</a> <a href="https://opencollective.com/dokku/backer/2/website" target="_blank"><img src="https://opencollective.com/dokku/backer/2/avatar.svg"></a>
</div> <a href="https://opencollective.com/dokku/backer/3/website" target="_blank"><img src="https://opencollective.com/dokku/backer/3/avatar.svg"></a>
<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"> <a href="https://opencollective.com/dokku/backer/4/website" target="_blank"><img src="https://opencollective.com/dokku/backer/4/avatar.svg"></a>
<div class="team-member-image"> <a href="https://opencollective.com/dokku/backer/5/website" target="_blank"><img src="https://opencollective.com/dokku/backer/5/avatar.svg"></a>
<img src="./assets/team/michaelshobbs-hidden.jpg" alt="Michael Hobbs"> <a href="https://opencollective.com/dokku/backer/6/website" target="_blank"><img src="https://opencollective.com/dokku/backer/6/avatar.svg"></a>
<img src="./assets/team/michaelshobbs.jpg" alt="Michael Hobbs"> <a href="https://opencollective.com/dokku/backer/7/website" target="_blank"><img src="https://opencollective.com/dokku/backer/7/avatar.svg"></a>
</div> <a href="https://opencollective.com/dokku/backer/8/website" target="_blank"><img src="https://opencollective.com/dokku/backer/8/avatar.svg"></a>
Michael Hobbs <a href="https://opencollective.com/dokku/backer/9/website" target="_blank"><img src="https://opencollective.com/dokku/backer/9/avatar.svg"></a>
<a class="fund-link" href="https://gratipay.com/~michaelshobbs/">Fund on gratipay</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>
</div> </div>
<div class="container"> <div class="container">
<footer> <footer>
<p>&copy; 2013-2018 Dokku</p> <p>&copy; 2013-2019 Dokku</p>
</footer> </footer>
</div> </div>
<script> <script>

View File

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

39
dokku
View File

@@ -31,7 +31,10 @@ export DOKKU_HOST_ROOT=${DOKKU_HOST_ROOT:=$DOKKU_ROOT}
export DOKKU_DISTRO export DOKKU_DISTRO
# shellcheck disable=SC1091 # 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_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"} export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
@@ -103,7 +106,7 @@ if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
fi fi
fi fi
if ! dokku_auth "$@" ; then if ! dokku_auth "$@"; then
dokku_log_fail "Access denied" dokku_log_fail "Access denied"
exit 1 exit 1
fi fi
@@ -112,25 +115,26 @@ execute_dokku_cmd() {
declare desc="executes dokku sub-commands" declare desc="executes dokku sub-commands"
local PLUGIN_NAME="$1" local PLUGIN_NAME="$1"
local PLUGIN_CMD=$PLUGIN_NAME local PLUGIN_CMD=$PLUGIN_NAME
local implemented=0; local script local implemented=0
local script
local argv=("$@") local argv=("$@")
case "$PLUGIN_NAME" in case "$PLUGIN_NAME" in
events|events:*) events | events:*)
local PLUGIN_NAME=${PLUGIN_NAME/events/20_events} local PLUGIN_NAME=${PLUGIN_NAME/events/20_events}
;; ;;
nginx|nginx:*) nginx | nginx:*)
local PLUGIN_NAME=${PLUGIN_NAME/nginx/nginx-vhosts} local PLUGIN_NAME=${PLUGIN_NAME/nginx/nginx-vhosts}
;; ;;
deploy|delete|ls|run|cleanup) deploy | delete | ls | run | cleanup)
local PLUGIN_NAME="00_dokku-standard" local PLUGIN_NAME="00_dokku-standard"
;; ;;
trace|url|urls|report|version) trace | url | urls | report | version)
local PLUGIN_NAME="00_dokku-standard" local PLUGIN_NAME="00_dokku-standard"
;; ;;
esac 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 [[ ${argv[0]} == "$PLUGIN_CMD" ]] && shift 1
if [[ ! -z $DOKKU_APP_NAME ]]; then if [[ ! -z $DOKKU_APP_NAME ]]; then
if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then
@@ -154,9 +158,12 @@ execute_dokku_cmd() {
implemented=1 implemented=1
fi fi
if [[ $implemented -eq 0 ]];then if [[ $implemented -eq 0 ]]; then
for script in $PLUGIN_ENABLED_PATH/*/commands; do 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 if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
continue continue
fi fi
@@ -175,18 +182,18 @@ execute_dokku_cmd() {
} }
case "$1" in case "$1" in
help|'') help | '')
export LC_ALL=C # so sort will respect non alpha characters 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 # 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 if [[ "$(readlink -f "$plugin_command")" == *core-plugins* ]]; then
CORE_PLUGIN_COMMANDS+="$plugin_command " CORE_PLUGIN_COMMANDS+="$plugin_command "
fi fi
done done
# build list of non-core plugin command files # 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 if [[ "$(readlink -f "$plugin_command")" != *core-plugins* ]]; then
COMMUNITY_PLUGIN_COMMANDS+="$plugin_command " COMMUNITY_PLUGIN_COMMANDS+="$plugin_command "
fi fi
@@ -200,7 +207,7 @@ case "$1" in
dokku_log_quiet "Commands:" dokku_log_quiet "Commands:"
dokku_log_quiet "" dokku_log_quiet ""
if [[ "$2" == "--all" ]] ; then if [[ "$2" == "--all" ]]; then
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
$core_plugin_command help $core_plugin_command help
done | sort | column -c2 -t -s, done | sort | column -c2 -t -s,
@@ -213,7 +220,7 @@ case "$1" in
else else
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
$core_plugin_command help $core_plugin_command help
# When done, sort, sed cuts arugments out of strings and colum make it pretty # When done, sort, sed cuts arugments out of strings and colum make it pretty
done | sort | sed -e '/^.*:/d' -e 's/\s[\[\<\-\(].*,/,/' | column -c2 -t -s, done | sort | sed -e '/^.*:/d' -e 's/\s[\[\<\-\(].*,/,/' | column -c2 -t -s,
if [[ -n "$COMMUNITY_PLUGIN_COMMANDS" ]]; then if [[ -n "$COMMUNITY_PLUGIN_COMMANDS" ]]; then
dokku_log_quiet "" dokku_log_quiet ""

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
[plugin] [plugin]
description = "dokku core standard plugin" description = "dokku core standard plugin"
version = "0.13.2" version = "0.14.5"
[plugin.config] [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 #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_cleanup_cmd() { dokku_cleanup_cmd() {
@@ -8,8 +9,11 @@ dokku_cleanup_cmd() {
[[ "$1" == "$cmd" ]] && shift 1 [[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" declare APP="$1"
if [[ -z "$APP" ]]; then
APP="--global"
fi
docker_cleanup "$APP" "true" docker_cleanup "$APP" "true"
} }
dokku_cleanup_cmd "$@" dokku_cleanup_cmd "$@"

View File

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

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_report_cmd() { dokku_report_cmd() {
@@ -16,12 +17,16 @@ dokku_report_cmd() {
docker -D info | sed "s/^/ /" docker -D info | sed "s/^/ /"
dokku_log_info1 "sigil version: $(sigil -v)" dokku_log_info1 "sigil version: $(sigil -v)"
dokku_log_info1 "herokuish version: " 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 version: $(dokku version)"
dokku_log_info1 "dokku plugins: " dokku_log_info1 "dokku plugins: "
dokku plugin:list | sed "s/^/ /" 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" plugn trigger report "$APP"
fi fi
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1 @@
hook

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
events_on_cmd() { events_on_cmd() {
@@ -7,7 +8,7 @@ events_on_cmd() {
local cmd="events:on" local cmd="events:on"
echo "Enabling dokku events logger" echo "Enabling dokku events logger"
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc" [[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc"
echo "export DOKKU_EVENTS=1" > "$DOKKU_ROOT/.dokkurc/DOKKU_EVENTS" echo "export DOKKU_EVENTS=1" >"$DOKKU_ROOT/.dokkurc/DOKKU_EVENTS"
} }
events_on_cmd "$@" events_on_cmd "$@"

View File

@@ -0,0 +1,122 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
get_phase_script() {
declare desc="extracts app.json from app image and returns the appropriate json key/value"
declare IMAGE_TAG="$1" PHASE_SCRIPT_KEY="$2"
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_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
return 0
fi
get_json_value "scripts.dokku.${PHASE_SCRIPT_KEY}" <"$APP_JSON_FILE"
}
get_release_cmd() {
declare desc="extracts the release command from a given app's procfile"
declare APP="$1" IMAGE_TAG="$2"
extract_procfile "$APP" "$IMAGE_TAG" >/dev/null
trap 'remove_procfile $APP' RETURN INT TERM EXIT
get_cmd_from_procfile "$APP" "release" "5000"
}
execute_script() {
declare desc="executes appropriate phase script key from app.json"
declare APP="$1" IMAGE_TAG="$2" PHASE_SCRIPT_KEY="$3"
local IMAGE id SCRIPT_CMD
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
if [[ "$PHASE_SCRIPT_KEY" == "release" ]]; then
SCRIPT_CMD=$(get_release_cmd "$APP" "$IMAGE" 2>/dev/null || true)
else
SCRIPT_CMD=$(get_phase_script "$IMAGE" "$PHASE_SCRIPT_KEY" 2>/dev/null || true)
fi
if [[ -z "$SCRIPT_CMD" ]]; then
return
fi
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")" -ne 0; then
dokku_container_log_verbose_quiet "$id"
dokku_log_fail "execution of '$SCRIPT_CMD' failed!"
fi
dokku_container_log_verbose_quiet "$id"
if [[ "$PHASE_SCRIPT_KEY" != "predeploy" ]]; then
return
fi
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
}

View File

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

17
plugins/app-json/post-deploy Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/app-json/internal-functions"
app_json_post_deploy() {
declare desc="app-json scripts execution"
local trigger="app_json_post_deploy"
local APP="$1"
local IMAGE_TAG="$4"
local PHASE_SCRIPT_KEY="postdeploy"
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
}
app_json_post_deploy "$@"

18
plugins/app-json/pre-deploy Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/app-json/internal-functions"
app_json_pre_deploy() {
declare desc="app-json scripts execution"
local trigger="app_json_pre_deploy"
local APP="$1"
local IMAGE_TAG="$2"
local PHASE_SCRIPT_KEY="predeploy"
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
execute_script "$APP" "$IMAGE_TAG" "release"
}
app_json_pre_deploy "$@"

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " help apps:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" [[ " help apps:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
case "$1" in case "$1" in
help | apps:help) help | apps:help)

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions"
@@ -8,7 +9,7 @@ apps_create() {
declare APP="$1" declare APP="$1"
is_valid_app_name "$APP" is_valid_app_name "$APP"
apps_exists "$APP" > /dev/null 2>&1 && dokku_log_fail "Name is already taken" apps_exists "$APP" >/dev/null 2>&1 && dokku_log_fail "Name is already taken"
mkdir -p "$DOKKU_ROOT/$APP" mkdir -p "$DOKKU_ROOT/$APP"
dokku_log_info1_quiet "Creating $APP... done" dokku_log_info1_quiet "Creating $APP... done"
@@ -17,7 +18,7 @@ apps_create() {
apps_destroy() { apps_destroy() {
declare desc="destroys an app" declare desc="destroys an app"
declare APP="$1"; declare APP="$1"
verify_app_name "$APP" verify_app_name "$APP"
local IMAGE_TAG=$(get_running_image_tag "$APP") local IMAGE_TAG=$(get_running_image_tag "$APP")
@@ -54,7 +55,7 @@ apps_maybe_create() {
declare desc="creates an app dir if allowed" declare desc="creates an app dir if allowed"
declare APP="$1" declare APP="$1"
if ! apps_exists "$APP" > /dev/null 2>&1; then if ! apps_exists "$APP" >/dev/null 2>&1; then
DOKKU_GLOBAL_DISABLE_AUTOCREATE="$(config_get --global DOKKU_DISABLE_APP_AUTOCREATION || true)" DOKKU_GLOBAL_DISABLE_AUTOCREATE="$(config_get --global DOKKU_DISABLE_APP_AUTOCREATION || true)"
if [[ "$DOKKU_GLOBAL_DISABLE_AUTOCREATE" == "true" ]]; then if [[ "$DOKKU_GLOBAL_DISABLE_AUTOCREATE" == "true" ]]; then
dokku_log_warn "App auto-creation disabled." dokku_log_warn "App auto-creation disabled."

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
cmd-apps-report() { cmd-apps-report() {
declare desc="displays the app report for one or more apps" declare desc="displays the app report for one or more apps"
@@ -30,7 +31,7 @@ cmd-apps-report() {
cmd-apps-report-single() { cmd-apps-report-single() {
declare APP="$1" INFO_FLAG="$2" declare APP="$1" INFO_FLAG="$2"
local APP_DIR="$DOKKU_ROOT/$APP" local APP_DIR="$DOKKU_ROOT/$APP"
local use_echo; local use_echo
if [[ "$INFO_FLAG" == "true" ]]; then if [[ "$INFO_FLAG" == "true" ]]; then
use_echo=true use_echo=true
INFO_FLAG="" INFO_FLAG=""
@@ -38,7 +39,7 @@ cmd-apps-report-single() {
verify_app_name "$APP" verify_app_name "$APP"
local flag_map=( local flag_map=(
"--app-dir: $APP_DIR" "--app-dir: $APP_DIR"
"--git-sha: $(GIT_DIR="$APP_DIR" git rev-parse --short HEAD 2> /dev/null || false)" "--git-sha: $(GIT_DIR="$APP_DIR" git rev-parse --short HEAD 2>/dev/null || false)"
"--deploy-source: $(: | plugn trigger deploy-source "$APP")" "--deploy-source: $(: | plugn trigger deploy-source "$APP")"
"--locked: $(apps_is_locked "$APP")" "--locked: $(apps_is_locked "$APP")"
) )
@@ -54,11 +55,12 @@ cmd-apps-report-single() {
if [[ "$use_echo" ]]; then if [[ "$use_echo" ]]; then
echo "not deployed" echo "not deployed"
else else
dokku_log_fail "not deployed" dokku_log_exit "not deployed"
fi fi
fi fi
else else
local match=false; local value_exists=false local match=false
local value_exists=false
for flag in "${flag_map[@]}"; do for flag in "${flag_map[@]}"; do
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)" valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
@@ -76,10 +78,9 @@ cmd-apps-report-single() {
fi fi
} }
apps_help_content_func() { apps_help_content_func() {
declare desc="return apps plugin help content" declare desc="return apps plugin help content"
cat<<help_content cat <<help_content
apps, [DEPRECATED] Alias for apps:list apps, [DEPRECATED] Alias for apps:list
apps:clone <old-app> <new-app>, Clones an app apps:clone <old-app> <new-app>, Clones an app
apps:create <app>, Create a new app apps:create <app>, Create a new app
@@ -94,7 +95,7 @@ help_content
} }
apps_help_cmd() { apps_help_cmd() {
if [[ $1 = "apps:help" ]] ; then if [[ $1 == "apps:help" ]]; then
echo -e 'Usage: dokku apps[:COMMAND]' echo -e 'Usage: dokku apps[:COMMAND]'
echo '' echo ''
echo 'Manage Dokku apps' echo 'Manage Dokku apps'
@@ -111,7 +112,7 @@ apps_help_cmd() {
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
apps_help_content_func apps_help_content_func
else else
cat<<help_desc cat <<help_desc
apps, Manage Dokku apps apps, Manage Dokku apps
help_desc help_desc
fi fi

View File

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

View File

@@ -1,16 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
app_post_delete() { app_post_delete() {
declare desc="apps post-delete plugin trigger" declare desc="apps post-delete plugin trigger"
local trigger="app_post_delete" local trigger="app_post_delete"
local APP="$1"; local IMAGE_REPO=$(get_app_image_repo "$APP") local APP="$1"
local IMAGE_REPO=$(get_app_image_repo "$APP")
if [[ -n $APP ]]; then if [[ -n $APP ]]; then
# remove contents for apps that are symlinks to other folders # remove contents for apps that are symlinks to other folders
rm -rf "${DOKKU_ROOT:?}/$APP/" > /dev/null rm -rf "${DOKKU_ROOT:?}/$APP/" >/dev/null
# then remove the folder and/or the symlink # then remove the folder and/or the symlink
rm -rf "${DOKKU_ROOT:?}/$APP" > /dev/null rm -rf "${DOKKU_ROOT:?}/$APP" >/dev/null
fi fi
# shellcheck disable=SC2046 # shellcheck disable=SC2046

View File

@@ -1,11 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
apps_pre_delete() { apps_pre_delete() {
declare desc="apps pre-delete plugin trigger" declare desc="apps pre-delete plugin trigger"
local trigger="apps_pre_delete" local trigger="apps_pre_delete"
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache"; local CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$APP/cache" local APP="$1"
local IMAGE_TAG="$2"
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
local CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$APP/cache"
verify_app_name "$APP" verify_app_name "$APP"
if ! is_image_herokuish_based "$IMAGE"; then if ! is_image_herokuish_based "$IMAGE"; then

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
cmd-apps-report-single "$@" cmd-apps-report-single "$@"

View File

@@ -1,12 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions"
apps_clone_cmd() { apps_clone_cmd() {
declare desc="clones an app" declare desc="clones an app"
declare cmd="apps:clone" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1 declare cmd="apps:clone" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare OLD_APP="$1" NEW_APP="$2" declare OLD_APP="$1" NEW_APP="$2"
local IGNORE_EXISTING=false local IGNORE_EXISTING=false
local SKIP_REBUILD=false local SKIP_REBUILD=false
@@ -22,8 +24,8 @@ apps_clone_cmd() {
is_valid_app_name "$OLD_APP" is_valid_app_name "$OLD_APP"
is_valid_app_name "$NEW_APP" is_valid_app_name "$NEW_APP"
apps_exists "$OLD_APP" > /dev/null 2>&1 || dokku_log_fail "App does not exist" apps_exists "$OLD_APP" >/dev/null 2>&1 || dokku_log_fail "App does not exist"
if apps_exists "$NEW_APP" > /dev/null 2>&1; then if apps_exists "$NEW_APP" >/dev/null 2>&1; then
if [[ "$IGNORE_EXISTING" == true ]]; then if [[ "$IGNORE_EXISTING" == true ]]; then
dokku_log_warn "Name is already taken" dokku_log_warn "Name is already taken"
return return
@@ -36,21 +38,20 @@ apps_clone_cmd() {
local NEW_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$NEW_APP/cache" local NEW_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$NEW_APP/cache"
apps_create "$NEW_APP" apps_create "$NEW_APP"
pushd "$DOKKU_ROOT/$OLD_APP/." > /dev/null pushd "$DOKKU_ROOT/$OLD_APP/." >/dev/null
find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP" find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP"
popd > /dev/null 2>&1 || pushd "/tmp" > /dev/null popd >/dev/null 2>&1 || pushd "/tmp" >/dev/null
plugn trigger post-app-clone-setup "$OLD_APP" "$NEW_APP"
if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi fi
rm -rf "$NEW_CACHE_DIR" rm -rf "$NEW_CACHE_DIR"
[[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
[[ -f "$DOKKU_ROOT/$NEW_APP/VHOST" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST"
[[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" [[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
[[ "$SKIP_REBUILD" == "true" ]] || ps_rebuild "$NEW_APP" [[ "$SKIP_REBUILD" == "true" ]] || ps_rebuild "$NEW_APP"
plugn trigger post-app-clone "$OLD_APP" "$NEW_APP" plugn trigger post-app-clone "$OLD_APP" "$NEW_APP"
echo "Cloning $OLD_APP to $NEW_APP... done" dokku_log_info1_quiet "Cloning $OLD_APP to $NEW_APP... done"
} }
apps_clone_cmd "$@" apps_clone_cmd "$@"

View File

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

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
dokku_log_warn "Deprecated: Please use apps:list" dokku_log_warn "Deprecated: Please use apps:list"

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
@@ -7,7 +8,8 @@ apps_lock_cmd() {
declare desc="locks an app for deployment" declare desc="locks an app for deployment"
declare cmd="apps:lock" declare cmd="apps:lock"
[[ "$1" == "$cmd" ]] && shift 1 [[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"; verify_app_name "$APP" declare APP="$1"
verify_app_name "$APP"
touch "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to create deploy lock" touch "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to create deploy lock"

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
@@ -7,10 +8,11 @@ apps_locked_cmd() {
declare desc="checks if an app is locked for deployment" declare desc="checks if an app is locked for deployment"
declare cmd="apps:locked" declare cmd="apps:locked"
[[ "$1" == "$cmd" ]] && shift 1 [[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"; verify_app_name "$APP" declare APP="$1"
verify_app_name "$APP"
local LOCKED="$(apps_is_locked "$APP")" local LOCKED="$(apps_is_locked "$APP")"
if [[ "$LOCKED" != "true" ]] ; then if [[ "$LOCKED" != "true" ]]; then
dokku_log_fail_quiet "Deploy lock does not exist" dokku_log_fail_quiet "Deploy lock does not exist"
fi fi

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions"
@@ -14,7 +15,7 @@ apps_rename_cmd() {
local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache" local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache"
local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache" local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache"
if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" > /dev/null 2>&1; then if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" >/dev/null 2>&1; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi fi
rm -rf "$OLD_CACHE_DIR" rm -rf "$OLD_CACHE_DIR"

View File

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

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
@@ -7,11 +8,12 @@ apps_unlock_cmd() {
declare desc="unlocks an app for deployment" declare desc="unlocks an app for deployment"
declare cmd="apps:unlock" declare cmd="apps:unlock"
[[ "$1" == "$cmd" ]] && shift 1 [[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"; verify_app_name "$APP" declare APP="$1"
verify_app_name "$APP"
if [[ -f "$DOKKU_ROOT/$APP/.deploy.lock" ]]; then if [[ -f "$DOKKU_ROOT/$APP/.deploy.lock" ]]; then
dokku_log_warn "A deploy may be in progress." dokku_log_warn "A deploy may be in progress."
dokku_log_warn "Removing the app lock will not stop in progress deploys." dokku_log_warn "Removing the app lock will not stop in progress deploys."
fi fi
rm -f "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to remove deploy lock" rm -f "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to remove deploy lock"

View File

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

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions"
@@ -10,7 +11,7 @@ build_env_pre_build_buildpack() {
local IMAGE id local IMAGE id
verify_app_name "$APP" verify_app_name "$APP"
IMAGE=$(get_app_image_name "$APP"); IMAGE=$(get_app_image_name "$APP")
[[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=90 [[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=90
[[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=600 [[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=600
@@ -20,12 +21,12 @@ build_env_pre_build_buildpack() {
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34 # https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
id=$(config_bundle --merged "$APP" | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env") id=$(config_bundle --merged "$APP" | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env")
test "$(docker wait "$id")" -eq 0 test "$(docker wait "$id")" -eq 0
docker commit "$id" "$IMAGE" > /dev/null docker commit "$id" "$IMAGE" >/dev/null
# create build env for 'old style' buildpacks and dokku plugins # create build env for 'old style' buildpacks and dokku plugins
id=$(config_export app "$APP" --format envfile --merged | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env") id=$(config_export app "$APP" --format envfile --merged | docker run "$DOKKU_GLOBAL_RUN_ARGS" -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env")
test "$(docker wait "$id")" -eq 0 test "$(docker wait "$id")" -eq 0
docker commit "$id" "$IMAGE" > /dev/null docker commit "$id" "$IMAGE" >/dev/null
} }
build_env_pre_build_buildpack "$@" build_env_pre_build_buildpack "$@"

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " help certs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" [[ " help certs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions" source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
case "$1" in case "$1" in
help | certs:help) help | certs:help)

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