Compare commits

...

205 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
a0e1416027 Release 0.4.12 2016-01-16 17:21:44 -05:00
Justin Clark
c79a43f38a Merge pull request #1870 from u2mejc/u2mejc-issue1869
Remove arg check from docker-options/functions, global var cleanup
2016-01-15 17:15:42 -08:00
Justin Clark
3630cc2a99 Remove arg check from docker-options/functions, remove another global var 2016-01-15 14:45:29 -08:00
Jose Diaz-Gonzalez
309cdc6ab6 Merge pull request #1868 from alessio/fix-events-help-screen
Prevent dokku to hang on events:help
2016-01-15 15:35:26 -05:00
Alessio Treglia
2b7e327e09 Prevent dokku to hang on events:help
Update events:help case against to Dokku 0.4's new help screen
handling.
2016-01-15 20:28:16 +00:00
Jose Diaz-Gonzalez
db300f06da Release 0.4.11 2016-01-14 19:59:11 -05:00
Jose Diaz-Gonzalez
a2b775af42 Merge pull request #1855 from jvanbaarsen/add-skip-keyfile
Add skip_keyfile option for deb package
2016-01-14 17:53:56 -05:00
Michael Hobbs
999cbc0739 Merge pull request #1864 from znz/no-longer-need-to-set-nullglob
no longer need to set nullglob
2016-01-14 08:12:37 -08:00
Jose Diaz-Gonzalez
eb9d659361 Merge pull request #1863 from znz/fix-a-typo
Fix a typo
2016-01-14 10:14:07 -05:00
Kazuhiro NISHIYAMA
99ce2fa51d no longer need to set nullglob 2016-01-14 23:34:03 +09:00
Kazuhiro NISHIYAMA
d3a6e39b4e Fix a typo 2016-01-14 23:30:10 +09:00
Michael Hobbs
bc00acb5ff Merge pull request #1848 from u2mejc/u2mejc_docker-options_functions
Move docker-options functions to functions file, rework phase_file_path
2016-01-13 11:28:00 -08:00
Justin Clark
9a966f6f08 Move docker-options functions to functions file, rework code 2016-01-13 10:48:52 -08:00
Michael Hobbs
34a5766ce3 Merge pull request #1862 from dokku/mh-update-circleci-bash
install bash 4.3.x on circleci
2016-01-12 20:12:04 -08:00
Michael Hobbs
be9ab06116 install bash 4.3.x on circleci 2016-01-12 18:58:43 -08:00
Jeroen van Baarsen
2a4155aefc Add skip_keyfile option for deb package
There are cases where we don't want the check for keyfile, this will add a
config option, that allows you to skip this particular check.

Fixes #1851

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2016-01-12 17:11:13 +01:00
Jose Diaz-Gonzalez
4dde70abdc Merge pull request #1859 from dhinus/dhinus-patch-1
Fix command for debconf-set-selections
2016-01-12 08:06:05 -05:00
Francesco Negri
7eeb6a2b95 Fix command for debconf-set-selections 2016-01-12 13:00:06 +00:00
Jose Diaz-Gonzalez
6931c3df5a Merge pull request #1856 from madflow/docker-options-404
Fixed dead documentation link
2016-01-11 11:28:34 -05:00
madflow
0ad650fb91 Fixed dead documentation link 2016-01-11 17:04:46 +01:00
Jose Diaz-Gonzalez
72135f8fbf Merge pull request #1854 from fedosov/patch-1
Update year in footer (2013-2016)
2016-01-10 14:16:15 -05:00
Mikhail Fedosov
546522264e Update year in footer (2013-2016) 2016-01-10 22:03:23 +03:00
Jose Diaz-Gonzalez
353f96cb93 Merge pull request #1849 from floriangosse/fix-debian-log-user
Fix logrotate file for debian system
2016-01-09 08:01:48 -05:00
Florian Goße
7a72146e82 modify logrotate file if the distro is debian 2016-01-09 11:35:47 +01:00
Jose Diaz-Gonzalez
f3627d4f84 Merge pull request #1841 from dokku/1806_mh-nginx-build-config-no-deploy
don't build nginx config if the app has not been deployed
2016-01-08 20:03:27 -05:00
Michael Hobbs
d98ed122a6 Merge pull request #1844 from dokku/mh-named-containers
named-containers: handle multiple old containers and don't attempt to rename a dead container
2016-01-07 20:19:31 -08:00
Michael Hobbs
30be9b7959 Merge pull request #1845 from dokku/mh-update-node-test-apps
update nodejs in test apps
2016-01-07 20:19:14 -08:00
Michael Hobbs
8562afde38 disable debug on docker daemon to avoid additional IO 2016-01-07 19:43:56 -08:00
Michael Hobbs
09936b37fa update nodejs in test apps 2016-01-07 18:00:12 -08:00
Michael Hobbs
8051fb86e7 named-containers: handle multiple old containers and don't attempt to rename a dead container 2016-01-07 17:56:27 -08:00
Jose Diaz-Gonzalez
c29ae712f3 Merge pull request #1843 from sseemayer/master
Move let's encrypt plugin to official plugins
2016-01-07 15:26:37 -05:00
Stefan Seemayer
88b0fc5d22 Move let's encrypt plugin to official plugins 2016-01-07 21:22:11 +01:00
Michael Hobbs
889555bb43 fix typo with DOKKU_SKIP_CLEANUP 2016-01-07 10:34:40 -08:00
Michael Hobbs
50194e5923 don't build nginx config if the app has not been deployed. closes #1806 2016-01-07 10:25:47 -08:00
Michael Hobbs
bfecd3beb4 Merge pull request #1842 from dokku/mh-skip-cleanup-in-ci
skip cleanup in ci to speed up tests
2016-01-07 10:25:27 -08:00
Michael Hobbs
74fd7e22d0 skip cleanup in ci to speed up tests 2016-01-07 09:53:04 -08:00
Jose Diaz-Gonzalez
2b97d9d677 Merge pull request #1840 from alessio/fix-dokku-0.4-events
Append trailing slash '/' to $PLUGIN_DIR
2016-01-07 06:49:52 -05:00
Alessio Treglia
546010246c Append trailing slash '/' to $PLUGIN_DIR
This is to prevent find's misbehaviours which
lead events:list to output incorrent information.

Fixes #1839
2016-01-07 11:46:53 +00:00
Jose Diaz-Gonzalez
f002a662bd Merge pull request #1838 from Epigene/patch-1
Fixed typo
2016-01-07 06:25:15 -05:00
Augusts Bautra
fde47dfa80 Fixed typo 2016-01-07 13:21:43 +02:00
Jose Diaz-Gonzalez
f7e8c9be90 Release 0.4.10 2016-01-07 01:14:09 -05:00
Michael Hobbs
606e27653f Merge pull request #1837 from dokku/mh-add-some-deploy-tests
add back some deploy tests that test dokku functionality
2016-01-06 21:27:50 -08:00
Michael Hobbs
28633003d5 fix docker version and add back some deploy tests that test dokku functionality 2016-01-06 20:53:08 -08:00
Jose Diaz-Gonzalez
dcf9e0ae58 Merge pull request #1835 from dokku/josegonzalez-patch-1
Add support for more versions of docker-engine
2016-01-06 16:51:04 -05:00
Jose Diaz-Gonzalez
5b526a52fc Add support for more versions of docker-engine
[ci skip]
2016-01-06 13:34:09 -05:00
Michael Hobbs
729a2246c6 [ci skip] cleanup some language in test docs. add reference to copyfile target. closes #1833 2016-01-06 08:11:50 -08:00
Michael Hobbs
c8c3381dd6 Merge pull request #1834 from jvanbaarsen/ignore-osx-hidden-files
Make sure we ignore hidden files in the SSL cert check
2016-01-06 07:58:35 -08:00
Jeroen van Baarsen
9767b90826 Make sure we ignore hidden files in the SSL cert check
OSX creates hidden files: `./._server.key` and `./._server.crt`. The Dokku cert
plugin is choking on those files. We should probably just ignore them, and go on
with our lives

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2016-01-06 14:36:07 +01:00
Michael Hobbs
68b02c40a7 Merge pull request #1827 from dokku/mh-use-docker-circleci-1.9.x
use docker 1.9.0 on circleci
2016-01-05 13:05:11 -08:00
Michael Hobbs
16544a77e2 Merge pull request #1828 from dokku/mh-label-dokku-containers
label all dokku containers
2016-01-05 12:39:24 -08:00
Michael Hobbs
1c6916c68f Merge pull request #1829 from dokku/mh-dokku-report
implement dokku report command
2016-01-05 12:25:45 -08:00
Michael Hobbs
d7b5d6e904 [ci skip] implement dokku report command 2016-01-05 12:24:07 -08:00
Michael Hobbs
fdefff329a [ci skip] docs cleanu 2016-01-05 12:23:29 -08:00
Michael Hobbs
39bba0b36e use docker 1.9.0 on circleci 2016-01-05 12:05:44 -08:00
Michael Hobbs
17e7869150 label all dokku containers 2016-01-05 11:55:07 -08:00
Jose Diaz-Gonzalez
fec6db13fb Merge pull request #1826 from dokku/1531_mh-plugin-update
implement plugn update
2016-01-05 14:17:53 -05:00
Michael Hobbs
fc512b3231 implement plugn update and allow plugin:install to accept committish. closes #1531 2016-01-05 10:47:27 -08:00
Jose Diaz-Gonzalez
1805f41918 Merge pull request #1823 from dokku/josegonzalez-patch-1
Fix output of dokku apps
2016-01-04 18:32:54 -05:00
Jose Diaz-Gonzalez
7562610c7d Fix output of dokku apps 2016-01-04 17:07:43 -05:00
Jose Diaz-Gonzalez
95d96ce1ab Merge pull request #1822 from shingara/patch-1
--no-restart option after config:set not before
2016-01-04 16:55:58 -05:00
Cyril Mougel
16365a5a44 --no-restart option after config:set not before 2016-01-04 22:52:04 +01:00
Jose Diaz-Gonzalez
f13c77d50d Merge pull request #1819 from andrewsomething/hostname-set-up
Write out /home/dokku/HOSTNAME as specified by the web installer.
2016-01-04 13:52:30 -05:00
Andrew Starr-Bochicchio
245718f236 Write out /home/dokku/HOSTNAME as specified by the web installer. 2016-01-04 12:44:32 -05:00
Jose Diaz-Gonzalez
07aace9975 Merge pull request #1818 from dokku/josegonzalez-pre-receive
Fix pre-receive git-hook
2016-01-04 11:21:10 -05:00
Jose Diaz-Gonzalez
244bb25e6a Fix variable reference 2016-01-04 05:20:05 -05:00
Jose Diaz-Gonzalez
2a94bf267b Fix pre-receive git-hook
Closes #1817
2016-01-04 04:40:05 -05:00
Jose Diaz-Gonzalez
b22b366fb1 Release 0.4.9 2016-01-03 10:19:17 -05:00
Jose Diaz-Gonzalez
5387bce2d9 Merge pull request #1807 from dokku/josegonzalez-patch-1
Allow updating submodules at any revision
2016-01-02 20:07:54 -05:00
Jose Diaz-Gonzalez
f2c1cd8a35 Merge pull request #1812 from dokku/debian-packaging
Debian packaging updates
2016-01-02 20:04:28 -05:00
Jose Diaz-Gonzalez
188694fb29 Merge pull request #1814 from blackxored/fix-ip-extraction
fix: use new Go template for extracting IP
2016-01-02 19:56:34 -05:00
Adrian Perez
84fba7ff2b fix: try to preserve pre 1.9 compatibility 2016-01-02 20:16:03 +01:00
Adrian Perez
6c7d34a773 fix: use new template for extracting IP
I was running into issues with the IP addresses, and it seems
that it's using an incorrect/outdated syntax for retrieving
the container's IP Address. In multi-host networking
`NetworkSettings.IPAddress` is empty.

The docker documentation at https://docs.docker.com/engine/reference/commandline/inspect/
uses a different syntax which I've tested to work both on multi-host and
standard bridge networking.

If you're interested in the other issues and the work/hacks I've been doing related
to #1795, let me know. In the meantime, I think this fix is needed.
2016-01-02 18:21:23 +01:00
Jose Diaz-Gonzalez
61f9ae6e67 Fix shellcheck violation 2016-01-02 04:31:48 -05:00
Jose Diaz-Gonzalez
5a74d5c247 Create the proper init file in a distribution-agnostic way
From http://unix.stackexchange.com/a/164092/105389
2016-01-02 04:08:54 -05:00
Jose Diaz-Gonzalez
bb525a3cf1 Properly handle dokku-installer installation 2016-01-02 03:53:27 -05:00
Jose Diaz-Gonzalez
933a5c0abf Reload the nginx configuration
Otherwise we run the risk of proxying a request to a bad backend
2016-01-02 03:37:44 -05:00
Jose Diaz-Gonzalez
a2f0962b76 Stop any running dokku-installer processes
They will cease to function regardless of whether the package has been purged or not
2016-01-02 03:37:16 -05:00
Jose Diaz-Gonzalez
73b3c4af40 Properly handle dokku data removal
- remove deployed applications during dpkg purge
- disable all core plugins during dpkg purge
- ensure init files are removed
- ensure motd is removed
- remove all core plugins, dokku config files (including tls/sshcommand entries etc.) during purge
- remove all empty directories and broken symlinks in the DOKKU_ROOT and DOKKU_LIB_ROOT directories during purge

Note that we do not delete the dokku user itself as there might be other data we don't know about in this directory.
2016-01-02 02:52:30 -05:00
Jose Diaz-Gonzalez
51a50fb571 Use dokku_apps for listing apps instead of re-inventing the wheel 2016-01-02 02:31:34 -05:00
Jose Diaz-Gonzalez
40047f0f8b Add support for symlinked directory paths and sort the output 2016-01-02 02:31:06 -05:00
Jose Diaz-Gonzalez
89d96dfee1 Only trigger systemctl if that command exists 2016-01-02 02:30:34 -05:00
Jose Diaz-Gonzalez
cac272a247 Fix restarts of systemctl and dokku-installer
We previously assumed that systemd was detectable by the existence of certain directories. Unfortunately, it seems 14.04 already has these directories, so we need to handle this case separately.

One other note is that dokku-installer will fail to "start" if already started on certain systems, thus the previous grep was more accurate in it's running.
2016-01-02 02:29:57 -05:00
Jose Diaz-Gonzalez
932e8191ad Revert "Fix issue where installer created dokku-installer for both upstart and systemd"
This reverts commit 1581884c6d.
2016-01-02 00:52:04 -05:00
Jose Diaz-Gonzalez
63d961afa0 Revert "Fix lintian warning: file-in-unusual-dir"
This reverts commit 3fb59fd04d.

Changing the path to dokku cannot be done in a patch release, as it
would break existing sshcommand entries.
2016-01-01 23:57:18 -05:00
Jose Diaz-Gonzalez
7c88cecad4 Plugin documentation formatting 2016-01-01 22:26:46 -05:00
Jose Diaz-Gonzalez
389d677392 Fix lintian error: no-copyright-file 2016-01-01 22:11:06 -05:00
Jose Diaz-Gonzalez
70b29590b9 Fix lintian error: manpage-not-compressed 2016-01-01 22:05:25 -05:00
Jose Diaz-Gonzalez
f7a1f5c095 Fix lintian warning: file-in-unusual-dir 2016-01-01 22:02:40 -05:00
Jose Diaz-Gonzalez
220923071c Fix lintian warning: file-in-unusual-dir 2016-01-01 21:59:00 -05:00
Jose Diaz-Gonzalez
3fb59fd04d Fix lintian warning: file-in-unusual-dir 2016-01-01 21:54:34 -05:00
Jose Diaz-Gonzalez
5667f9cef1 Fix lintian warning: missing-debconf-dependency-for-preinst 2016-01-01 21:49:16 -05:00
Jose Diaz-Gonzalez
b8630b45d7 Fix lintian error: python-script-but-no-python-dep 2016-01-01 21:47:22 -05:00
Jose Diaz-Gonzalez
4cb713cebf Fix lintian warning: postrm-does-not-purge-debconf 2016-01-01 21:45:38 -05:00
Jose Diaz-Gonzalez
b962221b41 Fix lintian warning: control-file-is-empty 2016-01-01 21:39:30 -05:00
Jose Diaz-Gonzalez
1d22f8c897 Fix lintian warning: malformed-prompt-in-templates 2016-01-01 21:38:51 -05:00
Jose Diaz-Gonzalez
b0a32dfd1b Fixup debconf descriptions 2016-01-01 21:38:26 -05:00
Jose Diaz-Gonzalez
1314b3942d Correctly handle dokku-installer init file creation on systemd instances
- Use the nginx.conf file's existence as a check for whether we should start the service or not
- Create the init files with the dokku-installer.py file. This adds actual systemd support.
- Also ensure we *always* start the service, regardless of it's status. This fixes an issue with processing systemd output
2016-01-01 21:37:42 -05:00
Jose Diaz-Gonzalez
55b2aba3a8 Fix casing on all debugging messages 2016-01-01 21:35:11 -05:00
Jose Diaz-Gonzalez
9da11dc8f8 Fix lintian warning: description-synopsis-starts-with-article 2016-01-01 21:34:51 -05:00
Jose Diaz-Gonzalez
1581884c6d Fix issue where installer created dokku-installer for both upstart and systemd
We should only create the upstart version if the OS does not use systemd.
2016-01-01 21:34:09 -05:00
Jose Diaz-Gonzalez
2b1929fc33 Merge pull request #1811 from dokku/josegonzalez-patch-2
Add dokku haproxy to plugins
2016-01-01 20:21:35 -05:00
Jose Diaz-Gonzalez
6c50e62f32 Add dokku haproxy to plugins
[ci skip]
2016-01-01 20:21:29 -05:00
Jose Diaz-Gonzalez
3f0a6a99da Merge pull request #1810 from dokku/josegonzalez-patch-2
Dockerfile installation requirements
2016-01-01 19:42:54 -05:00
Jose Diaz-Gonzalez
94b2a6a014 Invoke db_stop to ensure underlying services close open file descriptors 2015-12-31 08:54:02 -05:00
Jose Diaz-Gonzalez
ae2b2febe9 Enable debugging support to debian preinst hook
It is now possible to turn on debugging during an apt-get run by using `TRACE=1`
2015-12-31 08:22:38 -05:00
Jose Diaz-Gonzalez
908f551e0f Enable debugging support to debian postinst hook
It is now possible to turn on debugging during an apt-get run by using `TRACE=1`
2015-12-31 08:22:06 -05:00
Jose Diaz-Gonzalez
07506f1f53 Adding more info output to bootstrap script run
This allows us to better keep track of what commands are being run and when.
2015-12-31 08:19:39 -05:00
Jose Diaz-Gonzalez
2b624ac485 Release 0.4.8 2015-12-31 07:04:55 -05:00
Jose Diaz-Gonzalez
f73dfe0672 Merge pull request #1809 from dokku/josegonzalez-patch-2
Remove non-zero downtime version of letsencrypt plugin
2015-12-31 06:04:25 -05:00
Jose Diaz-Gonzalez
e3b5024ca3 Remove non-zero downtime version of letsencrypt plugin
[ci skip]
2015-12-31 06:04:19 -05:00
Jose Diaz-Gonzalez
a0c4f1fc1f Merge pull request #1808 from dokku/josegonzalez-patch-2
Fix path to dokku-installer
2015-12-31 05:47:04 -05:00
Jose Diaz-Gonzalez
399b3ecfe3 Fix path to dokku-installer
[ci skip]
2015-12-31 05:46:58 -05:00
Jose Diaz-Gonzalez
29ce25a040 Allow updating submodules at any revision
Using `--depth=1` breaks any submodules that are not at HEAD
2015-12-30 00:13:05 -05:00
Michael Hobbs
8832a9dd58 fix errant test file rename 2015-12-29 14:43:19 -08:00
Jose Diaz-Gonzalez
c561a8b900 Merge pull request #1798 from dokku/1774_mh-invalid-appname-failure
ensure app name begins with lowercase alphanumeric character
2015-12-25 21:55:02 -05:00
Jose Diaz-Gonzalez
eacb27d70b Merge pull request #1804 from dokku/josegonzalez-patch-2
Fix deprecated version constraint usage in debian control file
2015-12-25 21:54:36 -05:00
Jose Diaz-Gonzalez
a2359d6994 Fix deprecated version constraint usage
Fixes the following warning:

```
dpkg: warning: parsing file '/var/lib/dpkg/tmp.ci/control' near line 6 package 'dokku':
 `Depends' field, reference to `lxc-docker':
 `>' is obsolete, use `>=' or `>>' instead
```

Refs #1776
2015-12-24 18:02:26 -05:00
Jose Diaz-Gonzalez
67b4170e43 Merge pull request #1803 from dokku/mh-update-plugn
update plugn download url and version
2015-12-24 16:20:57 -05:00
Michael Hobbs
01f5c93585 update plugn download url and version 2015-12-24 10:41:09 -08:00
Jose Diaz-Gonzalez
f6306deb0a Merge pull request #1801 from dokku/josegonzalez-patch-1
Allow setting DOKKU_LIB_ROOT env var to modify the lib path on install
2015-12-23 21:24:02 -05:00
Jose Diaz-Gonzalez
f6a4521e19 Allow setting DOKKU_LIB_ROOT env var to modify the lib path on install 2015-12-23 20:02:56 -05:00
Jose Diaz-Gonzalez
35dc92fb3f Release 0.4.7 2015-12-23 07:16:49 -05:00
Jose Diaz-Gonzalez
eecd262eff Merge pull request #1800 from dokku/josegonzalez-patch-1
Respect DOKKU_ROOT in debian/postint
2015-12-23 03:59:16 -05:00
Jose Diaz-Gonzalez
6fbe8cabde Respect DOKKU_ROOT in debian/postint
[ci skip]
2015-12-23 03:59:10 -05:00
Jose Diaz-Gonzalez
dd0d0a3873 Merge pull request #1799 from dokku/josegonzalez-patch-1
Add support for tutum-agent
2015-12-23 01:41:56 -05:00
Jose Diaz-Gonzalez
4a36cbad53 Add support for tutum-agent
The agent embeds it's own docker, so installing both dokku and tutum-agent on the same instance is currently impossible.

[ci skip]
2015-12-23 01:41:48 -05:00
Jose Diaz-Gonzalez
3c3e5a962d Merge pull request #1794 from dokku/remove-ruby-dependency
Replace dokku-installer.rb with dokku-installer.py
2015-12-22 15:11:52 -05:00
Jose Diaz-Gonzalez
8775a2de1a Merge pull request #1797 from dokku/1768_mh-plugin-root-only
ensure we run plugin commands as root
2015-12-22 15:06:09 -05:00
Michael Hobbs
803ef7d9f3 ensure app name begins with lowercase. closes #1774 2015-12-22 12:02:18 -08:00
Michael Hobbs
d7b1e38cb7 ensure we run plugin commands as root. closes #1768 2015-12-22 11:16:25 -08:00
Jose Diaz-Gonzalez
e323770f89 Replace dokku-installer.rb with dokku-installer.py
The python version should allow us to remove any ruby dependencies and should also slightly speed up dokku installation. All LSB-compliant distributions should have python, so we should be okay depending upon it.

Closes #1783
Closes #1786
2015-12-22 01:59:23 -05:00
Michael Hobbs
32f1bc5396 Merge pull request #1789 from lvillani/skip-deploy
Make it possible to skip a deploy
2015-12-21 17:11:21 -08:00
Michael Hobbs
9d0f099e86 Merge pull request #1791 from dokku/mh-pare-down-test-suite
don't run app deploy tests and spread out unit tests to 4 containers
2015-12-21 16:36:25 -08:00
Michael Hobbs
76ad65b715 don't run app deploy tests and spread out unit tests to 4 containers. closes #1787 2015-12-21 10:18:16 -08:00
Michael Hobbs
d320203c2c Merge pull request #1793 from dokku/1792_mh-comments-in-procfile
filter out Procfile comments
2015-12-21 09:07:36 -08:00
Lorenzo Villani
30118d1b32 Make it possible to skip a deploy 2015-12-21 17:45:24 +01:00
Michael Hobbs
88be5083e0 filter out Procfile comments. closes #1792. closes #1742 2015-12-21 08:23:35 -08:00
Jose Diaz-Gonzalez
2955150dfe Merge pull request #1670 from zachfeldman/add-apps-rename
Add apps rename
2015-12-18 13:40:39 -05:00
Jose Diaz-Gonzalez
321c178f9f Merge pull request #1788 from dokku/mh-repo-move
updates for moving of dokku sshcommand and plugn repos
2015-12-18 04:16:39 -05:00
Michael Hobbs
a24b12eece Merge pull request #1790 from dokku/mh-dev-env-inputrc
use pgup/pgdown for history shortcut in dev env
2015-12-17 13:31:01 -08:00
Michael Hobbs
8b88cb8867 [ci skip] use pgup/pgdown for history shortcut in dev env 2015-12-17 13:30:34 -08:00
Michael Hobbs
8b879079e4 updates for moving of dokku sshcommand and plugn repos 2015-12-17 11:40:32 -08:00
Michael Hobbs
e4a23048ec Merge pull request #1784 from duboff/patch-1
Tiny fix in SSL documentation
2015-12-16 17:29:00 -08:00
Mikhail Dubov
a06166c08b Tiny fix in SSL documentation 2015-12-17 00:33:19 +00:00
Michael Hobbs
b3e9893e9d Merge pull request #1778 from mmerickel/optimize-build-clone
optimize git clone for building using depth=1
2015-12-16 15:47:48 -08:00
Michael Merickel
d31ac73066 avoid copying the entire git repo to a tmp folder when building the app
It's not possible to checkout a specific commit into a new repository
using ``git fetch`` and so a temporary tag is added to the host
repository, then fetched.
2015-12-16 16:08:56 -06:00
Michael Hobbs
6366aad1e7 Merge pull request #1781 from jvanbaarsen/add-post-config-update-hook
Add post config update hook
2015-12-16 14:00:01 -08:00
Michael Hobbs
208d3c13d9 Merge pull request #1780 from jvanbaarsen/add-domain-plugin-documentation
Add documentation for the new domain plugin hooks
2015-12-16 13:59:53 -08:00
Michael Hobbs
e408351ec6 Merge pull request #1777 from dokku/mh-test-labels
format test labels
2015-12-16 12:09:31 -08:00
Jeroen van Baarsen
66e255a396 Add documentation for the new domain plugin hooks
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-16 20:22:34 +01:00
Jeroen van Baarsen
441272d54b Add post config update hook
This adds a hook that will send in the $APP, action name and config vars.

By adding this, we allow plugin creators to handle this kind of events as well.

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-16 20:21:56 +01:00
Michael Hobbs
3d21132e98 format test labels 2015-12-16 10:50:10 -08:00
Michael Hobbs
51cd991174 Merge pull request #1782 from dokku/mh-make-docker-cp-work-on-ci
make docker cp work on circleci
2015-12-16 10:49:34 -08:00
Michael Hobbs
104b76129d install patched docker version on ci to make docker cp work 2015-12-16 09:00:23 -08:00
Jose Diaz-Gonzalez
4608a382b1 Merge pull request #1779 from sseemayer/master
Add link to new zero-downtime Let's Encrypt Plugin to docs
2015-12-16 03:51:33 -05:00
Stefan Seemayer
1286529c6e Add sseemayer/dokku-letsencrypt plugin to docs 2015-12-16 09:26:22 +01:00
Jose Diaz-Gonzalez
a00d4ef792 Merge pull request #1771 from jvanbaarsen/more-hook-info
Make plugin hooks send out more information
2015-12-15 14:27:36 -05:00
Jose Diaz-Gonzalez
d097a34735 Merge pull request #1776 from t-8ch/jessie-backports
fix version constraints
2015-12-15 14:27:21 -05:00
Thomas Weißschuh
dda3c721e0 fix version constraints
The version of docker.io in jessie-backports is 1.6.2~dfsg1-1~bpo8+1.
This is regarded as lower than 1.6.2 by dpkg because `~` has a special meaning
in regards to version sort in dpkg.

This leads to:
```
The following packages have unmet dependencies:
 dokku : Depends: docker-engine-cs but it is not installable or
                  docker-engine but it is not installable or
                  lxc-docker (>= 1.6.2) but it is not installable or
                  docker.io (>= 1.6.2) but 1.6.2~dfsg1-1~bpo8+1 is to be installed
         Recommends: herokuish but it is not going to be installed
```

By changing the contraints the version in backports will be accepted by dpkg.
2015-12-15 16:45:43 +00:00
Jose Diaz-Gonzalez
715e51b80c Release 0.4.6 2015-12-14 16:52:42 -05:00
Jose Diaz-Gonzalez
260b294ee9 Merge pull request #1775 from dokku/lg-fix-regex-in-named-containers
Match complete container name in named-containers plugin
2015-12-13 20:39:18 -05:00
Loïc Guitaut
16242e78ba Match complete container name in named-containers plugin
Fixes #1746
2015-12-13 23:28:00 +01:00
Jeroen van Baarsen
90ea6a5ba4 Make plugin hooks send out more information
Add this point you only get information that "something" happend on the given
hook. By adding more information to the hook, plugin creators can do more
interesting stuff.

* The first params remains the $APP name (to maintain backwards compatability)
* The second params sends in the action that happend, for domain this can be:
  "add", "clear" or "remove"
* The third param sends in the argument that was passed to the original
  function, for domain that would be a list of all the domains that was given.

One reason this addition would be great for plugin owners, is that when you have
a web tool over Dokku, and someone creates a domain over the CLI, we a plugin
can send back information about the event to the webapp over an API. That way
the webapp is always up-to-date with the Dokku installation.

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-12 17:02:28 +01:00
Jose Diaz-Gonzalez
74ebcb472f Merge pull request #1767 from jvanbaarsen/remove-shebang
Remove shebang from config/functions
2015-12-10 15:59:30 -05:00
Jeroen van Baarsen
2d147cfd12 Remove shebang from config/functions
In order to be one step closer to lintian compliance, lets remove the shebang
from this file so it doesn;t have to be executable

See #1641

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-10 21:55:43 +01:00
Jose Diaz-Gonzalez
7fa6b1901a Merge pull request #1761 from dokku/josegonzalez-patch-1
Fix link to docker-options documentation
2015-12-09 15:35:06 -05:00
Jose Diaz-Gonzalez
1c33159dcd Fix link to docker-options documentation
[ci skip]
2015-12-09 15:34:57 -05:00
Jose Diaz-Gonzalez
4e6f03a2c1 Merge pull request #1757 from dokku/josegonzalez-patch-1
Add DigitalOcean as a sponsor
2015-12-07 12:54:13 -05:00
Jose Diaz-Gonzalez
89a2dbfb3e Add DigitalOcean as a sponsor
They provide hosting for test infrastructure.

[ci skip]
2015-12-07 12:54:03 -05:00
Jose Diaz-Gonzalez
9001c1079b Merge pull request #1756 from dokku/josegonzalez-patch-1
Guard against invalid key file during installation
2015-12-07 11:52:20 -05:00
Jose Diaz-Gonzalez
ab2721bc37 Guard against invalid key file during installation
[ci skip]
2015-12-07 11:52:14 -05:00
Jose Diaz-Gonzalez
b4e56c43fc Merge pull request #1754 from dokku/josegonzalez-patch-1
Update all links to dokku repo
2015-12-06 04:56:27 -05:00
Jose Diaz-Gonzalez
80dc4cc3b6 Update all links to dokku repo
[ci skip]
2015-12-06 04:55:11 -05:00
Jose Diaz-Gonzalez
f66d764197 Merge pull request #1753 from hhff/patch-1
Add .ca-bundle information to SSL docs
2015-12-04 16:44:33 -05:00
Hugh Francis
37db940d1f Add .ca-bundle information to SSL docs 2015-12-04 16:40:36 -05:00
Jose Diaz-Gonzalez
fb5bc6c3e3 Merge pull request #1752 from byrnedo/master
Moved dokku-nats into official plugins section
2015-12-04 14:43:24 -05:00
Donal Byrne
244fd15d48 Moved dokku-nats into official plugins section 2015-12-04 20:40:45 +01:00
Jose Diaz-Gonzalez
6d58c8af40 Merge pull request #1748 from byrnedo/master
Added unofficial Nats plugin to plugins.md
2015-12-04 12:45:24 -05:00
Jose Diaz-Gonzalez
bed6254450 Merge pull request #1751 from progrium/josegonzalez-patch-1
Use flat-square style on image badges
2015-12-04 12:41:56 -05:00
Jose Diaz-Gonzalez
711a0c12d4 Use flat-square style on image badges
[ci skip]
2015-12-04 12:41:51 -05:00
Jose Diaz-Gonzalez
be1a9d3d9a Use master branch for badge
[ci skip]
2015-12-04 12:40:30 -05:00
Jose Diaz-Gonzalez
9ba2d15f86 Merge pull request #1750 from jlachowski/master
New graphite & statsd plugin with grafana frontend added
2015-12-04 12:39:24 -05:00
jlachowski
c1dfb46bf0 New graphite & statsd plugin with grafana frontend added 2015-12-04 14:23:28 +01:00
Donal Byrne
3fd4f519bf Added unofficial Nats plugin to plugins.md 2015-12-04 14:09:06 +01:00
Jose Diaz-Gonzalez
c2153aa840 Merge pull request #1747 from progrium/josegonzalez-patch-1
Add Lets Encrypt plugin
2015-12-03 15:23:32 -05:00
Jose Diaz-Gonzalez
f8f9aa7b1b Add Lets Encrypt plugin
[ci skip]
2015-12-03 15:23:26 -05:00
Jose Diaz-Gonzalez
012d8eabe7 Merge pull request #1745 from beverku/master
Change herokuish to recommended package
2015-12-03 14:29:24 -05:00
Jose Diaz-Gonzalez
9d3c856afd Merge pull request #1727 from louisbl/enable-redeploy-service
Enable dokku-redeploy systemd service.
2015-12-02 14:07:49 -05:00
Ryan Bever
65cda8b04e Change herokuish to recommended package
Changing the herokuish package to Recommends instead of Depends allows users to skip the installation of that package by specifying --no-install-recommends.  Herokuish will still be installed by default using apt-get
2015-12-02 11:47:33 -07:00
Michael Hobbs
da70a18601 Merge pull request #1739 from progrium/mh-clarify-nginx-template-location
clarify location of nginx.conf.template in app repo
2015-12-02 09:08:14 -08:00
Michael Hobbs
783cf417a0 [ci skip] clarify location of nginx.conf.template in app repo 2015-12-02 09:07:43 -08:00
Jose Diaz-Gonzalez
63867d4abe Merge pull request #1735 from progrium/mh-replace-restartall-with-restore
use ps:restore on instance boot
2015-12-01 15:36:21 -05:00
Michael Hobbs
606036a50f [ci skip] use ps:restore on instance boot 2015-12-01 11:54:36 -08:00
Michael Hobbs
0606d1a805 Merge pull request #1732 from progrium/1729_mh-fix-certs-gen
do not chown file that doesn't exist
2015-12-01 09:29:16 -08:00
Michael Hobbs
a86119ddb6 do not chown file that doesn't exist. closes #1729 2015-12-01 09:01:59 -08:00
Zach Feldman
f0b260d7dc Adds dokku apps:rename function, closes #1440.
Adds unit test for new apps:rename function.

Add example in the docs for new apps:rename function.

Add apps:rename command to help command.

Delete cache directory before copying old app directory to new app directory.

deploy_app instead of create_app for apps:rename testing.

Change app url to match new name. Fix unit tests.

Add some more tests, plugn triggers.
2015-11-30 16:27:10 -05:00
louisbl
2f95fa0a95 Fix #1726. Enable dokku-redeploy systemd service. 2015-11-29 22:26:40 +01:00
Jose Diaz-Gonzalez
cfe7604696 Merge pull request #1718 from progrium/post-create-hook
Add post-create hook
2015-11-26 20:03:09 -05:00
Jose Diaz-Gonzalez
8e9d04ae36 Add post-create hook
Note that this is invoked *before* the application is deployed, so it's usage is quite different than a potential post-successful-create hook.
2015-11-26 15:47:59 -05:00
Jose Diaz-Gonzalez
e0143ed226 Merge pull request #1717 from progrium/josegonzalez-nginx
Avoid using the PPA for ubuntu versions 15.10 and higher
2015-11-26 15:35:24 -05:00
Jose Diaz-Gonzalez
4894a03bfe Merge pull request #1723 from progrium/josegonzalez-patch-1
Add herokuish version to desired debugging info
2015-11-26 15:15:40 -05:00
Jose Diaz-Gonzalez
21799dcf40 Add herokuish version to desired debugging info
[ci skip]
2015-11-26 15:15:31 -05:00
Jose Diaz-Gonzalez
d520be9e81 Merge pull request #1720 from progrium/josegonzalez-patch-1
Add memory usage output as desired data for reporting issues
2015-11-26 15:14:21 -05:00
Jose Diaz-Gonzalez
757e6b8f68 Add memory usage output as desired data for reporting issues 2015-11-26 01:04:26 -05:00
Jose Diaz-Gonzalez
f11459faad Avoid using the PPA for ubuntu versions 15.10 and higher
As of 15.10, we are graced with a relatively recent version of nginx, and thus no longer need access to the ppa. Assuming this is the only such issue, this should also allow us to support Ubuntu 16.04 without any future changes.
2015-11-25 18:59:59 -05:00
106 changed files with 1611 additions and 835 deletions

View File

@@ -2,12 +2,12 @@
Dokku loves to welcome your contributions. There are several ways to help out: Dokku loves to welcome your contributions. There are several ways to help out:
* Create an [issue](https://github.com/progrium/dokku/issues) on GitHub, if you * Create an [issue](https://github.com/dokku/dokku/issues) on GitHub, if you
have found a bug have found a bug
* Write test cases for open bug issues * Write test cases for open bug issues
* Write patches for open bug/feature issues, preferably with test cases * Write patches for open bug/feature issues, preferably with test cases
included included
* Contribute to the [documentation](http://progrium.viewdocs.io/dokku/) * Contribute to the [documentation](http://dokku.viewdocs.io/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.
@@ -41,12 +41,12 @@ encounter an issue. We always appreciate a well-written, thorough bug report,
and will thank you for it! and will thank you for it!
Sometimes dokku is missing a feature you need. In some cases, those features can Sometimes dokku is missing a feature you need. In some cases, those features can
be found in pre-existing [plugins](http://progrium.viewdocs.io/dokku/plugins/), be found in pre-existing [plugins](http://dokku.viewdocs.io/dokku/plugins/),
and we encourage our users to create and contribute such packages. From time to and we encourage our users to create and contribute such packages. From time to
time, we will also pull plugins into the dokku core when the task they solve is time, we will also pull plugins into the dokku core when the task they solve is
a common one for our users. a common one for our users.
Check that [our issue database](https://github.com/progrium/dokku/issues) Check that [our issue database](https://github.com/dokku/dokku/issues)
doesn't already include that problem or suggestion before submitting an issue. doesn't already include that problem or suggestion before submitting an issue.
If you find a match, add a quick "+1" or "I have this problem too." Doing this If you find a match, add a quick "+1" or "I have this problem too." Doing this
helps prioritize the most common problems and requests. helps prioritize the most common problems and requests.
@@ -55,8 +55,10 @@ When reporting issues, please include your host OS (Ubuntu 14.04, Fedora 19,
etc). Please include: etc). Please include:
* The output of `uname -a`. * The output of `uname -a`.
* The output of `free -m`
* The output of `docker version`. * The output of `docker version`.
* The output of `docker -D info`. * The output of `docker -D info`.
* The output of `docker run --rm -ti gliderlabs/herokuish:latest herokuish version`
* The output of `dokku version`. * The output of `dokku version`.
* The output of `dokku plugin`. * The output of `dokku plugin`.
@@ -72,13 +74,15 @@ Description of problem:
Output of the following commands Output of the following commands
- `uname -a`: - `uname -a`:
- `free -m`:
- `docker version`: - `docker version`:
- `docker -D info`: - `docker -D info`:
- `docker run -ti gliderlabs/herokuish:latest herokuish version`:
- `dokku version`: - `dokku version`:
- `dokku plugin`: - `dokku plugin`:
- `docker inspect CONTAINER_ID` (if applicable): - `docker inspect CONTAINER_ID` (if applicable):
- `cat /home/dokku/<app>/nginx.conf` (if applicable): - `cat /home/dokku/<app>/nginx.conf` (if applicable):
- Output of failing dokku commands with `dokku trace on` - Output of failing dokku commands with `dokku trace on`
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues): (BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues):
Environment details (AWS, VirtualBox, physical, etc.): Environment details (AWS, VirtualBox, physical, etc.):
@@ -108,7 +112,7 @@ Before you contribute to the dokku project, there are a few things that you'll
need to do need to do
* Make sure you have a [GitHub account](https://github.com/signup/free). * Make sure you have a [GitHub account](https://github.com/signup/free).
* Submit an [issue](https://github.com/progrium/dokku/issues), assuming one * Submit an [issue](https://github.com/dokku/dokku/issues), assuming one
does not already exist. does not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug. * Clearly describe the issue including steps to reproduce when it is a bug.
* Make sure you fill in the earliest version that you know has the issue. * Make sure you fill in the earliest version that you know has the issue.
@@ -132,7 +136,7 @@ need to do
* Check for unnecessary whitespace with `git diff --check` before committing. * Check for unnecessary whitespace with `git diff --check` before committing.
* Use descriptive commit messages and reference the #issue number. * Use descriptive commit messages and reference the #issue number.
* Core test cases should continue to pass. You can run tests locally or enable * Core test cases should continue to pass. You can run tests locally or enable
[circle-ci](https://circleci.com/gh/progrium/dokku) for your fork, so all [circle-ci](https://circleci.com/gh/dokku/dokku) for your fork, so all
tests and codesniffs will be executed. tests and codesniffs will be executed.
* Your work should apply the [Dokku coding standards](https://github.com/progrium/bashstyle) * Your work should apply the [Dokku coding standards](https://github.com/progrium/bashstyle)
* Pull requests must be cleanly rebased on top of master without multiple branches * Pull requests must be cleanly rebased on top of master without multiple branches
@@ -182,13 +186,13 @@ To run the shellcheck sniffs for Dokku coding standards:
make ci-dependencies make ci-dependencies
make lint make lint
The [testing docs](http://progrium.viewdocs.io/dokku/development/testing/) The [testing docs](http://dokku.viewdocs.io/dokku/development/testing/)
contains installation info for bats and shellcheck. contains installation info for bats and shellcheck.
# Additional Resources # Additional Resources
* [Dokku coding standards](https://github.com/progrium/bashstyle) * [Dokku coding standards](https://github.com/progrium/bashstyle)
* [Existing issues](https://github.com/progrium/dokku/issues) * [Existing issues](https://github.com/dokku/dokku/issues)
* [General GitHub documentation](https://help.github.com/) * [General GitHub documentation](https://help.github.com/)
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/) * [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
* [#dokku IRC channel on freenode.org](https://webchat.freenode.net/?channels=dokku) * [#dokku IRC channel on freenode.org](https://webchat.freenode.net/?channels=dokku)

View File

@@ -1,5 +1,191 @@
# History # History
## 0.4.12
This is a small bugfix release, which will be the final release before the 0.5.x line. You can follow along on bugs/features we hope to cleanup for 0.5.x [here](https://github.com/dokku/dokku/milestones/v0.5.0).
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1868: @alessio Prevent dokku to hang on events:help
- #1870: @u2mejc Remove arg check from docker-options/functions, global var cleanup
## 0.4.11
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1840: @alessio Append trailing slash '/' to $PLUGIN_DIR
- #1841: @michaelshobbs Don't build nginx config if the app has not been deployed
- #1844: @michaelshobbs Handle multiple old containers and don't attempt to rename a dead container
- #1845: @michaelshobbs Update nodejs in test apps
- #1849: @floriangosse Fix logrotate file for debian system
- #1862: @michaelshobbs Install bash 4.3.x on circleci
- #1863: @znz Fix a typo in IPV6 detection
### New Features
- #1842: @michaelshobbs skip cleanup in ci to speed up tests
- #1848: @u2mejc Move docker-options functions to functions file, rework phase_file_path
- #1855: @jvanbaarsen Add skip_keyfile option for deb package
- #1864: @znz Remove nullglob from ps commands
### Documentation
- #1838: @Epigene Fixed typo in installation documentation
- #1843: @sseemayer Move let's encrypt plugin to official plugins
- #1854: @fedosov Update year in footer (2013-2016)
- #1856: @madflow Fixed dead documentation link
- #1859: @dhinus Fix command for debconf-set-selections
## 0.4.10
This release is mostly a bugfix release, though we have a few important changes:
- `dokku plugin:update` can now be used to update a specific plugin. Previously, this could potentially result in an error a user would have to manually resolve.
- We have started labeling all dokku-managed containers. In a future minor release, triggering a `dokku cleanup` will remove *only* exited containers that are managed by dokku. This change allows users to start containers outside of dokku and be assured that dokku would not inadvertently remove them.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1818: @josegonzalez Fix pre-receive git-hook in apps:rename
- #1819: @andrewsomething Write out /home/dokku/HOSTNAME as specified by the web installer.
- #1823: @josegonzalez Fix output formatting of dokku apps
- #1827: @michaelshobbs Use docker 1.9.0 on circleci
- #1834: @jvanbaarsen Make sure we ignore hidden files in the SSL cert check
- #1835: @josegonzalez Add support to herokuish for more versions of docker-engine
- #1837: @michaelshobbs Add back some deploy tests that test dokku functionality
### New Features
- #1826: @michaelshobbs Implement plugn update
- #1828: @michaelshobbs Label all dokku-managed containers
- #1829: @michaelshobbs Implement dokku report command
### Documentation
- #1822: --no-restart option after config:set not before
## 0.4.9
This release is significant for two reasons:
- A bugfix for git submodule support that was broken in 0.4.7
- Improved and tested support for modern variants of Ubuntu/Debian. This should also improve support for docker-based deployments of dokku, as well as potential support for the upcoming Ubuntu 16.04 release.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1810: @josegonzalez Fix debian packaging for usage inside of docker containers
- #1814: @blackxored Add support for new method of extracting container IP
- #1807: @josegonzalez Allow updating submodules at any revision
### New Features
- #1812: @josegonzalez Fully-tested debian packaging for modern Ubuntu/Debian distributions
### Documentation
- #1811: @josegonzalez Add dokku haproxy to plugins
## 0.4.8
If upgrading to 0.4.8, please note that we have tightened the application naming schema, per docker requirements. Upgrade your dokku installation to 0.4.7 first to take advantage of the `dokku apps:rename` command if you are having issues with the new requirement.
### Bug Fixes
- #1804: @josegonzalez Fix deprecated version constraint usage in debian control file
- #1798: @michaelshobbs Ensure app name begins with lowercase alphanumeric character
- #1808: @josegonzalez Fix path to dokku-installer
### New Features
- #1801: @josegonzalez Allow setting DOKKU_LIB_ROOT env var to modify the lib path on install
- #1803: @michaelshobbs update plugn download url and version
### Documentation
- #1809: @josegonzalez Remove non-zero downtime version of letsencrypt plugin
## 0.4.7
A few notable new features:
- The new `dokku apps:rename` command. It does not update linked containers, but is useful in many other cases.
- Updated git clone methodology to be more performant for large repositories.
- Moved the dokku-installer from Ruby to Python, allowing us to drop Ruby as a dependency. Python comes with the linux standard base, and should therefore be accessible on more systems.
### Bug Fixes
- #1776: @t-8ch Fix docker version constraints on jessie systems
- #1777: @michaelshobbs Format test labels
- #1782: @michaelshobbs make docker cp work on circleci
- #1788: @michaelshobbs Updates for moving of dokku sshcommand and plugn repos
- #1791: @michaelshobbs Don't run app deploy tests and spread out unit tests to 4 containers
- #1793: @michaelshobbs Filter out Procfile comments
### New Features
- #1670: @zachfeldman Add apps:rename
- #1771: @jvanbaarsen Make plugin hooks send out more information
- #1778: @mmerickel Optimize git clone for large repositories
- #1781: @jvanbaarsen Add post config update hook
- #1789: @lvillani Make it possible to skip a deploy
- #1790: @michaelshobbs Use pgup/pgdown for history shortcut in dev env
- #1794: @josegonzalez Replace dokku-installer.rb with dokku-installer.py
- #1797: @michaelshobbs Ensure we run plugin commands as root
- #1799: @josegonzalez Add support for tutum-agent as docker alternative
- #1800: @josegonzalez Respect DOKKU_ROOT in debian/postint
### Documentation
- #1779: @sseemayer Add link to new zero-downtime Let's Encrypt Plugin to docs
- #1780: @jvanbaarsen Add documentation for the new domain plugin hooks
- #1784: @duboff Tiny fix in SSL documentation
## 0.4.6
This is mostly a documentation change. A few notable changes:
- Rebooting dokku servers should properly handle not starting stopped services.
- Better support for newer versions of Debian/Ubuntu.
- Moved the dokku project to the dokku github organization.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1717: @josegonzalez Avoid using the PPA for ubuntu versions 15.10 and higher
- #1727: @louisbl Enable dokku-redeploy systemd service.
- #1732: @michaelshobbs do not chown file that doesn't exist
- #1745: @beverku Change herokuish to recommended package
- #1767: @jvanbaarsen Remove shebang from config/functions
- #1775: @Flink Match complete container name in named-containers plugin
### New Features
- #1718: @josegonzalez Add post-create hook
- #1735: @michaelshobbs use ps:restore on instance boot
### Documentation
- #1720: @josegonzalez Add memory usage output as desired data for reporting issues
- #1723: @josegonzalez Add herokuish version to desired debugging info
- #1739: @michaelshobbs clarify location of nginx.conf.template in app repo
- #1747: @josegonzalez Add Lets Encrypt plugin
- #1748: @byrnedo Added unofficial Nats plugin to plugins.md
- #1750: @jlachowski New graphite & statsd plugin with grafana frontend added
- #1751: @josegonzalez Use flat-square style on image badges
- #1752: @byrnedo Moved dokku-nats into official plugins section
- #1753: @hhff Add .ca-bundle information to SSL docs
- #1754: @josegonzalez Update all links to dokku repo
- #1757: @josegonzalez Add DigitalOcean as a sponsor
- #1761: @josegonzalez Fix link to docker-options documentation
## 0.4.5 ## 0.4.5
This release is mostly a bugfix release. Two notable changes: This release is mostly a bugfix release. Two notable changes:
@@ -13,6 +199,7 @@ Thanks to all the contributors who helped with this release!
- #1666: @michaelshobbs Revert dokku group changes and add dokku user to adm group - #1666: @michaelshobbs Revert dokku group changes and add dokku user to adm group
- #1667: @u2mejc Fix dokku certs:add file input bug - #1667: @u2mejc Fix dokku certs:add file input bug
- #1682: @michaelshobbs Aet nullglob when looking for PORT files
- #1684: @u2mejc Cause certs:remove to return non zero on error - #1684: @u2mejc Cause certs:remove to return non zero on error
- #1690: @u2mejc Fix "App tls has not been deployed" error - #1690: @u2mejc Fix "App tls has not been deployed" error
- #1696: @michaelshobbs chown plugins paths to dokku:dokku - #1696: @michaelshobbs chown plugins paths to dokku:dokku
@@ -27,7 +214,6 @@ Thanks to all the contributors who helped with this release!
- #1709: @michaelshobbs Fix Must specify DOMAIN error over ssh - #1709: @michaelshobbs Fix Must specify DOMAIN error over ssh
- #1712: @michaelshobbs filter incompatible docker option when building dockerfile vs herokuish apps - #1712: @michaelshobbs filter incompatible docker option when building dockerfile vs herokuish apps
- #1715: @michaelshobbs use patched static buildpack in test - #1715: @michaelshobbs use patched static buildpack in test
- @1682: @michaelshobbs Aet nullglob when looking for PORT files
### New Features ### New Features
@@ -204,9 +390,9 @@ One new feature is colorized logging output, which should make it easier to debu
This is our first minor release in almost a year. Many new features and removals have occurred, so here is a neat summary: This is our first minor release in almost a year. Many new features and removals have occurred, so here is a neat summary:
- Plugins are now triggered via `plugn`. Notably, you'll need add a `plugin.toml` to describe the plugin as well as use `plugn trigger` instead of `pluginhook` to trigger plugin callbacks. Please see the [plugin creation documentation](http://progrium.viewdocs.io/dokku/development/plugin-creation/) for more details. - Plugins are now triggered via `plugn`. Notably, you'll need add a `plugin.toml` to describe the plugin as well as use `plugn trigger` instead of `pluginhook` to trigger plugin callbacks. Please see the [plugin creation documentation](http://dokku.viewdocs.io/dokku/development/plugin-creation/) for more details.
- A few new official plugins have been added to the core, including [image tagging](http://progrium.viewdocs.io/dokku/application-deployment/), [certificate management](http://progrium.viewdocs.io/dokku/deployment/ssl-configuration/), a tar-based deploy solution, and much more. Check out the *New Features* section for more details. - A few new official plugins have been added to the core, including [image tagging](http://dokku.viewdocs.io/dokku/application-deployment/), [certificate management](http://dokku.viewdocs.io/dokku/deployment/ssl-configuration/), a tar-based deploy solution, and much more. Check out the *New Features* section for more details.
- We've removed a few deprecated plugin callbacks. Please see the [plugin triggers documentation](http://progrium.viewdocs.io/dokku/development/plugin-triggers/) to see what is available. - We've removed a few deprecated plugin callbacks. Please see the [plugin triggers documentation](http://dokku.viewdocs.io/dokku/development/plugin-triggers/) to see what is available.
- [Official datastorage plugins](https://github.com/dokku) have been created for the most commonly used datastores. If you previously used/maintained a community contributed plugin, please check these out. We'll be adding more official plugins as time goes on. - [Official datastorage plugins](https://github.com/dokku) have been created for the most commonly used datastores. If you previously used/maintained a community contributed plugin, please check these out. We'll be adding more official plugins as time goes on.
Thanks to the *many* contributors for making this release our best release so far, and special thanks to both @michaelshobbs and @Flink for pushing along the `0.4.0` release! Thanks to the *many* contributors for making this release our best release so far, and special thanks to both @michaelshobbs and @Flink for pushing along the `0.4.0` release!
@@ -315,7 +501,7 @@ This release is a bugfix release covering dokku packaging.
## 0.3.23 ## 0.3.23
This release is a bugfix release mostly covering installation and nginx issues. As well, we launched a nicer documentation site [here](http://progrium.viewdocs.io/dokku/). Thanks to all of our contributors for making this a great release! This release is a bugfix release mostly covering installation and nginx issues. As well, we launched a nicer documentation site [here](http://dokku.viewdocs.io/dokku/). Thanks to all of our contributors for making this a great release!
### Bug Fixes ### Bug Fixes

View File

@@ -1,7 +1,7 @@
DOKKU_VERSION = master DOKKU_VERSION = master
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/progrium/sshcommand/master/sshcommand SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/master/sshcommand
PLUGN_URL ?= https://github.com/progrium/dokku/releases/download/v0.4.0/plugn_0.2.0_linux_x86_64.tgz PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_linux_x86_64.tgz
STACK_URL ?= https://github.com/gliderlabs/herokuish.git STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
DOKKU_LIB_ROOT ?= /var/lib/dokku DOKKU_LIB_ROOT ?= /var/lib/dokku
@@ -38,7 +38,6 @@ package_cloud:
package_cloud push dokku/dokku/ubuntu/trusty herokuish*.deb package_cloud push dokku/dokku/ubuntu/trusty herokuish*.deb
package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb
package_cloud push dokku/dokku/ubuntu/trusty plugn*.deb package_cloud push dokku/dokku/ubuntu/trusty plugn*.deb
package_cloud push dokku/dokku/ubuntu/trusty rubygem*.deb
package_cloud push dokku/dokku/ubuntu/trusty dokku*.deb package_cloud push dokku/dokku/ubuntu/trusty dokku*.deb
packer: packer:
@@ -72,10 +71,10 @@ version:
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
plugin-dependencies: plugn plugin-dependencies: plugn
dokku plugin:install-dependencies --core sudo -E dokku plugin:install-dependencies --core
plugins: plugn docker plugins: plugn docker
dokku plugin:install --core sudo -E dokku plugin:install --core
dependencies: apt-update sshcommand plugn docker help2man man-db dependencies: apt-update sshcommand plugn docker help2man man-db
$(MAKE) -e stack $(MAKE) -e stack
@@ -140,12 +139,7 @@ count:
@find tests -type f -not -name .DS_Store | xargs cat | sed 's/^$$//g' | wc -l @find tests -type f -not -name .DS_Store | xargs cat | sed 's/^$$//g' | wc -l
dokku-installer: dokku-installer:
apt-get install -qq -y ruby test -f /var/lib/dokku/.dokku-installer-created || python contrib/dokku-installer.py onboot
test -f /var/lib/dokku/.dokku-installer-created || gem install rack -v 1.5.2 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install rack-protection -v 1.5.3 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install sinatra -v 1.4.5 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install tilt -v 1.4.1 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || ruby contrib/dokku-installer.rb onboot
test -f /var/lib/dokku/.dokku-installer-created || service dokku-installer start test -f /var/lib/dokku/.dokku-installer-created || service dokku-installer start
test -f /var/lib/dokku/.dokku-installer-created || service nginx reload test -f /var/lib/dokku/.dokku-installer-created || service nginx reload
test -f /var/lib/dokku/.dokku-installer-created || touch /var/lib/dokku/.dokku-installer-created test -f /var/lib/dokku/.dokku-installer-created || touch /var/lib/dokku/.dokku-installer-created

View File

@@ -1,4 +1,4 @@
# Dokku [![Build Status](https://img.shields.io/circleci/project/progrium/dokku.svg "Build Status")](https://circleci.com/gh/progrium/dokku/tree/master) [![Ubuntu Package](https://img.shields.io/badge/package-ubuntu-brightgreen.svg?style=flat-square "Ubuntu Package")](https://packagecloud.io/dokku/dokku) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) [![Documentation](https://img.shields.io/badge/docs-viewdocs-blue.svg "Viewdocs")](http://progrium.viewdocs.io/dokku/) [![Gratipay](https://img.shields.io/gratipay/dokku.svg)](https://gratipay.com/dokku/) # Dokku [![Build Status](https://img.shields.io/circleci/project/dokku/dokku/master.svg?style=flat-square "Build Status")](https://circleci.com/gh/dokku/dokku/tree/master) [![Ubuntu Package](https://img.shields.io/badge/package-ubuntu-brightgreen.svg?style=flat-square "Ubuntu Package")](https://packagecloud.io/dokku/dokku) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg?style=flat-square "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) [![Documentation](https://img.shields.io/badge/docs-viewdocs-blue.svg?style=flat-square "Viewdocs")](http://dokku.viewdocs.io/dokku/) [![Gratipay](https://img.shields.io/gratipay/dokku.svg?style=flat-square)](https://gratipay.com/dokku/)
Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. Sponsored by our friends at [Deis](http://deis.io/). Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. Sponsored by our friends at [Deis](http://deis.io/).
@@ -10,24 +10,24 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
To install the latest stable release, you can run the following commands as a user that has access to `sudo`: To install the latest stable release, you can run the following commands as a user that has access to `sudo`:
wget https://raw.githubusercontent.com/progrium/dokku/v0.4.5/bootstrap.sh wget https://raw.githubusercontent.com/dokku/dokku/v0.4.12/bootstrap.sh
sudo DOKKU_TAG=v0.4.5 bash bootstrap.sh sudo DOKKU_TAG=v0.4.12 bash bootstrap.sh
### Upgrading ### Upgrading
[View the docs for upgrading](http://progrium.viewdocs.io/dokku/upgrading) from an older version of Dokku. [View the docs for upgrading](http://dokku.viewdocs.io/dokku/upgrading) from an older version of Dokku.
## Documentation ## Documentation
Full documentation - including advanced installation docs - are available online at [docs](http://progrium.viewdocs.io/dokku/) Full documentation - including advanced installation docs - are available online at [docs](http://dokku.viewdocs.io/dokku/)
## Support ## Support
You can use [Github Issues](https://github.com/progrium/dokku/issues), check [Troubleshooting](http://progrium.viewdocs.io/dokku/troubleshooting) in the documentation, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku) You can use [Github Issues](https://github.com/dokku/dokku/issues), check [Troubleshooting](http://dokku.viewdocs.io/dokku/troubleshooting) in the documentation, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku)
## Contribution ## Contribution
After checking [Github Issues](https://github.com/progrium/dokku/issues), the [Troubleshooting Guide](http://progrium.viewdocs.io/dokku/troubleshooting) or having a chat with us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku), feel free to fork and create a Pull Request. After checking [Github Issues](https://github.com/dokku/dokku/issues), the [Troubleshooting Guide](http://dokku.viewdocs.io/dokku/troubleshooting) or having a chat with us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku), feel free to fork and create a Pull Request.
While we may not merge your PR as is, they serve to start conversations and improve the general dokku experience for all users. While we may not merge your PR as is, they serve to start conversations and improve the general dokku experience for all users.
@@ -37,4 +37,4 @@ Dokku is currently sponsored by the enterprise grade, multi-host PaaS project [D
## License ## License
[MIT License](https://github.com/progrium/dokku/blob/master/LICENSE) © Jeff Lindsay [MIT License](https://github.com/dokku/dokku/blob/master/LICENSE) © Jeff Lindsay

View File

@@ -1 +1,2 @@
Deis http://deis.io Deis http://deis.io
DigitalOcean https://www.digitalocean.com/

8
Vagrantfile vendored
View File

@@ -40,6 +40,14 @@ Vagrant::configure("2") do |config|
vm.vm.network :private_network, ip: DOKKU_IP vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}" vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer" vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
vm.vm.provision :shell do |s|
s.inline = <<-EOT
echo '"\e[5~": history-search-backward' > /root/.inputrc
echo '"\e[6~": history-search-forward' >> /root/.inputrc
echo 'set show-all-if-ambiguous on' >> /root/.inputrc
echo 'set completion-ignore-case on' >> /root/.inputrc
EOT
end
end end
# For windows users. Sharing folder from windows creates problem with sym links and so, sync the repo instead from GOS. # For windows users. Sharing folder from windows creates problem with sym links and so, sync the repo instead from GOS.

View File

@@ -16,11 +16,11 @@ bootstrap () {
set -eo pipefail set -eo pipefail
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"} export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..." echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
if ! command -v apt-get &>/dev/null; then if ! command -v apt-get &>/dev/null; then
echo "This installation script requires apt-get. For manual installation instructions, consult http://progrium.viewdocs.io/dokku/advanced-installation ." echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
exit 1 exit 1
fi fi
@@ -29,6 +29,7 @@ hostname -f > /dev/null 2>&1 || {
exit 1 exit 1
} }
echo "--> Ensuring we have the proper dependencies"
apt-get update -qq > /dev/null apt-get update -qq > /dev/null
[[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties [[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties
@@ -53,7 +54,7 @@ dokku_install_package() {
echo "--> Installing docker" echo "--> Installing docker"
if uname -r | grep -q linode; then if uname -r | grep -q linode; then
echo "--> NOTE: Using Linode? Docker might complain about missing AUFS support." echo "--> NOTE: Using Linode? Docker might complain about missing AUFS support."
echo " See http://progrium.viewdocs.io/dokku/getting-started/install/linode/" echo " See http://dokku.viewdocs.io/dokku/getting-started/install/linode/"
echo " Installation will continue in 10 seconds." echo " Installation will continue in 10 seconds."
sleep 10 sleep 10
fi fi
@@ -90,14 +91,16 @@ elif [[ -n $DOKKU_TAG ]]; then
elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then
export DOKKU_CHECKOUT="$DOKKU_SEMVER" export DOKKU_CHECKOUT="$DOKKU_SEMVER"
dokku_install_package dokku_install_package
dokku plugin:install-dependencies --core echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
else else
export DOKKU_CHECKOUT="$DOKKU_TAG" export DOKKU_CHECKOUT="$DOKKU_TAG"
dokku_install_source dokku_install_source
fi fi
else else
dokku_install_package dokku_install_package
dokku plugin:install-dependencies --core echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
fi fi
} }

View File

@@ -1,4 +1,8 @@
machine: machine:
pre:
- echo 'DOCKER_OPTS="-s btrfs -e lxc --userland-proxy=false"' | sudo tee -a /etc/default/docker
- sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci-cp-workaround'
- sudo chmod 0755 /usr/bin/docker
services: services:
- docker - docker
dependencies: dependencies:
@@ -6,8 +10,9 @@ dependencies:
- "~/docker" - "~/docker"
override: override:
- ./tests/ci/parallel_runner.sh setup: { timeout: 300 } - ./tests/ci/parallel_runner.sh setup: { timeout: 300 }
- echo "export DOKKU_SKIP_CLEANUP=true" > /home/dokku/.dokkurc/dokku_skip_cleanup
post: post:
- sudo -E make -e lint - sudo -E make -e lint
test: test:
override: override:
- ./tests/ci/parallel_runner.sh testing: { parallel: true, timeout: 1800 } - ./tests/ci/parallel_runner.sh testing: { parallel: true, timeout: 3600 }

220
contrib/dokku-installer.py Executable file
View File

@@ -0,0 +1,220 @@
#!/usr/bin/env python2.7
import cgi
import json
import os
import SimpleHTTPServer
import SocketServer
import subprocess
import sys
import threading
VERSION = 'v0.4.12'
hostname = ''
try:
command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'"
hostname = subprocess.check_output(command, shell=True)
if ':' in hostname:
hostname = ''
except subprocess.CalledProcessError:
pass
key_file = os.getenv('KEY_FILE', '/root/.ssh/authorized_keys')
admin_keys = []
if os.path.isfile(key_file):
try:
command = "cat {0}".format(key_file)
admin_keys = subprocess.check_output(command, shell=True).strip().split("\n")
except subprocess.CalledProcessError:
pass
def check_boot():
if 'onboot' not in sys.argv:
return
init_dir = os.getenv('INIT_DIR', '/etc/init')
systemd_dir = os.getenv('SYSTEMD_DIR', '/etc/systemd/system')
nginx_dir = os.getenv('NGINX_DIR', '/etc/nginx/conf.d')
if os.path.exists(init_dir):
with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f:
f.write("start on runlevel [2345]\n")
f.write("exec {0} selfdestruct\n".format(os.path.abspath(__file__)))
if os.path.exists(systemd_dir):
with open('{0}/dokku-installer.service'.format(systemd_dir), 'w') as f:
f.write("[Unit]\n")
f.write("Description=Dokku web-installer\n")
f.write("\n")
f.write("[Service]\n")
f.write("ExecStart={0} selfdestruct\n".format(os.path.abspath(__file__)))
f.write("\n")
f.write("[Install]\n")
f.write("WantedBy=multi-user.target\n")
f.write("WantedBy=graphical.target\n")
if os.path.exists(nginx_dir):
with open('{0}/dokku-installer.conf'.format(nginx_dir), 'w') as f:
f.write("upstream dokku-installer { server 127.0.0.1:2000; }\n")
f.write("server {\n")
f.write(" listen 80;\n")
f.write(" location / {\n")
f.write(" proxy_pass http://dokku-installer;\n")
f.write(" }\n")
f.write("}\n")
subprocess.call('rm -f /etc/nginx/sites-enabled/*', shell=True)
sys.exit(0)
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
content = PAGE.replace('{VERSION}', VERSION)
content = content.replace('{HOSTNAME}', hostname)
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
self.send_response(200)
self.end_headers()
self.wfile.write(content)
def do_POST(self):
if self.path not in ['/setup', '/setup/']:
return
params = cgi.FieldStorage(fp=self.rfile,
headers=self.headers,
environ={
'REQUEST_METHOD': 'POST',
'CONTENT_TYPE': self.headers['Content-Type']})
dokku_root = os.getenv('DOKKU_ROOT', '/home/dokku')
if 'vhost' in params and params['vhost'].value == 'true':
with open('{0}/VHOST'.format(dokku_root), 'w') as f:
f.write(params['hostname'].value)
else:
try:
os.remove('{0}/VHOST'.format(dokku_root))
except OSError:
pass
with open('{0}/HOSTNAME'.format(dokku_root), 'w') as f:
f.write(params['hostname'].value)
command = ['sshcommand', 'acl-add', 'dokku', 'admin']
for key in params['keys'].value.split("\n"):
proc = subprocess.Popen(command, stdin=subprocess.PIPE)
proc.stdin.write(key)
proc.stdin.close()
proc.wait()
if 'selfdestruct' in sys.argv:
DeleteInstallerThread()
self.send_response(200)
self.end_headers()
self.wfile.write(json.dumps({'status': 'ok'}))
class DeleteInstallerThread(object):
def __init__(self, interval=1):
thread = threading.Thread(target=self.run, args=())
thread.daemon = True
thread.start()
def run(self):
command = "rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start"
try:
subprocess.call(command, shell=True)
except:
pass
command = "rm -f /etc/init/dokku-installer.conf /etc/systemd/system/dokku-installer.service && stop dokku-installer"
try:
subprocess.call(command, shell=True)
except:
pass
def main():
check_boot()
port = int(os.getenv('PORT', 2000))
httpd = SocketServer.TCPServer(("", port), GetHandler)
print "Listening on 0.0.0.0:{0}, CTRL+C to stop".format(port)
httpd.serve_forever()
PAGE = """
<html>
<head>
<title>Dokku Setup</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class="container" style="width: 640px;">
<form id="form" role="form">
<h1>Dokku Setup <small>{VERSION}</small></h1>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Admin Access</small></h3>
<label for="key">Public Key</label><br />
<textarea class="form-control" name="keys" rows="7" id="key">{ADMIN_KEYS}</textarea>
</div>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Hostname Configuration</small></h3>
<div class="form-group">
<label for="hostname">Hostname</label>
<input class="form-control" type="text" id="hostname" name="hostname" value="{HOSTNAME}" />
</div>
<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>
<p>Your app URLs will look like:</p>
<pre id="example">http://hostname:port</pre>
</div>
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span style="padding-left: 20px;" id="result"></span>
</form>
</div>
<div id="error-output"></div>
<script>
function setup() {
if ($.trim($("#key").val()) == "") {
alert("Your admin public key cannot be blank.")
return
}
if ($.trim($("#hostname").val()) == "") {
alert("Your hostname cannot be blank.")
return
}
data = $("#form").serialize()
$("input,textarea,button").prop("disabled", true);
$.post('/setup', data)
.done(function() {
$("#result").html("Success!")
window.location.href = "http://progrium.viewdocs.io/dokku/application-deployment";
})
.fail(function(data) {
$("#result").html("Something went wrong...")
$("#error-output").html(data.responseText)
});
}
function update() {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
alert("In order to use virtualhost naming, the hostname must not be an IP but a valid domain name.")
$("#vhost").prop('checked', false);
}
if ($("#vhost").is(':checked')) {
$("#example").html("http://&lt;app-name&gt;."+$("#hostname").val())
} else {
$("#example").html("http://"+$("#hostname").val()+":&lt;app-port&gt;")
}
}
$("#vhost").change(update);
$("#hostname").change(update);
update();
</script>
</body>
</html>
"""
if __name__ == "__main__":
main()

View File

@@ -1,136 +0,0 @@
#!/usr/bin/env ruby
require "sinatra"
require "open3"
if ARGV[0] == "onboot"
File.open("/etc/init/dokku-installer.conf", "w") do |f|
f.puts "start on runlevel [2345]"
f.puts "exec #{File.absolute_path(__FILE__)} selfdestruct"
end if File.directory?("/etc/init")
File.open("/etc/systemd/system/dokku-installer.service", "w") do |f|
f.puts "[Unit]"
f.puts "Description=Dokku web-installer"
f.puts ""
f.puts "[Service]"
f.puts "ExecStart=#{File.absolute_path(__FILE__)} selfdestruct"
f.puts ""
f.puts "[Install]"
f.puts "WantedBy=multi-user.target"
f.puts "WantedBy=graphical.target"
end if File.directory?("/etc/systemd/system")
File.open("/etc/nginx/conf.d/dokku-installer.conf", "w") do |f|
f.puts "upstream dokku-installer { server 127.0.0.1:2000; }"
f.puts "server {"
f.puts " listen 80;"
f.puts " location / {"
f.puts " proxy_pass http://dokku-installer;"
f.puts " }"
f.puts "}"
end
`rm -f /etc/nginx/sites-enabled/*`
puts "Installed Upstart service and default Nginx virtualhost for installer to run on boot."
exit
end
version = "v0.4.5"
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
admin_keys = `cat /root/.ssh/authorized_keys`.split("\n")
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'`.strip
template = DATA.read
set :port, 2000
set :environment, :production
disable :protection
get "/" do
ERB.new(template).result binding
end
post "/setup" do
if params[:vhost] == "true"
File.open("#{dokku_root}/VHOST", "w") {|f| f.write params[:hostname] }
else
`rm #{dokku_root}/VHOST`
end
File.open("#{dokku_root}/HOSTNAME", "w") {|f| f.write params[:hostname] }
keys = params[:keys].split("\n")
keys.each do |k|
Open3.capture2("sshcommand acl-add dokku admin", :stdin_data => k)
end
Thread.new {
`rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start`
`rm -f /etc/init/dokku-installer.conf /etc/systemd/system/dokku-installer.service && stop dokku-installer`
}.run if ARGV[0] == "selfdestruct"
end
__END__
<html>
<head>
<title>Dokku Setup</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class="container" style="width: 640px;">
<form id="form" role="form">
<h1>Dokku Setup <small><%= version %></small></h1>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Admin Access</small></h3>
<label for="key">Public Key</label><br />
<textarea class="form-control" name="keys" rows="7" id="key"><% admin_keys.each do |key| %><%= key + "\n" %><% end %></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 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>
<p>Your app URLs will look like:</p>
<pre id="example">http://hostname:port</pre>
</div>
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span style="padding-left: 20px;" id="result"></span>
</form>
</div>
<div id="error-output"></div>
<script>
function setup() {
if ($.trim($("#key").val()) == "") {
alert("Your admin public key cannot be blank.")
return
}
if ($.trim($("#hostname").val()) == "") {
alert("Your hostname cannot be blank.")
return
}
data = $("#form").serialize()
$("input,textarea,button").prop("disabled", true);
$.post('/setup', data)
.done(function() {
$("#result").html("Success!")
window.location.href = "http://progrium.viewdocs.io/dokku/application-deployment";
})
.fail(function(data) {
$("#result").html("Something went wrong...")
$("#error-output").html(data.responseText)
});
}
function update() {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
alert("In order to use virtualhost naming, the hostname must not be an IP but a valid domain name.")
$("#vhost").prop('checked', false);
}
if ($("#vhost").is(':checked')) {
$("#example").html("http://&lt;app-name&gt;."+$("#hostname").val())
} else {
$("#example").html("http://"+$("#hostname").val()+":&lt;app-port&gt;")
}
}
$("#vhost").change(update);
$("#hostname").change(update);
update();
</script>
</body>
</html>

49
deb.mk
View File

@@ -1,32 +1,30 @@
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.3.5 HEROKUISH_VERSION ?= 0.3.8
HEROKUISH_ARCHITECTURE = amd64 HEROKUISH_ARCHITECTURE = amd64
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
DOKKU_DESCRIPTION = 'Docker powered mini-Heroku in around 100 lines of Bash' DOKKU_DESCRIPTION = 'Docker powered mini-Heroku in around 100 lines of Bash'
DOKKU_REPO_NAME ?= progrium/dokku DOKKU_REPO_NAME ?= dokku/dokku
DOKKU_ARCHITECTURE = amd64 DOKKU_ARCHITECTURE = amd64
PLUGN_DESCRIPTION = 'Hook system that lets users extend your application with plugins' PLUGN_DESCRIPTION = 'Hook system that lets users extend your application with plugins'
PLUGN_REPO_NAME ?= progrium/plugn PLUGN_REPO_NAME ?= dokku/plugn
PLUGN_VERSION ?= 0.2.0 PLUGN_VERSION ?= 0.2.1
PLUGN_ARCHITECTURE = amd64 PLUGN_ARCHITECTURE = amd64
PLUGN_PACKAGE_NAME = plugn_$(PLUGN_VERSION)_$(PLUGN_ARCHITECTURE).deb PLUGN_PACKAGE_NAME = plugn_$(PLUGN_VERSION)_$(PLUGN_ARCHITECTURE).deb
SSHCOMMAND_DESCRIPTION = 'Turn SSH into a thin client specifically for your app' SSHCOMMAND_DESCRIPTION = 'Turn SSH into a thin client specifically for your app'
SSHCOMMAND_REPO_NAME ?= progrium/sshcommand SSHCOMMAND_REPO_NAME ?= dokku/sshcommand
SSHCOMMAND_VERSION ?= 0.1.0 SSHCOMMAND_VERSION ?= 0.1.0
SSHCOMMAND_ARCHITECTURE = amd64 SSHCOMMAND_ARCHITECTURE = amd64
SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb
GEM_ARCHITECTURE = amd64
GOROOT = /usr/lib/go GOROOT = /usr/lib/go
GOBIN = /usr/bin/go GOBIN = /usr/bin/go
GOPATH = /home/vagrant/gocode GOPATH = /home/vagrant/gocode
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-gems deb-plugn deb-setup deb-sshcommand .PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-plugn deb-setup deb-sshcommand
install-from-deb: install-from-deb:
echo "--> Initial apt-get update" echo "--> Initial apt-get update"
@@ -42,7 +40,7 @@ install-from-deb:
sudo apt-get update -qq > /dev/null sudo apt-get update -qq > /dev/null
sudo apt-get install dokku sudo apt-get install dokku
deb-all: deb-herokuish deb-dokku deb-gems deb-plugn deb-sshcommand deb-all: deb-herokuish deb-dokku deb-plugn deb-sshcommand
mv /tmp/*.deb . mv /tmp/*.deb .
echo "Done" echo "Done"
@@ -77,7 +75,7 @@ deb-herokuish: deb-setup
cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish
echo "-> Creating $(HEROKUISH_PACKAGE_NAME)" echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'docker-engine | docker-engine-cs' --deb-pre-depends sudo --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' . sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'docker-engine-cs | docker-engine | lxc-docker (>= 1.6.1) | docker.io (>= 1.6.1) | tutum-agent' --deb-pre-depends sudo --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' .
mv *.deb /tmp mv *.deb /tmp
deb-dokku: deb-setup deb-dokku: deb-setup
@@ -87,16 +85,19 @@ deb-dokku: deb-setup
cp -r debian /tmp/build/DEBIAN cp -r debian /tmp/build/DEBIAN
mkdir -p /tmp/build/usr/local/bin mkdir -p /tmp/build/usr/local/bin
mkdir -p /tmp/build/var/lib/dokku/core-plugins/available mkdir -p /tmp/build/var/lib/dokku/core-plugins/available
mkdir -p /tmp/build/usr/local/share/man/man1 mkdir -p /tmp/build/usr/share/man/man1
mkdir -p /tmp/build/usr/local/share/dokku/contrib mkdir -p /tmp/build/usr/share/dokku/contrib
mkdir -p /tmp/build/usr/share/doc/dokku
cp dokku /tmp/build/usr/local/bin cp dokku /tmp/build/usr/local/bin
cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done
$(MAKE) help2man $(MAKE) help2man
$(MAKE) addman $(MAKE) addman
cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/local/share/man/man1/dokku.1 cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1
cp contrib/dokku-installer.rb /tmp/build/usr/local/share/dokku/contrib gzip -9 /tmp/build/usr/share/man/man1/dokku.1
cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
git describe --tags > /tmp/build/var/lib/dokku/VERSION git describe --tags > /tmp/build/var/lib/dokku/VERSION
cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
@@ -104,18 +105,6 @@ deb-dokku: deb-setup
dpkg-deb --build /tmp/build "/vagrant/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb" dpkg-deb --build /tmp/build "/vagrant/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
mv *.deb /tmp mv *.deb /tmp
deb-gems: deb-setup
rm -rf /tmp/tmp /tmp/build rubygem-*.deb
mkdir -p /tmp/tmp /tmp/build
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp rack -v 1.5.2 > /dev/null
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp rack-protection -v 1.5.3 > /dev/null
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp sinatra -v 1.4.5 > /dev/null
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp tilt -v 1.4.1 > /dev/null
find /tmp/tmp/cache -name '*.gem' | xargs -rn1 fpm -d ruby -d ruby --prefix /var/lib/gems/1.9.1 -s gem -t deb -a $(GEM_ARCHITECTURE)
mv *.deb /tmp
deb-plugn: deb-setup deb-plugn: deb-setup
rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME) rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build mkdir -p /tmp/tmp /tmp/build
@@ -129,10 +118,10 @@ deb-plugn: deb-setup
sudo apt-get clean sudo apt-get clean
sudo apt-get update -qq > /dev/null sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y git golang mercurial > /dev/null 2>&1 sudo apt-get install -qq -y git golang mercurial > /dev/null 2>&1
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && go get github.com/progrium/plugn export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && go get github.com/dokku/plugn
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/progrium/plugn && make deps export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/dokku/plugn && make deps
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/progrium/plugn && rm plugn && go build -o plugn export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/dokku/plugn && rm plugn && go build -o plugn
mv /home/vagrant/gocode/src/github.com/progrium/plugn/plugn /tmp/build/usr/local/bin/plugn mv /home/vagrant/gocode/src/github.com/dokku/plugn/plugn /tmp/build/usr/local/bin/plugn
echo "-> Creating $(PLUGN_PACKAGE_NAME)" echo "-> Creating $(PLUGN_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n plugn -v $(PLUGN_VERSION) -a $(PLUGN_ARCHITECTURE) -p $(PLUGN_PACKAGE_NAME) --url "https://github.com/$(PLUGN_REPO_NAME)" --description $(PLUGN_DESCRIPTION) --license 'MIT License' . sudo fpm -t deb -s dir -C /tmp/build -n plugn -v $(PLUGN_VERSION) -a $(PLUGN_ARCHITECTURE) -p $(PLUGN_PACKAGE_NAME) --url "https://github.com/$(PLUGN_REPO_NAME)" --description $(PLUGN_DESCRIPTION) --license 'MIT License' .

0
debian/conffiles vendored
View File

10
debian/control vendored
View File

@@ -1,9 +1,11 @@
Package: dokku Package: dokku
Version: 0.4.5 Version: 0.4.12
Section: web Section: web
Priority: optional Priority: optional
Architecture: amd64 Architecture: amd64
Depends: locales, git, make, curl, gcc, man-db, herokuish, sshcommand, docker-engine-cs | docker-engine | lxc-docker (>= 1.6.2) | docker.io (>= 1.6.2), software-properties-common, python-software-properties Depends: locales, git, make, curl, gcc, man-db, sshcommand, docker-engine-cs | docker-engine | lxc-docker (>= 1.6.1) | docker.io (>= 1.6.1) | tutum-agent, software-properties-common, python-software-properties
Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo, ruby, ruby-dev, rubygem-rack , rubygem-rack-protection, rubygem-sinatra, rubygem-tilt Recommends: herokuish
Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo, python2.7, debconf
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com> Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
Description: Docker powered mini-Heroku in around 100 lines of Bash Description: Docker-powered PaaS that helps build and manage the lifecycle of applications

66
debian/postinst vendored
View File

@@ -1,9 +1,10 @@
#!/bin/sh #!/bin/bash
set -e set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule . /usr/share/debconf/confmodule
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}" readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
case "$1" in case "$1" in
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)
@@ -17,44 +18,58 @@ case "$1" in
egrep -i "^docker" /etc/group || groupadd docker egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku usermod -aG docker dokku
# setup plugin directories echo "Setting up plugin directories"
# should be replaced by `plugn init` # should be replaced by `plugn init`
mkdir -p /var/lib/dokku/core-plugins/available /var/lib/dokku/plugins/available mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/available ${DOKKU_LIB_ROOT}/plugins/available
mkdir -p /var/lib/dokku/core-plugins/enabled /var/lib/dokku/plugins/enabled mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/enabled ${DOKKU_LIB_ROOT}/plugins/enabled
touch /var/lib/dokku/core-plugins/config.toml /var/lib/dokku/plugins/config.toml touch ${DOKKU_LIB_ROOT}/core-plugins/config.toml ${DOKKU_LIB_ROOT}/plugins/config.toml
# migrate old plugins echo "Migrating old plugins"
find /var/lib/dokku/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do find ${DOKKU_LIB_ROOT}/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then
continue continue
elif [ -f /var/lib/dokku/plugins/$plugin/.core ]; then elif [ -f ${DOKKU_LIB_ROOT}/plugins/$plugin/.core ]; then
rm -rf /var/lib/dokku/plugins/$plugin rm -rf ${DOKKU_LIB_ROOT}/plugins/$plugin
elif [ ! -d /var/lib/dokku/plugins/available/$plugin ]; then elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
mv /var/lib/dokku/plugins/$plugin /var/lib/dokku/plugins/available; mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available;
fi fi
done done
# enable all core plugins echo "Enabling all core plugins"
find /var/lib/dokku/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 /var/lib/dokku/plugins/available/$plugin ]; then if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
ln -s /var/lib/dokku/core-plugins/available/$plugin /var/lib/dokku/plugins/available/$plugin; ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
PLUGIN_PATH=/var/lib/dokku/core-plugins plugn enable $plugin PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin
PLUGIN_PATH=/var/lib/dokku/plugins plugn enable $plugin PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
fi fi
done done
chown dokku:dokku -R /var/lib/dokku/plugins /var/lib/dokku/core-plugins chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
echo "Install all core plugins"
dokku plugin:install --core dokku plugin:install --core
rm -f /home/dokku/VERSION rm -f ${DOKKU_ROOT}/VERSION
cp /var/lib/dokku/STABLE_VERSION /home/dokku/VERSION cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION
if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then if [[ -f /etc/nginx/conf.d/dokku-installer.conf ]]; then
sudo service dokku-installer start echo "Setting up dokku-installer"
/usr/share/dokku/contrib/dokku-installer.py onboot
if command -v systemctl &>/dev/null; then
echo "Enabling dokku-installer"
systemctl enable dokku-installer
fi
installer_status="$(service dokku-installer status 2> /dev/null || true)"
if echo $installer_status | grep -Eq "(inactive|waiting)" > /dev/null; then
echo "Starting dokku-installer"
service dokku-installer start || echo "Unable to start dokku-installer"
fi
fi fi
db_get "dokku/web_config" db_get "dokku/web_config"
if [ "$RET" = "true" ]; then if [ "$RET" = "true" ]; then
db_stop
exit 0 exit 0
fi fi
@@ -71,7 +86,9 @@ case "$1" in
if [ -z "${DEBCONF_RECONFIGURE}" ]; then if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/key_file" db_get "dokku/key_file"
sshcommand acl-add dokku default < "$RET" if [ -f "$RET" ]; then
sshcommand acl-add dokku default < "$RET"
fi
fi fi
;; ;;
@@ -81,4 +98,5 @@ case "$1" in
;; ;;
esac esac
db_stop
exit 0 exit 0

45
debian/postrm vendored Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
main() {
if [[ -f /etc/systemd/system/dokku-installer.conf ]] || [[ -f /etc/init/dokku-installer.conf ]]; then
service dokku-installer stop || true
fi
rm -f /etc/init/dokku-installer.conf
rm -f /etc/init/dokku-redeploy.conf
rm -f /etc/systemd/system/dokku-installer.conf
rm -f /etc/systemd/system/dokku-redeploy.service
rm -f /etc/update-motd.d/99-dokku
service nginx reload
if [[ "$1" == "purge" ]]; then
rm -f ${DOKKU_ROOT}/.dokkurc ${DOKKU_ROOT}/dokkurc ${DOKKU_ROOT}/tls
rm -f ${DOKKU_ROOT}/.ssh/authorized_keys ${DOKKU_ROOT}/.sshcommand
rm -f ${DOKKU_ROOT}/ENV ${DOKKU_ROOT}/HOSTNAME ${DOKKU_ROOT}/VERSION
rm -rf ${DOKKU_ROOT}/.cache
rm -rf ${DOKKU_LIB_ROOT}/core-plugins
rm -f ${DOKKU_LIB_ROOT}/plugins/config.toml
if [[ -d ${DOKKU_LIB_ROOT} ]]; then
find -L ${DOKKU_LIB_ROOT} -type l -delete
find ${DOKKU_LIB_ROOT} -type d -empty -delete
fi
if [[ -d ${DOKKU_ROOT} ]]; then
find -L ${DOKKU_ROOT} -type l -delete
find ${DOKKU_ROOT} -type d -empty -delete
fi
if [[ -e /usr/share/debconf/confmodule ]]; then
. /usr/share/debconf/confmodule
db_purge
fi
fi
}
main "$@"

13
debian/preinst vendored
View File

@@ -1,5 +1,5 @@
#!/bin/sh #!/bin/bash
set -e set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule . /usr/share/debconf/confmodule
@@ -7,14 +7,8 @@ case "$1" in
install) install)
db_get "dokku/web_config" db_get "dokku/web_config"
if [ "$RET" = "true" ]; then if [ "$RET" = "true" ]; then
INIT_CONF="/etc/init/dokku-installer.conf"
NGINX_CONF="/etc/nginx/conf.d/dokku-installer.conf" NGINX_CONF="/etc/nginx/conf.d/dokku-installer.conf"
rm -f $INIT_CONF
touch $INIT_CONF
echo 'start on runlevel [2345]' >> $INIT_CONF
echo 'exec /usr/local/share/dokku/contrib/dokku-installer.rb selfdestruct' >> $INIT_CONF
rm -f $NGINX_CONF rm -f $NGINX_CONF
touch $NGINX_CONF touch $NGINX_CONF
@@ -33,7 +27,8 @@ case "$1" in
exit 0 exit 0
fi fi
if [ -z "${DEBCONF_RECONFIGURE}" ]; then db_get "dokku/skip_key_file"
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."

55
debian/prerm vendored Executable file
View File

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

13
debian/templates vendored
View File

@@ -1,19 +1,24 @@
Template: dokku/web_config Template: dokku/web_config
Description: Use the web-based config page? Description: Enable the web-based config page?
Type: boolean Type: boolean
Default: true Default: true
Template: dokku/vhost_enable Template: dokku/vhost_enable
Description: Use vhost based deployments? Description: Enable vhost-based deployments?
Type: boolean Type: boolean
Default: false Default: false
Template: dokku/hostname Template: dokku/hostname
Description: Machine's hostname or IP Description: Hostname or IP for server:
Type: string Type: string
Default: dokku.me Default: dokku.me
Template: dokku/skip_key_file
Description: Skip key file requirement?
Type: boolean
Default: false
Template: dokku/key_file Template: dokku/key_file
Description: Keyfile for initial user Description: Keyfile for initial user:
Type: string Type: string
Default: /root/.ssh/id_rsa.pub Default: /root/.ssh/id_rsa.pub

View File

@@ -3,7 +3,7 @@
You can always install dokku straight from the latest - potentially unstable - master release via the following bash command: You can always install dokku straight from the latest - potentially unstable - master release via the following bash command:
```shell ```shell
wget -qO- https://raw.githubusercontent.com/progrium/dokku/master/bootstrap.sh | sudo DOKKU_BRANCH=master bash wget -qO- https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh | sudo DOKKU_BRANCH=master bash
``` ```
## Development ## Development
@@ -27,7 +27,7 @@ sudo SSHCOMMAND_URL=https://raw.githubusercontent.com/yourusername/sshcommand/ma
The bootstrap script allows the dokku repository URL to be overridden to bootstrap a host from your own clone of dokku using the `DOKKU_REPO` environment variable. Example: The bootstrap script allows the dokku repository URL to be overridden to bootstrap a host from your own clone of dokku using the `DOKKU_REPO` environment variable. Example:
```shell ```shell
wget https://raw.githubusercontent.com/progrium/dokku/master/bootstrap.sh wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
chmod +x bootstrap.sh chmod +x bootstrap.sh
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
``` ```
@@ -37,7 +37,7 @@ sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./
Dokku ships with a pre-built version of version of the [herokuish](https://github.com/gliderlabs/herokuish) component by default. If you want to build your own version you can specify that with an env variable. Dokku ships with a pre-built version of version of the [herokuish](https://github.com/gliderlabs/herokuish) component by default. If you want to build your own version you can specify that with an env variable.
```shell ```shell
git clone https://github.com/progrium/dokku.git git clone https://github.com/dokku/dokku.git
cd dokku cd dokku
sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make install sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make install
``` ```

View File

@@ -100,6 +100,18 @@ This will prompt you to verify the application's name before destroying it. You
dokku --force apps:destroy APP dokku --force apps:destroy APP
``` ```
### Renaming a deployed app
> New as of 0.4.7
You can rename a deployed app using the `apps:rename` CLI tool:
```shell
dokku apps:rename OLD_NAME NEW_NAME
```
This will copy all of your app's contents into a new app directory with the name of your choice, delete your old app, then rebuild the new version of the app and deploy it. All of your config variables, including database urls, will be preserved.
### Adding deploy users ### Adding deploy users
While it is possible to use password-based authorization to push to Dokku, it is preferable to use key-based authentication for security. You can add your public key to the dokku user's `authorized_keys` file with the following command: While it is possible to use password-based authorization to push to Dokku, it is preferable to use key-based authentication for security. You can add your public key to the dokku user's `authorized_keys` file with the following command:
@@ -116,6 +128,14 @@ Dokku only supports deploying from its master branch, so if you'd like to deploy
You can also support pushing multiple branches using the [receive-branch](/dokku/development/plugin-triggers/#receive-branch) plugin trigger in a custom plugin. You can also support pushing multiple branches using the [receive-branch](/dokku/development/plugin-triggers/#receive-branch) plugin trigger in a custom plugin.
### Skipping deployment
If you only want to rebuild and tag a container, you can skip the deployment phase by setting `$DOKKU_SKIP_DEPLOY` to `true` by running:
``` shell
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
```
### Deploying with private git submodules ### Deploying with private git submodules
Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly. Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
@@ -162,7 +182,7 @@ This is in particular useful, then you want to deploy to root domain, as
## Dokku/Docker Container Management Compatibility ## Dokku/Docker Container Management Compatibility
Dokku is, at its core, a docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the docker daemon. One thing to note as in [issue #1220](https://github.com/progrium/dokku/issues/1220), dokku executes a cleanup function prior to every deployment. This function removes all exited containers and all 'unattached' images. Dokku is, at its core, a docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the docker daemon. One thing to note as in [issue #1220](https://github.com/dokku/dokku/issues/1220), dokku executes a cleanup function prior to every deployment. This function removes all exited containers and all 'unattached' images.
### Specifying a custom buildpack ### Specifying a custom buildpack

View File

@@ -2,10 +2,10 @@
<browserconfig> <browserconfig>
<msapplication> <msapplication>
<tile> <tile>
<square70x70logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-70x70.png"/> <square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-150x150.png"/> <square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-310x310.png"/> <square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-310x150.png"/> <wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.12/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.4.5\/docs\/assets\/favicons\/android-chrome-36x36.png", "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.12\/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.4.5\/docs\/assets\/favicons\/android-chrome-48x48.png", "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.12\/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.4.5\/docs\/assets\/favicons\/android-chrome-72x72.png", "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.12\/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.4.5\/docs\/assets\/favicons\/android-chrome-96x96.png", "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.12\/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.4.5\/docs\/assets\/favicons\/android-chrome-144x144.png", "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.12\/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.4.5\/docs\/assets\/favicons\/android-chrome-192x192.png", "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.12\/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

@@ -25,7 +25,7 @@ h1 {
padding: 0 0 0 1em; padding: 0 0 0 1em;
} }
.header a { .header a {
background-image: url(https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/dokku.png); background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/dokku.png);
color: #fff; color: #fff;
text-indent: 40px; text-indent: 40px;
background-position: center left; background-position: center left;
@@ -40,7 +40,7 @@ h1 {
.blurb { .blurb {
color: #424242; color: #424242;
background-color: #ededed; background-color: #ededed;
background-image: url(https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/gplaypattern.png); background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/gplaypattern.png);
padding: 45px 0; padding: 45px 0;
text-align: center; text-align: center;
} }

View File

@@ -11,7 +11,7 @@ Of all methods, this is the *most* official method of interacting with your dokk
To install, simply clone the dokku repository down and add the `dokku` alias pointing at the script: To install, simply clone the dokku repository down and add the `dokku` alias pointing at the script:
```shell ```shell
git clone git@github.com:progrium/dokku.git ~/.dokku git clone git@github.com:dokku/dokku.git ~/.dokku
# add the following to either your # add the following to either your
# .bashrc, .bash_profile, or .profile file # .bashrc, .bash_profile, or .profile file

View File

@@ -2,7 +2,7 @@
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager * [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
* [Herokuish](https://github.com/gliderlabs/herokuish) - Buildpack builder * [Herokuish](https://github.com/gliderlabs/herokuish) - Buildpack builder
* [plugn](https://github.com/progrium/plugn) - Shell based plugins and hooks * [plugn](https://github.com/dokku/plugn) - Shell based plugins and hooks
* [sshcommand](https://github.com/progrium/sshcommand) - Fixed commands over SSH * [sshcommand](https://github.com/dokku/sshcommand) - Fixed commands over SSH
Looking to keep codebase as simple and hackable as possible, so try to keep your line count down. Looking to keep codebase as simple and hackable as possible, so try to keep your line count down.

View File

@@ -30,7 +30,7 @@ dokku config:set node-js-app KEY=\"VAL\ WITH\ SPACES\"
When setting or unsetting environment variables, you may wish to avoid an application restart. This is useful when developing plugins or when setting multiple environment variables in a scripted manner. To do so, use the `--no-restart` flag: When setting or unsetting environment variables, you may wish to avoid an application restart. This is useful when developing plugins or when setting multiple environment variables in a scripted manner. To do so, use the `--no-restart` flag:
```shell ```shell
dokku --no-restart config:set node-js-app ENV=prod dokku config:set --no-restart node-js-app ENV=prod
``` ```
If you wish to have the variables output in an `eval`-compatible form, you can use the `--export` flag: If you wish to have the variables output in an `eval`-compatible form, you can use the `--export` flag:

View File

@@ -18,7 +18,7 @@ By default, Dokku will extract the first `EXPOSE` tcp port and use said port wit
dokku config:set APP DOKKU_DOCKERFILE_PORT=8000 dokku config:set APP DOKKU_DOCKERFILE_PORT=8000
``` ```
Dokku will not expose other ports on your application without a [custom docker-option](/dokku/configuration/docker-options/). Dokku will not expose other ports on your application without a [custom docker-option](/dokku/docker-options/).
If you do not have a port explicitly exposed, Dokku will automatically expose port `5000` for your application. If you do not have a port explicitly exposed, Dokku will automatically expose port `5000` for your application.

View File

@@ -33,7 +33,7 @@ root@dokku:~# dokku tags:deploy node-js-app v0.9.0
-----> Deploying node-js-app (dokku/node-js-app:v0.9.0)... -----> Deploying node-js-app (dokku/node-js-app:v0.9.0)...
-----> Running pre-flight checks -----> Running pre-flight checks
For more efficient zero downtime deployments, create a file CHECKS. For more efficient zero downtime deployments, create a file CHECKS.
See http://progrium.viewdocs.io/dokku/checks-examples.md for examples See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
CHECKS file not found in container: Running simple container check... CHECKS file not found in container: Running simple container check...
-----> Waiting for 10 seconds ... -----> Waiting for 10 seconds ...
-----> Default container check successful! -----> Default container check successful!

View File

@@ -26,7 +26,13 @@ The `certs:add` command can be used to push a `tar` containing a certificate `.c
```shell ```shell
tar cvf cert-key.tar server.crt server.key tar cvf cert-key.tar server.crt server.key
# replace APP with the name of your application # replace APP with the name of your application
dokku certs:add < cert-key.tar dokku certs:add <app> < cert-key.tar
```
> Note: If your `.crt` file came alongside a `.ca-bundle`, you'll want to concatenate those into a single `.crt` file before adding it to the `.tar`.
```shell
cat yourdomain_com.crt yourdomain_com.ca-bundle > server.crt
``` ```
### Certificate generation ### Certificate generation

View File

@@ -3,9 +3,9 @@
If you create your own plugin: If you create your own plugin:
1. Take a look at the plugins shipped with dokku and hack away! 1. Take a look at the plugins shipped with dokku and hack away!
2. Check out the [list of triggers](http://progrium.viewdocs.io/dokku/development/plugin-triggers) your plugin can implement. 2. Check out the [list of triggers](http://dokku.viewdocs.io/dokku/development/plugin-triggers) your plugin can implement.
3. Upload your plugin to github with a repository name in form of `dokku-<name>` (e.g. `dokku-mariadb`) 3. Upload your plugin to github with a repository name in form of `dokku-<name>` (e.g. `dokku-mariadb`)
4. Edit [this page](http://progrium.viewdocs.io/dokku/plugins) and add a link to it. 4. Edit [this page](http://dokku.viewdocs.io/dokku/plugins) and add a link to it.
5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases 5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases
### Sample plugin ### Sample plugin
@@ -89,4 +89,5 @@ A few notes:
dokku config:unset --no-restart APP KEY1 [KEY2 ...] dokku config:unset --no-restart APP KEY1 [KEY2 ...]
``` ```
- From time to time you may want to allow other plugins access to (some of) your plugin's functionality. You can expose this by including a `functions` file in your plugin for others to source. Consider all functions in that file to be publicly accessible by other plugins. Any functions not wished to be made "public" should reside within your plugin trigger or commands files. - From time to time you may want to allow other plugins access to (some of) your plugin's functionality. You can expose this by including a `functions` file in your plugin for others to source. Consider all functions in that file to be publicly accessible by other plugins. Any functions not wished to be made "public" should reside within your plugin trigger or commands files.
- As of 0.4.0, we allow image tagging and deployment of said tagged images. Therefore, hard-coding of `$IMAGE` as `dokku/$APP` is no longer sufficient. Instead, for non `pre/post-build-*` plugins, use `get_running_image_tag()` & `get_app_image_name()` as sourced from common/functions. See the [plugin triggers](http://progrium.viewdocs.io/dokku/development/plugin-triggers) doc for examples. - As of 0.4.0, we allow image tagging and deployment of said tagged images. Therefore, hard-coding of `$IMAGE` as `dokku/$APP` is no longer sufficient. Instead, for non `pre/post-build-*` plugins, use `get_running_image_tag()` & `get_app_image_name()` as sourced from common/functions. See the [plugin triggers](http://dokku.viewdocs.io/dokku/development/plugin-triggers) doc for examples.
- As of 0.5.0, we use container labels to help cleanup intermediate containers with `dokku cleanup`. If manually calling `docker run`, include `$DOKKU_GLOBAL_RUN_ARGS`. This will ensure you intermediate containers labeled correctly.

View File

@@ -1,6 +1,6 @@
# Plugin triggers # Plugin triggers
[Plugin triggers](https://github.com/progrium/plugn) (formerly [pluginhooks](https://github.com/progrium/pluginhook)) are a good way to jack into existing dokku infrastructure. You can use them to modify the output of various dokku commands or override internal configuration. [Plugin triggers](https://github.com/dokku/plugn) (formerly [pluginhooks](https://github.com/progrium/pluginhook)) are a good way to jack into existing dokku infrastructure. You can use them to modify the output of various dokku commands or override internal configuration.
Plugin triggers are simply scripts that are executed by the system. You can use any language you want, so long as the script: Plugin triggers are simply scripts that are executed by the system. You can use any language you want, so long as the script:
@@ -263,7 +263,7 @@ CMD="cat > gm && \
dpkg -s graphicsmagick > /dev/null 2>&1 || \ dpkg -s graphicsmagick > /dev/null 2>&1 || \
(apt-get update && apt-get install -y graphicsmagick && apt-get clean)" (apt-get update && apt-get install -y graphicsmagick && apt-get clean)"
ID=$(docker run -i -a stdin $IMAGE /bin/bash -c "$CMD") ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
test $(docker wait $ID) -eq 0 test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE > /dev/null docker commit $ID $IMAGE > /dev/null
``` ```
@@ -290,7 +290,7 @@ CMD="cat > gm && \
dpkg -s CONTAINER_PACKAGE > /dev/null 2>&1 || \ dpkg -s CONTAINER_PACKAGE > /dev/null 2>&1 || \
(apt-get update && apt-get install -y CONTAINER_PACKAGE && apt-get clean)" (apt-get update && apt-get install -y CONTAINER_PACKAGE && apt-get clean)"
ID=$(docker run -i -a stdin $IMAGE /bin/bash -c "$CMD") ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
test $(docker wait $ID) -eq 0 test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE > /dev/null docker commit $ID $IMAGE > /dev/null
``` ```
@@ -374,12 +374,33 @@ APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP" verify_app_name "$APP"
dokku_log_info1 "Running gulp" dokku_log_info1 "Running gulp"
id=$(docker run -d $IMAGE /bin/bash -c "cd /app && gulp default") id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $IMAGE /bin/bash -c "cd /app && gulp default")
test $(docker wait $id) -eq 0 test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
dokku_log_info1 "Building UI Complete" dokku_log_info1 "Building UI Complete"
``` ```
### `post-create`
- Description: Can be used to run commands after an application is created.
- Invoked by: `dokku apps:create`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
# Runs a command to ensure that an app
# has a postgres database when it is starting
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1";
POSTGRES="$1"
dokku postgres:create $POSTGRES
dokku postgres:link $POSTGRES $APP
```
### `post-deploy` ### `post-deploy`
- Description: Allows running of commands after a deploy has completed. Dokku core currently uses this to switch traffic on nginx. - Description: Allows running of commands after a deploy has completed. Dokku core currently uses this to switch traffic on nginx.
@@ -414,7 +435,7 @@ APP="$1"; GULP_CACHE_DIR="$DOKKU_ROOT/$APP/gulp"; IMAGE=$(get_app_image_name $AP
verify_app_name "$APP" verify_app_name "$APP"
if [[ -d $GULP_CACHE_DIR ]]; then if [[ -d $GULP_CACHE_DIR ]]; then
docker run --rm -v "$GULP_CACHE_DIR:/gulp" "$IMAGE" find /gulp -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true docker run $DOKKU_GLOBAL_RUN_ARGS --rm -v "$GULP_CACHE_DIR:/gulp" "$IMAGE" find /gulp -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
fi fi
``` ```
@@ -525,9 +546,9 @@ echo false
### `post-domains-update` ### `post-domains-update`
- Description: Allows you to run commands once the domain for an application has been updated. - Description: Allows you to run commands once the domain for an application has been updated. It also sends in the command that has been used. This can be "add", "clear" or "remove". The third argument will be the optional list of domains
- Invoked by: `dokku domains:add`, `dokku domains:clear`, `dokku domains:remove` - Invoked by: `dokku domains:add`, `dokku domains:clear`, `dokku domains:remove`
- Arguments: `$APP` - Arguments: `$APP` `action name` `domains`
- Example: - Example:
```shell ```shell

View File

@@ -4,7 +4,7 @@ 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:
- The installable version must be changed in the `contrib/dokku-installer.rb` file. - The installable version must be changed in the `contrib/dokku-installer.py` file.
- The installable version must be changed in the `debian/control` file. - The installable version must be changed in the `debian/control` file.
- The installable version must be changed in the `docs/home.html` file - The installable version must be changed in the `docs/home.html` file
- The installable version must be changed in the `docs/index.md` file - The installable version must be changed in the `docs/index.md` file

View File

@@ -14,7 +14,7 @@ Example apps can be found here:
### Executing tests locally ### Executing tests locally
- Setup dokku in a [vagrant vm](http://progrium.viewdocs.io/dokku/getting-started/install/vagrant) - Setup dokku in a [vagrant vm](http://dokku.viewdocs.io/dokku/getting-started/install/vagrant)
- Test setup and execution - Test setup and execution
```shell ```shell
@@ -22,15 +22,15 @@ Example apps can be found here:
$ sudo su - $ sudo su -
$ cd ~/dokku $ cd ~/dokku
$ make ci-dependencies setup-deploy-tests $ make ci-dependencies setup-deploy-tests
$ make test # run the entire test suite (linter, bats tests, and app deployment tests) $ make test # execute the entire test suite (linter, bats tests, and app deployment tests)
$ $
$ make lint # linter $ make lint copyfiles # run linter & update vagrant dokku install from local git clone
$ make unit-tests # bats tests $ make unit-tests # execute all bats tests
$ make deploy-tests # app deployment tests $ make deploy-tests # execute all app deployment tests
``` ```
- Additionally you may run a specific app deployment tests with a target similar to: - Additionally you may run a specific app deployment tests with a target similar to:
```shell ```shell
make deploy-test-nodejs-express $ 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.

View File

@@ -14,12 +14,12 @@ Because there are so many different DNS server packages out there as well as a t
* We assume you have a passing familiarity with DNS. If not, you can read an [in-depth article](http://www.diaryofaninja.com/blog/2012/03/03/devops-dns-for-developers-ndash-now-therersquos-no-excuse-not-to-know) on DNS. But basically you need to know that DNS changes names (like example.tld) into addresses (like 127.0.0.1) * We assume you have a passing familiarity with DNS. If not, you can read an [in-depth article](http://www.diaryofaninja.com/blog/2012/03/03/devops-dns-for-developers-ndash-now-therersquos-no-excuse-not-to-know) on DNS. But basically you need to know that DNS changes names (like example.tld) into addresses (like 127.0.0.1)
* We assume you already have a domain name registered and pointed to your favorite Managed DNS Provider or have your own BIND DNS server running. * We assume you already have a domain name registered and pointed to your favorite Managed DNS Provider or have your own BIND DNS server running.
* You have a server on the internet and are about to follow the instructions in the [README](https://github.com/progrium/dokku/blob/master/README.md) to get dokku installed. Don't do the install just yet though. * You have a server on the internet and are about to follow the instructions in the [README](https://github.com/dokku/dokku/blob/master/README.md) to get dokku installed. Don't do the install just yet though.
### HELP! ### HELP!
Don't be afraid to ask if you need help. Create a [new issue](https://github.com/progrium/dokku/issues) and someone will be glad to assist you. Don't be afraid to ask if you need help. Create a [new issue](https://github.com/dokku/dokku/issues) and someone will be glad to assist you.
# Getting started # Getting started
@@ -73,7 +73,7 @@ If everything is working correctly, you should also be able to query for any oth
If they all return your IP address, you have set DNS up properly for dokku. You should also be able to `ssh root@myserver.example.tld` and access your server. If they all return your IP address, you have set DNS up properly for dokku. You should also be able to `ssh root@myserver.example.tld` and access your server.
Proceed with the setup instructions in the [README](https://github.com/progrium/dokku/blob/master/README.md) Proceed with the setup instructions in the [README](https://github.com/dokku/dokku/blob/master/README.md)
### Using the root of your domain (myapp.example.tld) ### Using the root of your domain (myapp.example.tld)

View File

@@ -2,7 +2,7 @@
> New as of 0.3.17 > New as of 0.3.17
Pass [options](http://docs.docker.io/en/latest/reference/run/) to Docker during Dokku's `build`, `deploy` and `run` phases Pass [options](https://docs.docker.com/engine/reference/run/) to Docker during Dokku's `build`, `deploy` and `run` phases
``` ```
docker-options <app> Display app's Docker options for all phases docker-options <app> Display app's Docker options for all phases

View File

@@ -25,7 +25,7 @@ In case you want to perform an unattended installation of dokku, this is made po
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:
```bash ```bash
sudo echo "dokku dokku/vhost_enable boolean true" | debconf-set-selections echo "dokku dokku/vhost_enable boolean true" | sudo debconf-set-selections
``` ```
After setting the desired options, proceed with the installation as described above. After setting the desired options, proceed with the installation as described above.
@@ -37,4 +37,5 @@ After setting the desired options, proceed with the installation as described ab
| 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. <app>.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: This setting this to true, will require you to manually add an SSH key later on. |
| dokku/key_file | string | /root/.ssh/id_rsa.pub | SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) | | dokku/key_file | string | /root/.ssh/id_rsa.pub | SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) |

View File

@@ -36,4 +36,4 @@ __Warning__: These steps will delete *everything* on your Linode.
9. Lastly, reboot the Linode. 9. Lastly, reboot the Linode.
Once your server comes back online, you'll be running Ubuntu's default kernel. You can now follow Dokku's [normal installation instructions](http://progrium.viewdocs.io/dokku/installation) and `bootstrap.sh` will take care of everything else. Once your server comes back online, you'll be running Ubuntu's default kernel. You can now follow Dokku's [normal installation instructions](http://dokku.viewdocs.io/dokku/installation) and `bootstrap.sh` will take care of everything else.

View File

@@ -5,7 +5,7 @@
- Clone Dokku - Clone Dokku
``` ```
git clone https://github.com/progrium/dokku.git git clone https://github.com/dokku/dokku.git
``` ```
- Setup SSH hosts in your `/etc/hosts` - Setup SSH hosts in your `/etc/hosts`

View File

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

View File

@@ -10,26 +10,26 @@
<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/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/manifest.json"> <link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon.ico"> <link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/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/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-144x144.png"> <meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/browserconfig.xml"> <meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.12/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/3.3.5/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
@@ -87,12 +87,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/progrium/dokku/v0.4.5/bootstrap.sh</span> <span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.4.12/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.4.5 bash bootstrap.sh</span> <span class="command">sudo DOKKU_TAG=v0.4.12 bash bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span> <span class="output"># =&gt; Go to your server's IP and follow the web installer</span>
@@ -144,7 +144,7 @@
<div class="container"> <div class="container">
<footer> <footer>
<p class="pull-right"><a href="#">Back to top</a></p> <p class="pull-right"><a href="#">Back to top</a></p>
<p>&copy; 2013 Dokku</p> <p>&copy; 2013-2016 Dokku</p>
</footer> </footer>
</div> </div>
</body> </body>

View File

@@ -15,12 +15,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/progrium/dokku/v0.4.5/bootstrap.sh</span> <span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.4.12/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.4.5 bash bootstrap.sh</span> <span class="command">sudo DOKKU_TAG=v0.4.12 bash bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span> <span class="output"># =&gt; Go to your server's IP and follow the web installer</span>

View File

@@ -4,7 +4,7 @@
Dokku is an extensible, open source Platform as a Service that runs on a single server of your choice. Dokku is an extensible, open source Platform as a Service that runs on a single server of your choice.
To start using Dokku, you'll need a system with that meets the following minimum requirements: To start using Dokku, you'll need a system that meets the following minimum requirements:
- A fresh installation of [Ubuntu 14.04 x64](http://www.ubuntu.com/download/) with the FQDN set <sup>[1]</sup> - A fresh installation of [Ubuntu 14.04 x64](http://www.ubuntu.com/download/) with the FQDN set <sup>[1]</sup>
- At least `1GB` of system memory <sup>[2]</sup> - At least `1GB` of system memory <sup>[2]</sup>
@@ -19,8 +19,8 @@ To install the latest stable version of dokku, you can run the following shell c
```shell ```shell
# installs dokku via apt-get # installs dokku via apt-get
wget https://raw.githubusercontent.com/progrium/dokku/v0.4.5/bootstrap.sh wget https://raw.githubusercontent.com/dokku/dokku/v0.4.12/bootstrap.sh
sudo DOKKU_TAG=v0.4.5 bash bootstrap.sh sudo DOKKU_TAG=v0.4.12 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.
@@ -33,17 +33,17 @@ Once you save your settings, the web admin will self-terminate and you should be
For various reasons, certain hosting providers may have other steps that should be preferred to the above. If hosted on any of the following popular hosts, please follow the linked to instructions: For various reasons, certain hosting providers may have other steps that should be preferred to the above. If hosted on any of the following popular hosts, please follow the linked to instructions:
- [Digital Ocean Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/digitalocean) - [Digital Ocean Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/digitalocean)
- [Linode Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/linode/) - [Linode Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/linode/)
- [Microsoft Azure Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/azure/) - [Microsoft Azure Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/azure/)
As well, you may wish to customize your installation in some other fashion. or experiment with vagrant. The guides below should get you started: As well, you may wish to customize your installation in some other fashion. or experiment with vagrant. The guides below should get you started:
- [Debian Package Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/debian) - [Debian Package Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/debian)
- [Vagrant Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/vagrant) - [Vagrant Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/vagrant)
- [Advanced Install Customization](http://progrium.viewdocs.io/dokku/advanced-installation) - [Advanced Install Customization](http://dokku.viewdocs.io/dokku/advanced-installation)
--- ---
- <sup>[1]: To check whether your system has an fqdn set, run `sudo hostname -f`</sup> - <sup>[1]: To check whether your system has an fqdn set, run `sudo hostname -f`</sup>
- <sup>[2]: If your system has less than 1GB of memory, you can use ([this workaround](http://progrium.viewdocs.io/dokku/advanced-installation)).</sup> - <sup>[2]: If your system has less than 1GB of memory, you can use ([this workaround](http://dokku.viewdocs.io/dokku/advanced-installation)).</sup>

View File

@@ -16,7 +16,7 @@ nginx:error-logs <app> [-t] Show the nginx error logs for a
Dokku currently templates out an nginx configuration that is included in the `nginx-vhosts` plugin. If you'd like to provide a custom template for your application, there are a few options: Dokku currently templates out an nginx configuration that is included in the `nginx-vhosts` plugin. If you'd like to provide a custom template for your application, there are a few options:
- Copy the existing pertinent (ssl or non-ssl) template found (by default) in `/var/lib/dokku/plugins/available/nginx-vhosts/templates`, place it either in `/home/dokku/APP` or check it into your app repo, and name it one of the following: - Copy the existing pertinent (ssl or non-ssl) template found (by default) in `/var/lib/dokku/plugins/available/nginx-vhosts/templates`, place it either in `/home/dokku/APP` or check it into the root of your app repo, and name it one of the following:
- `nginx.conf.template` (since 0.3.10) - `nginx.conf.template` (since 0.3.10)
- `nginx.conf.ssl_terminated.template` (since 0.4.0) - `nginx.conf.ssl_terminated.template` (since 0.4.0)
- `nginx.ssl.conf.template` (since 0.4.2) - `nginx.ssl.conf.template` (since 0.4.2)

View File

@@ -1,6 +1,6 @@
# Plugins # Plugins
Dokku itself is built out of plugins and uses [plugn](https://github.com/progrium/plugn) for its plugin system. In essence a plugin is a collection of scripts that will be run based on naming convention. Dokku itself is built out of plugins and uses [plugn](https://github.com/dokku/plugn) for its plugin system. In essence a plugin is a collection of scripts that will be run based on naming convention.
Let's take a quick look at the current dokku nginx plugin that's shipped with dokku by default. Let's take a quick look at the current dokku nginx plugin that's shipped with dokku by default.
@@ -16,7 +16,7 @@ Let's take a quick look at the current dokku nginx plugin that's shipped with do
# This command requires `root` permissions as the `install` and `install-dependencies` # This command requires `root` permissions as the `install` and `install-dependencies`
# plugin triggers may utilize commands such as `apt-get`. For non-core plugins, please # plugin triggers may utilize commands such as `apt-get`. For non-core plugins, please
# inspect those plugins before running the following command as `root` user. # inspect those plugins before running the following command as `root` user.
sudo dokku plugin:install <git_url> sudo dokku plugin:install <git_url> [--committish tag/branch/commit|--name custom-plugin-name]
# previous versions (0.3.x and below) of dokku require a manual process to install plugins # previous versions (0.3.x and below) of dokku require a manual process to install plugins
cd /var/lib/dokku/plugins cd /var/lib/dokku/plugins
@@ -26,7 +26,7 @@ dokku plugins-install
## Creating your own plugin ## Creating your own plugin
[See the full documentation](http://progrium.viewdocs.io/dokku/development/plugin-creation). [See the full documentation](http://dokku.viewdocs.io/dokku/development/plugin-creation).
## Official Plugins (Beta) ## Official Plugins (Beta)
@@ -40,12 +40,14 @@ The following plugins are available and provided by dokku maintainers. Where not
| [Memcached (beta)](https://github.com/dokku/dokku-memcached-plugin) | [dokku][] | 0.4.0+ | | [Memcached (beta)](https://github.com/dokku/dokku-memcached-plugin) | [dokku][] | 0.4.0+ |
| [Mongo (beta)](https://github.com/dokku/dokku-mongo-plugin) | [dokku][] | 0.4.0+ | | [Mongo (beta)](https://github.com/dokku/dokku-mongo-plugin) | [dokku][] | 0.4.0+ |
| [MySQL (beta)](https://github.com/dokku/dokku-mysql-plugin) | [dokku][] | 0.4.0+ | | [MySQL (beta)](https://github.com/dokku/dokku-mysql-plugin) | [dokku][] | 0.4.0+ |
| [Nats (beta)](https://github.com/dokku/dokku-nats) | [dokku][] | 0.4.0+ |
| [Postgres (beta)](https://github.com/dokku/dokku-postgres-plugin) | [dokku][] | 0.4.0+ | | [Postgres (beta)](https://github.com/dokku/dokku-postgres-plugin) | [dokku][] | 0.4.0+ |
| [RabbitMQ (beta)](https://github.com/dokku/dokku-rabbitmq-plugin) | [dokku][] | 0.4.0+ | | [RabbitMQ (beta)](https://github.com/dokku/dokku-rabbitmq-plugin) | [dokku][] | 0.4.0+ |
| [Redis (beta)](https://github.com/dokku/dokku-redis-plugin) | [dokku][] | 0.4.0+ | | [Redis (beta)](https://github.com/dokku/dokku-redis-plugin) | [dokku][] | 0.4.0+ |
| [RethinkDB (beta)](https://github.com/dokku/dokku-rethinkdb-plugin) | [dokku][] | 0.4.0+ | | [RethinkDB (beta)](https://github.com/dokku/dokku-rethinkdb-plugin) | [dokku][] | 0.4.0+ |
| [Copy Files to Image](https://github.com/dokku/dokku-copyfiles-to-image) | [dokku][] | 0.4.0+ | | [Copy Files to Image](https://github.com/dokku/dokku-copyfiles-to-image) | [dokku][] | 0.4.0+ |
| [HTTP Auth (beta)](https://github.com/dokku/dokku-http-auth) | [dokku][] | 0.4.0+ | | [HTTP Auth (beta)](https://github.com/dokku/dokku-http-auth) | [dokku][] | 0.4.0+ |
| [Let's Encrypt (beta)](https://github.com/dokku/dokku-letsencrypt) | [dokku][] | 0.4.0+ |
| [Maintenance mode (beta)](https://github.com/dokku/dokku-maintenance) | [dokku][] | 0.4.0+ | | [Maintenance mode (beta)](https://github.com/dokku/dokku-maintenance) | [dokku][] | 0.4.0+ |
| [Redirect (beta)](https://github.com/dokku/dokku-redirect) | [dokku][] | 0.4.0+ | | [Redirect (beta)](https://github.com/dokku/dokku-redirect) | [dokku][] | 0.4.0+ |
@@ -53,39 +55,48 @@ The following plugins are available and provided by dokku maintainers. Where not
Note: The following plugins have been supplied by our community and may not have been tested by dokku maintainers. Note: The following plugins have been supplied by our community and may not have been tested by dokku maintainers.
[agco-adm]: https://github.com/agco-adm [256dpi]: https://github.com/256dpi
[abossard]: https://github.com/dudagroup
[ademuk]: https://github.com/ademuk [ademuk]: https://github.com/ademuk
[agco-adm]: https://github.com/agco-adm
[alessio]: https://github.com/alessio [alessio]: https://github.com/alessio
[alex-sherwin]: https://github.com/alex-sherwin [alex-sherwin]: https://github.com/alex-sherwin
[alexanderbeletsky]: https://github.com/alexanderbeletsky [alexanderbeletsky]: https://github.com/alexanderbeletsky
[alexkruegger]: https://github.com/alexkruegger
[Aomitayo]: https://github.com/Aomitayo [Aomitayo]: https://github.com/Aomitayo
[apmorton]: https://github.com/apmorton [apmorton]: https://github.com/apmorton
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
[blag]: https://github.com/blag [blag]: https://github.com/blag
[cameron-martin]: https://github.com/cameron-martin [cameron-martin]: https://github.com/cameron-martin
[cedricziel]: https://github.com/cedricziel [cedricziel]: https://github.com/cedricziel
[cef]: https://github.com/cef [cef]: https://github.com/cef
[cjblomqvist]: https://github.com/cjblomqvist [cjblomqvist]: https://github.com/cjblomqvist
[darkpixel]: https://github.com/darkpixel [darkpixel]: https://github.com/darkpixel
[dokku]: https://github.com/dokku
[dyson]: https://github.com/dyson [dyson]: https://github.com/dyson
[F4-Group]: https://github.com/F4-Group [F4-Group]: https://github.com/F4-Group
[fermuch]: https://github.com/fermuch [fermuch]: https://github.com/fermuch
[fgrehm]: https://github.com/fgrehm [fgrehm]: https://github.com/fgrehm
[Flink]: https://github.com/Flink
[gdi2290]: https://github.com/gdi2290 [gdi2290]: https://github.com/gdi2290
[heichblatt]: https://github.com/heichblatt [heichblatt]: https://github.com/heichblatt
[hughfletcher]: https://github.com/hughfletcher [hughfletcher]: https://github.com/hughfletcher
[ignlg]: https://github.com/ignlg [ignlg]: https://github.com/ignlg
[iskandar]: https://github.com/iskandar [iskandar]: https://github.com/iskandar
[jagandecapri]: https://github.com/jagandecapri
[jeffutter]: https://github.com/jeffutter [jeffutter]: https://github.com/jeffutter
[jlachowski]: https://github.com/jlachowski [jlachowski]: https://github.com/jlachowski
[krisrang]: https://github.com/krisrang
[Kloadut]: https://github.com/Kloadut [Kloadut]: https://github.com/Kloadut
[krisrang]: https://github.com/krisrang
[luxifer]: https://github.com/luxifer [luxifer]: https://github.com/luxifer
[mlebkowski]: https://github.com/mlebkowski [Maciej Łebkowski]: https://github.com/mlebkowski
[matto1990]: https://github.com/matto1990 [matto1990]: https://github.com/matto1990
[mbriskar]: https://github.com/mbriskar [mbriskar]: https://github.com/mbriskar
[michaelshobbs]: https://github.com/michaelshobbs [michaelshobbs]: https://github.com/michaelshobbs
[mikecsh]: https://github.com/mikecsh [mikecsh]: https://github.com/mikecsh
[mikexstudios]: https://github.com/mikexstudios [mikexstudios]: https://github.com/mikexstudios
[mixxorz]: https://github.com/mixxorz
[mlebkowski]: https://github.com/mlebkowski
[motin]: https://github.com/motin [motin]: https://github.com/motin
[musicglue]: https://github.com/musicglue [musicglue]: https://github.com/musicglue
[neam]: https://github.com/neam [neam]: https://github.com/neam
@@ -95,25 +106,19 @@ Note: The following plugins have been supplied by our community and may not have
[pauldub]: https://github.com/pauldub [pauldub]: https://github.com/pauldub
[pnegahdar]: https://github.com/pnegahdar [pnegahdar]: https://github.com/pnegahdar
[RaceHub]: https://github.com/racehub [RaceHub]: https://github.com/racehub
[ribot]: https://github.com/ribot
[rlaneve]: https://github.com/rlaneve [rlaneve]: https://github.com/rlaneve
[robv]: https://github.com/robv [robv]: https://github.com/robv
[scottatron]: https://github.com/scottatron [scottatron]: https://github.com/scottatron
[sehrope]: https://github.com/sehrope [sehrope]: https://github.com/sehrope
[sekjun9878]: https://github.com/sekjun9878
[sgulseth]: https://github.com/sgulseth
[sseemayer]: https://github.com/sseemayer
[statianzo]: https://github.com/statianzo [statianzo]: https://github.com/statianzo
[stuartpb]: https://github.com/stuartpb [stuartpb]: https://github.com/stuartpb
[thrashr888]: https://github.com/thrashr888 [thrashr888]: https://github.com/thrashr888
[wmluke]: https://github.com/wmluke [wmluke]: https://github.com/wmluke
[Zenedith]: https://github.com/Zenedith [Zenedith]: https://github.com/Zenedith
[sekjun9878]: https://github.com/sekjun9878
[Flink]: https://github.com/Flink
[ribot]: https://github.com/ribot
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
[jagandecapri]: https://github.com/jagandecapri
[mixxorz]: https://github.com/mixxorz
[Maciej Łebkowski]: https://github.com/mlebkowski
[abossard]: https://github.com/dudagroup
[alexkruegger]: https://github.com/alexkruegger
[dokku]: https://github.com/dokku
### Datastores ### Datastores
@@ -140,8 +145,8 @@ Note: The following plugins have been supplied by our community and may not have
| Plugin | Author | Compatibility | | Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- | | ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [RabbitMQ](https://github.com/jlachowski/dokku-rabbitmq-plugin) | [jlachowski][] | 0.3.x | | [RabbitMQ](https://github.com/jlachowski/dokku-rabbitmq-plugin) | [jlachowski][] | 0.3.x |
| [RabbitMQ (single container)](https://github.com/jlachowski/dokku-rabbitmq-single-plugin) | [jlachowski][] | 0.3.x | | [RabbitMQ (single container)](https://github.com/jlachowski/dokku-rabbitmq-single-plugin) | [jlachowski][] | 0.3.x |
#### Other #### Other
@@ -163,8 +168,8 @@ Note: The following plugins have been supplied by our community and may not have
| [Shoreman ](https://github.com/statianzo/dokku-shoreman) | [statianzo][] | 0.3.x | | [Shoreman ](https://github.com/statianzo/dokku-shoreman) | [statianzo][] | 0.3.x |
| [Supervisord](https://github.com/statianzo/dokku-supervisord) | [statianzo][] | 0.3.x | | [Supervisord](https://github.com/statianzo/dokku-supervisord) | [statianzo][] | 0.3.x |
[c77cbf1]: https://github.com/progrium/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147 [c77cbf1]: https://github.com/dokku/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
[28de3ec]: https://github.com/progrium/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40 [28de3ec]: https://github.com/dokku/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
### Dokku Features ### Dokku Features
@@ -172,12 +177,13 @@ Note: The following plugins have been supplied by our community and may not have
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- | | ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [App name as env](https://github.com/cjblomqvist/dokku-app-name-env) | [cjblomqvist][] | 0.3.x | | [App name as env](https://github.com/cjblomqvist/dokku-app-name-env) | [cjblomqvist][] | 0.3.x |
| [Docker Direct](https://github.com/heichblatt/dokku-docker-direct) | [heichblatt][] | | | [Docker Direct](https://github.com/heichblatt/dokku-docker-direct) | [heichblatt][] | |
| [Dokku Copy App Config Files](https://github.com/alexkruegger/dokku-app-configfiles) | [alexkruegger][] | Compatible with 0.3.17+ | | [Dokku Copy App Config Files](https://github.com/alexkruegger/dokku-app-configfiles) | [alexkruegger][] | Compatible with 0.3.17+ |
| [Dokku Copy App Config Files](https://github.com/heichblatt/dokku-supply-config) | [heichblatt][] | | | [Dokku Copy App Config Files](https://github.com/heichblatt/dokku-supply-config) | [heichblatt][] | |
| [Dokku Name](https://github.com/alex-sherwin/dokku-name) | [alex-sherwin][] | dokku >= [c77cbf1][] | | [Dokku Name](https://github.com/alex-sherwin/dokku-name) | [alex-sherwin][] | dokku >= [c77cbf1][] |
| [Dokku Registry](https://github.com/agco-adm/dokku-registry)<sup>1</sup> | [agco-adm][] | 0.4.0+ | | [Dokku Registry](https://github.com/agco-adm/dokku-registry)<sup>1</sup> | [agco-adm][] | 0.4.0+ |
| [git rev-parse HEAD in env](https://github.com/cjblomqvist/dokku-git-rev) | [cjblomqvist][] | 0.4.0+ | | [git rev-parse HEAD in env](https://github.com/cjblomqvist/dokku-git-rev) | [cjblomqvist][] | 0.4.0+ |
| [Graduate (Environment Management)](https://github.com/glassechidna/dokku-graduate) | [Benjamin-Dobell][] | 0.3.14+ | | [Graduate (Environment Management)](https://github.com/glassechidna/dokku-graduate) | [Benjamin-Dobell][] | 0.3.14+ |
| [Haproxy tcp load balancer](https://github.com/256dpi/dokku-haproxy) | [256dpi][] | 0.4.0+ |
| [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | 0.4.0+ | | [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | 0.4.0+ |
| [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | 0.4.0+ | | [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | 0.4.0+ |
| [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | | | [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | |
@@ -188,7 +194,7 @@ Note: The following plugins have been supplied by our community and may not have
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 0.3.x | | [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 0.3.x |
| [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | 0.3.x | | [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | 0.3.x |
[217d00a]: https://github.com/progrium/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7 [217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
<sup>1</sup> On Heroku similar functionality is offered by the [heroku-labs pipeline feature](https://devcenter.heroku.com/articles/labs-pipelines), which allows you to promote builds across multiple environments (staging -> production) <sup>1</sup> On Heroku similar functionality is offered by the [heroku-labs pipeline feature](https://devcenter.heroku.com/articles/labs-pipelines), which allows you to promote builds across multiple environments (staging -> production)
@@ -210,7 +216,8 @@ Note: The following plugins have been supplied by our community and may not have
| [Builders: bower, compass, gulp, grunt](https://github.com/ignlg/dokku-builders-plugin) | [ignlg][] | 0.4.0+ | | [Builders: bower, compass, gulp, grunt](https://github.com/ignlg/dokku-builders-plugin) | [ignlg][] | 0.4.0+ |
| [Docker auto persist volumes](https://github.com/Flink/dokku-docker-auto-volumes) | [Flink][] | 0.4.0+ | | [Docker auto persist volumes](https://github.com/Flink/dokku-docker-auto-volumes) | [Flink][] | 0.4.0+ |
| [HipChat Notifications](https://github.com/cef/dokku-hipchat) | [cef][] | | | [HipChat Notifications](https://github.com/cef/dokku-hipchat) | [cef][] | |
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-plugin) | [jlachowski][] | | | [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-plugin) | [jlachowski] | <0.4.0 |
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-grafana) | [jlachowski] | 0.4.0+, graphite & statsd plugin with grafana dashboard frontend |
| [Logspout](https://github.com/michaelshobbs/dokku-logspout) | [michaelshobbs][] | 0.3.26+ | | [Logspout](https://github.com/michaelshobbs/dokku-logspout) | [michaelshobbs][] | 0.3.26+ |
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | | | [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | |
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | | | [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | |
@@ -218,7 +225,7 @@ Note: The following plugins have been supplied by our community and may not have
| [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ | | [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ |
| [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Łebkowski][] | 0.4.0+ | | [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Łebkowski][] | 0.4.0+ |
| [Webhooks](https://github.com/nickstenning/dokku-webhooks) | [nickstenning][] | | | [Webhooks](https://github.com/nickstenning/dokku-webhooks) | [nickstenning][] | |
| [Wkhtmltopdf](https://github.com/mbriskar/dokku-wkhtmltopdf) | [mbriskar][] | | | [Wkhtmltopdf](https://github.com/mbriskar/dokku-wkhtmltopdf) | [mbriskar][] | |
| [Wordpress](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | Dokku dev, mariadb, volume, domains | | [Wordpress](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | Dokku dev, mariadb, volume, domains |
<sup>1</sup> Forked from [jezdez/dokku-elasticsearch-plugin](https://github.com/jezdez/dokku-elasticsearch-plugin): uses Elasticsearch 1.2 (instead of 0.90), doesn't depend on dokku-link, runs as elasticsearch user instead of root, and turns off multicast autodiscovery for use in a VPS environment. <sup>1</sup> Forked from [jezdez/dokku-elasticsearch-plugin](https://github.com/jezdez/dokku-elasticsearch-plugin): uses Elasticsearch 1.2 (instead of 0.90), doesn't depend on dokku-link, runs as elasticsearch user instead of root, and turns off multicast autodiscovery for use in a VPS environment.
@@ -230,18 +237,18 @@ The following plugins have been removed as their functionality is now in Dokku C
| Plugin | Author | In Dokku Since | | Plugin | Author | In Dokku Since |
| ------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------- | | ------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------- |
| [Custom Domains](https://github.com/neam/dokku-custom-domains) | [motin][] | v0.3.10 (domains plugin) | | [Custom Domains](https://github.com/neam/dokku-custom-domains) | [motin][] | v0.3.10 (domains plugin) |
| [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | v0.3.9 (trace command) | | [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | v0.3.9 (trace command) |
| [Docker Options](https://github.com/dyson/dokku-docker-options) | [dyson][] | v0.3.17 (docker-options plugin) | | [Docker Options](https://github.com/dyson/dokku-docker-options) | [dyson][] | v0.3.17 (docker-options plugin) |
| [Events Logger](https://github.com/alessio/dokku-events) | [alessio][] | v0.3.21 (events plugin) | | [Events Logger](https://github.com/alessio/dokku-events) | [alessio][] | v0.3.21 (events plugin) |
| [Host Port binding](https://github.com/stuartpb/dokku-bind-port) | [stuartpb][] | v0.3.17 (docker-options plugin) | | [Host Port binding](https://github.com/stuartpb/dokku-bind-port) | [stuartpb][] | v0.3.17 (docker-options plugin) |
| [List Containers](https://github.com/heichblatt/dokku-list) | [heichblatt][] | v0.3.14 (ps plugin | | [List Containers](https://github.com/heichblatt/dokku-list) | [heichblatt][] | v0.3.14 (ps plugin |
| [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | v0.3.17 (docker-options plugin) | | [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | v0.3.17 (docker-options plugin) |
| [Multiple Domains](https://github.com/wmluke/dokku-domains-plugin)<sup>1</sup> | [wmluke][] | v0.3.10 (domains plugin) | | [Multiple Domains](https://github.com/wmluke/dokku-domains-plugin)<sup>1</sup> | [wmluke][] | v0.3.10 (domains plugin) |
| [Named-containers](https://github.com/Flink/dokku-named-containers) | [Flink][] | v0.4.2 (named-containers plugin) | | [Named-containers](https://github.com/Flink/dokku-named-containers) | [Flink][] | v0.4.2 (named-containers plugin) |
| [Nginx-Alt](https://github.com/mikexstudios/dokku-nginx-alt) | [mikexstudios][] | v0.3.10 (domains plugin) | | [Nginx-Alt](https://github.com/mikexstudios/dokku-nginx-alt) | [mikexstudios][] | v0.3.10 (domains plugin) |
| [Persistent Storage](https://github.com/dyson/dokku-persistent-storage) | [dyson][] | v0.3.17 (docker-options plugin) | | [Persistent Storage](https://github.com/dyson/dokku-persistent-storage) | [dyson][] | v0.3.17 (docker-options plugin) |
| [PrimeCache](https://github.com/darkpixel/dokku-prime-cache) | [darkpixel][] | v0.3.0 (zero downtime deploys) | | [PrimeCache](https://github.com/darkpixel/dokku-prime-cache) | [darkpixel][] | v0.3.0 (zero downtime deploys) |
| [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | v0.3.14 (ps plugin) | | [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | v0.3.14 (ps plugin) |
| [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env)<sup>2</sup> | [cameron-martin][] | v0.3.9 (build-env plugin) | | [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env)<sup>2</sup> | [cameron-martin][] | v0.3.9 (build-env plugin) |
| [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)<sup>2</sup> | [musicglue][] | v0.3.9 (build-env plugin) | | [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)<sup>2</sup> | [musicglue][] | v0.3.9 (build-env plugin) |
| [user-env-compile](https://github.com/motin/dokku-user-env-compile)<sup>2</sup> | [motin][] | v0.3.9 (build-env plugin) | | [user-env-compile](https://github.com/motin/dokku-user-env-compile)<sup>2</sup> | [motin][] | v0.3.9 (build-env plugin) |
@@ -260,11 +267,11 @@ The following plugins are no longer maintained by their developers.
| Plugin | Author | Compatibility | | Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- | | ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh][] | Works with 0.2.0 | | [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh][] | Works with 0.2.0 |
| [CouchDB (multi containers)](https://github.com/Flink/dokku-couchdb-multi-containers) | [Flink][] | 0.4.0+ | | [CouchDB (multi containers)](https://github.com/Flink/dokku-couchdb-multi-containers) | [Flink][] | 0.4.0+ |
| [CouchDB](https://github.com/racehub/dokku-couchdb-plugin) | [RaceHub][] | Compatible with 0.2.0 | | [CouchDB](https://github.com/racehub/dokku-couchdb-plugin) | [RaceHub][] | Compatible with 0.2.0 |
| [Elasticsearch](https://github.com/robv/dokku-elasticsearch) | [robv][] | Not compatible with >= 0.3.0 (still uses /home/git) | | [Elasticsearch](https://github.com/robv/dokku-elasticsearch) | [robv][] | Not compatible with >= 0.3.0 (still uses /home/git) |
| [Elasticsearch](https://github.com/blag/dokku-elasticsearch-plugin)<sup>1</sup> | [blag][] | Compatible with 0.2.0 | | [Elasticsearch](https://github.com/blag/dokku-elasticsearch-plugin)<sup>1</sup> | [blag][] | Compatible with 0.2.0 |
| [Memcached](https://github.com/Flink/dokku-memcached-plugin) | [Flink][] | 0.4.0+ | | [Memcached](https://github.com/Flink/dokku-memcached-plugin) | [Flink][] | 0.4.0+ |
| [MongoDB (single container)](https://github.com/jeffutter/dokku-mongodb-plugin) | [jeffutter][] | | | [MongoDB (single container)](https://github.com/jeffutter/dokku-mongodb-plugin) | [jeffutter][] | |
| [MySQL](https://github.com/hughfletcher/dokku-mysql-plugin) | [hughfletcher][] | | | [MySQL](https://github.com/hughfletcher/dokku-mysql-plugin) | [hughfletcher][] | |
| [Neo4j](https://github.com/Aomitayo/dokku-neo4j-plugin) | [Aomitayo][] | | | [Neo4j](https://github.com/Aomitayo/dokku-neo4j-plugin) | [Aomitayo][] | |

View File

@@ -10,30 +10,30 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400:sans-serif|Open+Sans:400:sans-serif" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400:sans-serif|Open+Sans:400:sans-serif" 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/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/apple-touch-icon-180x180.png"> <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/manifest.json"> <link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/favicon.ico"> <link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/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/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-144x144.png"> <meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/browserconfig.xml"> <meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.12/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/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/style.css" rel="stylesheet"> <link href="https://cdn.rawgit.com/dokku/dokku/v0.4.12/docs/assets/style.css" rel="stylesheet">
<style> <style>
</style> </style>
</head> </head>
@@ -43,7 +43,7 @@
<div class="row"> <div class="row">
<div class="col-md-offset-2"> <div class="col-md-offset-2">
<h1 class="heading navbar-brand"> <h1 class="heading navbar-brand">
<a href="http://progrium.viewdocs.io/dokku/">Dokku</a> <a href="http://dokku.viewdocs.io/dokku/">Dokku</a>
</h1> </h1>
</div> </div>
</div> </div>

View File

@@ -87,7 +87,7 @@ __Solution (Less solution, more helpful troubleshooting steps):__
root@dokku:~# resolvconf -u root@dokku:~# resolvconf -u
``` ```
Please see https://github.com/progrium/dokku/issues/841 and https://github.com/progrium/dokku/issues/649 Please see https://github.com/dokku/dokku/issues/841 and https://github.com/dokku/dokku/issues/649
*** ***
@@ -105,7 +105,7 @@ You have to point ssh to the correct secret key for your domain name. Add the fo
Host DOKKU_HOSTNAME Host DOKKU_HOSTNAME
IdentityFile "~/.ssh/KEYNAME" IdentityFile "~/.ssh/KEYNAME"
Also see [issue #116](https://github.com/progrium/dokku/issues/116) Also see [issue #116](https://github.com/dokku/dokku/issues/116)
*** ***
@@ -119,7 +119,7 @@ When specifying your port you may want to use something similar to:
var port = process.env.PORT || 3000 var port = process.env.PORT || 3000
Please see https://github.com/progrium/dokku/issues/282 Please see https://github.com/dokku/dokku/issues/282
*** ***
@@ -146,5 +146,5 @@ dokku config:set --global CURL_CONNECT_TIMEOUT=30
``` ```
References References
* https://github.com/progrium/dokku/issues/509 * https://github.com/dokku/dokku/issues/509
* https://github.com/dokku-alt/dokku-alt/issues/169 * https://github.com/dokku-alt/dokku-alt/issues/169

View File

@@ -1,6 +1,6 @@
# Upgrading # Upgrading
This document covers upgrades for the 0.3.0 series and up. If upgrading from older versions, we recommend [a fresh install](http://progrium.viewdocs.io/dokku/installation) on a new server. This document covers upgrades for the 0.3.0 series and up. If upgrading from older versions, we recommend [a fresh install](http://dokku.viewdocs.io/dokku/installation) on a new server.
> As of 0.3.18, dokku is installed by default via a debian package. Source-based installations are still available, though not recommended. > As of 0.3.18, dokku is installed by default via a debian package. Source-based installations are still available, though not recommended.

30
dokku
View File

@@ -29,6 +29,9 @@ export DOKKU_VALID_EXIT=0
export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"} export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"}
export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="$DOKKU_LOGS_DIR/events.log"} export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="$DOKKU_LOGS_DIR/events.log"}
export DOKKU_CONTAINER_LABEL=dokku
export DOKKU_GLOBAL_RUN_ARGS="--label=$DOKKU_CONTAINER_LABEL"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc [[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
@@ -49,12 +52,16 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
fi fi
! has_tty && DOKKU_QUIET_OUTPUT=1 ! has_tty && DOKKU_QUIET_OUTPUT=1
if [[ $(id -un) != "dokku" && $1 != plugin:*install* && $1 != "plugin:update" ]]; then if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]]; then
export SSH_USER=$(id -un) export SSH_USER=$(id -un)
sudo -u dokku -E -H $0 "$@" sudo -u dokku -E -H $0 "$@"
exit $? exit $?
fi fi
if [[ $(id -un) != "root" && $1 =~ plugin:.* ]]; then
dokku_log_fail "plugin:* commands must be run as root"
fi
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
export -n SSH_ORIGINAL_COMMAND export -n SSH_ORIGINAL_COMMAND
if [[ $1 =~ config-* ]] || [[ $1 =~ docker-options* ]]; then if [[ $1 =~ config-* ]] || [[ $1 =~ docker-options* ]]; then
@@ -76,8 +83,12 @@ fi
case "$1" in case "$1" in
receive) receive)
APP="$2"; IMAGE=$(get_app_image_name $APP); IMAGE_SOURCE_TYPE="$3"; TMP_WORK_DIR="$4" APP="$2"; IMAGE=$(get_app_image_name $APP); IMAGE_SOURCE_TYPE="$3"; TMP_WORK_DIR="$4"
dokku_log_info1 "Cleaning up..." if [[ -z "$DOKKU_SKIP_CLEANUP" ]]; then
docker_cleanup dokku_log_info1 "Cleaning up..."
docker_cleanup
else
dokku_log_info1 "DOKKU_SKIP_CLEANUP set. Skipping dokku cleanup"
fi
dokku_log_info1 "Building $APP from $IMAGE_SOURCE_TYPE..." dokku_log_info1 "Building $APP from $IMAGE_SOURCE_TYPE..."
dokku build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR" dokku build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"
release_and_deploy "$APP" release_and_deploy "$APP"
@@ -104,6 +115,7 @@ case "$1" in
DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG) DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG)
while read -r line || [[ -n "$line" ]]; do while read -r line || [[ -n "$line" ]]; do
[[ "$line" =~ ^#.* ]] && continue
TRIM=${line%#*} TRIM=${line%#*}
PROC_TYPE=${TRIM%%=*} PROC_TYPE=${TRIM%%=*}
PROC_COUNT=${TRIM#*=} PROC_COUNT=${TRIM#*=}
@@ -131,15 +143,19 @@ case "$1" in
if [[ "$PROC_TYPE" == "web" ]]; then if [[ "$PROC_TYPE" == "web" ]]; then
port=${DOKKU_DOCKERFILE_PORT:=5000} port=${DOKKU_DOCKERFILE_PORT:=5000}
if [[ "$BIND_EXTERNAL" = "true" ]]; then if [[ "$BIND_EXTERNAL" = "true" ]]; then
id=$(docker run -d -p $port -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD) id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -p $port -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
port=$(docker port $id $port | sed 's/[0-9.]*://') port=$(docker port $id $port | sed 's/[0-9.]*://')
ipaddr=127.0.0.1 ipaddr=127.0.0.1
else else
id=$(docker run -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD) id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id) ipaddr=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $id)
# Docker < 1.9 compatibility
if [[ -z $ipaddr ]]; then
ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id)
fi
fi fi
else else
id=$(docker run -d $DOCKER_ARGS $IMAGE $START_CMD) id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOCKER_ARGS $IMAGE $START_CMD)
fi fi
# if we can't post-deploy successfully, kill new container # if we can't post-deploy successfully, kill new container

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " build release trace delete ls run url urls version help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT [[ " build release trace delete ls run url urls report version help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
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"
@@ -17,7 +17,7 @@ case "$1" in
case "$IMAGE_SOURCE_TYPE" in case "$IMAGE_SOURCE_TYPE" in
herokuish) herokuish)
id=$(tar -c . | docker run -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app") id=$(tar -c . | docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app")
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR [[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
@@ -25,7 +25,7 @@ case "$1" in
DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP $IMAGE_SOURCE_TYPE) DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP $IMAGE_SOURCE_TYPE)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true " [[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build) id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build)
docker attach $id docker attach $id
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
@@ -60,12 +60,12 @@ case "$1" in
herokuish) herokuish)
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG" plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then if [[ -n $(config_export global) ]]; then
id=$(config_export global | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh") id=$(config_export global | docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
fi fi
if [[ -n $(config_export app $APP) ]]; then if [[ -n $(config_export app $APP) ]]; then
id=$(config_export app $APP | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh") id=$(config_export app $APP | docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
fi fi
@@ -144,7 +144,7 @@ case "$1" in
has_tty && DOKKU_RUN_OPTS+=" -i -t" has_tty && DOKKU_RUN_OPTS+=" -i -t"
is_image_herokuish_based "$IMAGE" && EXEC_CMD="/exec" is_image_herokuish_based "$IMAGE" && EXEC_CMD="/exec"
docker run $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE $EXEC_CMD "$@" docker run $DOKKU_GLOBAL_RUN_ARGS $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE $EXEC_CMD "$@"
;; ;;
url | urls) url | urls)
@@ -191,6 +191,21 @@ case "$1" in
fi fi
;; ;;
report)
dokku_log_info1 "uname: $(uname -a)"
dokku_log_info1 "memory: "
free -m
dokku_log_info1 "docker version: "
docker version
dokku_log_info1 "docker daemon info: "
docker -D info
dokku_log_info1 "herokuish version: "
docker run --rm -ti gliderlabs/herokuish:latest herokuish version
dokku_log_info1 "dokku version: $(dokku version)"
dokku_log_info1 "dokku plugins: "
dokku plugin
;;
version) version)
cat "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version" cat "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version"
;; ;;

View File

@@ -9,24 +9,23 @@ 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
# temporary hack for https://github.com/progrium/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
case "$DOKKU_DISTRO" in if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then
ubuntu) 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
script script
sleep 2 # give docker some time sleep 2 # give docker some time
sudo -i -u dokku /usr/local/bin/dokku ps:restartall sudo -i -u dokku /usr/local/bin/dokku ps:restore
end script end script
EOF EOF
;; fi
debian|opensuse) 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
After=docker.target After=docker.target
@@ -34,13 +33,15 @@ After=docker.target
[Service] [Service]
Type=simple Type=simple
User=dokku User=dokku
ExecStart=/usr/local/bin/dokku ps:restartall ExecStart=/usr/local/bin/dokku ps:restore
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
;; if command -v systemctl &>/dev/null; then
esac systemctl enable dokku-redeploy
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

View File

@@ -26,7 +26,7 @@ case "$1" in
;; ;;
events:list) events:list)
PLUGIN_DIR="$(dirname $0)" PLUGIN_DIR="$(dirname $0)/"
if [[ "$DOKKU_EVENTS" ]]; then if [[ "$DOKKU_EVENTS" ]]; then
logged="$(find $PLUGIN_DIR -type l -printf '%f ' | sort)" logged="$(find $PLUGIN_DIR -type l -printf '%f ' | sort)"
dokku_col_log_info2_quiet "Events currently logged" dokku_col_log_info2_quiet "Events currently logged"
@@ -39,7 +39,7 @@ case "$1" in
;; ;;
help | events:help) help | events:help)
cat && cat<<EOF cat<<EOF
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

View File

@@ -56,6 +56,11 @@ $DOKKU_LOGS_DIR/*.log {
create 664 syslog dokku create 664 syslog dokku
} }
EOF EOF
if [[ "$DOKKU_DISTRO" = "debian" ]]; then
sed -i '/\s*su syslog dokku/d; s/\(create [0-7][0-7][0-7]\) syslog dokku/\1 root dokku/g' $DOKKU_LOGROTATE_FILE
fi
flag_rsyslog_needs_restart=y flag_rsyslog_needs_restart=y
fi fi

View File

@@ -1,21 +1,38 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " apps apps:create apps:destroy help apps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT [[ " apps apps:create apps:rename apps:destroy help apps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
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"
case "$1" in case "$1" in
apps) apps)
dokku_log_info2_quiet "My Apps" dokku_log_info2_quiet "My Apps"
find $DOKKU_ROOT -follow -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort for app in $(dokku_apps); do
echo "$app"
done
;; ;;
apps:create) apps:create)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" apps_create $2
[[ -d "$DOKKU_ROOT/$2" ]] && dokku_log_fail "Name is already taken" ;;
APP="$2"
mkdir -p "$DOKKU_ROOT/$APP" apps:rename)
echo "Creating $APP... done" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -d "$DOKKU_ROOT/$3" ]] && dokku_log_fail "Name is already taken"
OLD_APP="$2"
NEW_APP="$3"
mkdir -p "$DOKKU_ROOT/$NEW_APP"
docker run $DOKKU_GLOBAL_RUN_ARGS --rm -v "$DOKKU_ROOT/$OLD_APP/cache:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
rm -rf "$DOKKU_ROOT/$OLD_APP/cache"
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
dokku apps:destroy $OLD_APP --force
sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST"
sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
dokku ps:rebuild $NEW_APP
plugn trigger post-app-rename $OLD_APP $NEW_APP
echo "Renaming $OLD_APP to $NEW_APP... done"
;; ;;
apps:destroy) apps:destroy)
@@ -56,6 +73,7 @@ case "$1" in
apps, List your apps apps, List your apps
apps:create <app>, Create a new app apps:create <app>, Create a new app
apps:destroy <app>, Permanently destroy an app apps:destroy <app>, Permanently destroy an app
apps:rename <old-app> <new-app>, Rename an app
EOF EOF
;; ;;

14
plugins/apps/functions Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
apps_create() {
[[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on"
[[ ! "$1" =~ ^[a-z].* && ! "$1" =~ ^[0-9].* ]] && dokku_log_fail "App name must begin with lowercase alphanumeric character"
[[ -d "$DOKKU_ROOT/$1" ]] && dokku_log_fail "Name is already taken"
local APP="$1"
mkdir -p "$DOKKU_ROOT/$APP"
echo "Creating $APP... done"
plugn trigger post-create $APP
}

View File

@@ -6,5 +6,5 @@ APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG); CACHE_DIR
verify_app_name "$APP" verify_app_name "$APP"
if [[ -d $CACHE_DIR ]]; then if [[ -d $CACHE_DIR ]]; then
docker run --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true docker run $DOKKU_GLOBAL_RUN_ARGS --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
fi fi

View File

@@ -24,12 +24,12 @@ if [[ ! -z "$BUILD_ENV" ]]; then
dokku_log_info1 "Adding BUILD_ENV to build environment..." dokku_log_info1 "Adding BUILD_ENV to build environment..."
# create build env files for use in buildpacks like this: # create build env files for use in buildpacks like this:
# 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=$(echo $BUILD_ENV |sed -e 's@export @@g' -e 's@\\n@ @g' | docker run -i -a stdin $IMAGE /bin/bash -c "for ENV_VAR in $(cat); do echo \$ENV_VAR |sed 's@^\([^=]*\)=\(.*\)\$@echo \\\"\2\\\" >/tmp/env/\1@g' >>/tmp/set_env.sh; done && mkdir -p /tmp/env && /bin/bash /tmp/set_env.sh") id=$(echo $BUILD_ENV |sed -e 's@export @@g' -e 's@\\n@ @g' | docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "for ENV_VAR in $(cat); do echo \$ENV_VAR |sed 's@^\([^=]*\)=\(.*\)\$@echo \\\"\2\\\" >/tmp/env/\1@g' >>/tmp/set_env.sh; done && mkdir -p /tmp/env && /bin/bash /tmp/set_env.sh")
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=$(echo -e "$BUILD_ENV" | docker run -i -a stdin $IMAGE /bin/bash -c "cat >> /app/.env") id=$(echo -e "$BUILD_ENV" | 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
fi fi

View File

@@ -39,7 +39,7 @@ certs_set() {
cd $TEMP_DIR cd $TEMP_DIR
tar xvf - <&0 tar xvf - <&0
CRT_FILE_SEARCH=$(find . -type f -name "*.crt") CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.crt")
CRT_FILE_COUNT=$(printf "%s" "$CRT_FILE_SEARCH" | grep -c '^') CRT_FILE_COUNT=$(printf "%s" "$CRT_FILE_SEARCH" | grep -c '^')
if [[ $CRT_FILE_COUNT -lt 1 ]]; then if [[ $CRT_FILE_COUNT -lt 1 ]]; then
dokku_log_fail "Tar archive is missing .crt file" dokku_log_fail "Tar archive is missing .crt file"
@@ -49,7 +49,7 @@ certs_set() {
CRT_FILE=$CRT_FILE_SEARCH CRT_FILE=$CRT_FILE_SEARCH
fi fi
KEY_FILE_SEARCH=$(find . -type f -name "*.key") KEY_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.key")
KEY_FILE_COUNT=$(printf "%s" "$KEY_FILE_SEARCH" | grep -c '^') KEY_FILE_COUNT=$(printf "%s" "$KEY_FILE_SEARCH" | grep -c '^')
if [[ $KEY_FILE_COUNT -lt 1 ]]; then if [[ $KEY_FILE_COUNT -lt 1 ]]; then
dokku_log_fail "Tar archive is missing .key file" dokku_log_fail "Tar archive is missing .key file"
@@ -95,7 +95,7 @@ case "$1" in
dokku_log_info1 "Installing certificate and key..." dokku_log_info1 "Installing certificate and key..."
mv -f $TMP_WORK_DIR/server.key $TMP_WORK_DIR/server.crt $APP_SSL_PATH mv -f $TMP_WORK_DIR/server.key $TMP_WORK_DIR/server.crt $APP_SSL_PATH
chmod 750 $APP_SSL_PATH chmod 750 $APP_SSL_PATH
chmod 640 $APP_SSL_PATH/server.key $APP_SSL_PATH/server.crt $APP_SSL_PATH/server.csr chmod 640 $APP_SSL_PATH/server.key $APP_SSL_PATH/server.crt
[[ -n "$DOMAIN" ]] && (dokku domains:add $APP $DOMAIN || nginx_build_config $APP) [[ -n "$DOMAIN" ]] && (dokku domains:add $APP $DOMAIN || nginx_build_config $APP)
dokku_log_info1 "The following is a certificate signing request that can be used" dokku_log_info1 "The following is a certificate signing request that can be used"
dokku_log_info1 "to generate an 'officially' signed SSL certificate for $APP at $DOMAIN" dokku_log_info1 "to generate an 'officially' signed SSL certificate for $APP at $DOMAIN"

View File

@@ -85,7 +85,7 @@ if [[ ! -s "${TMPDIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]];
exit 0 exit 0
fi fi
dokku_log_verbose "For more efficient zero downtime deployments, create a file CHECKS." dokku_log_verbose "For more efficient zero downtime deployments, create a file CHECKS."
dokku_log_verbose "See http://progrium.viewdocs.io/dokku/checks-examples.md for examples" dokku_log_verbose "See http://dokku.viewdocs.io/dokku/checks-examples.md for examples"
dokku_log_verbose "CHECKS file not found in container: Running simple container check..." dokku_log_verbose "CHECKS file not found in container: Running simple container check..."
rm -rf $TMPDIR rm -rf $TMPDIR

View File

@@ -10,7 +10,7 @@ has_tty() {
} }
dokku_apps() { dokku_apps() {
local INSTALLED_APPS=$(find $DOKKU_ROOT -maxdepth 1 -mindepth 1 -type d ! -name 'tls' ! -name '.*' -printf "%f\n") || (dokku_log_fail "You haven't deployed any applications yet") local INSTALLED_APPS=$(find $DOKKU_ROOT -follow -maxdepth 1 -mindepth 1 -type d ! -name 'tls' ! -name '.*' -printf "%f\n" | sort) || (dokku_log_fail "You haven't deployed any applications yet")
[[ $INSTALLED_APPS ]] && echo $INSTALLED_APPS [[ $INSTALLED_APPS ]] && echo $INSTALLED_APPS
} }
@@ -121,6 +121,10 @@ dokku_container_log_verbose_quiet() {
verify_app_name() { verify_app_name() {
local APP="$1" local APP="$1"
[[ ! -n "$APP" ]] && dokku_log_fail "(verify_app_name) APP must not be null" [[ ! -n "$APP" ]] && dokku_log_fail "(verify_app_name) APP must not be null"
if [[ ! "$APP" =~ ^[a-z].* && ! "$APP" =~ ^[0-9].* ]]; then
[[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "$DOKKU_ROOT/$APP"
dokku_log_fail "App name must begin with lowercase alphanumeric character"
fi
[[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist" [[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist"
return 0 return 0
@@ -170,7 +174,7 @@ get_running_image_tag() {
is_image_herokuish_based() { is_image_herokuish_based() {
# circleci can't support --rm as they run lxc in lxc # circleci can't support --rm as they run lxc in lxc
[[ ! -f "/home/ubuntu/.circlerc" ]] && local DOCKER_ARGS="--rm" [[ ! -f "/home/ubuntu/.circlerc" ]] && local DOCKER_ARGS="--rm"
docker run --entrypoint="/bin/sh" $DOCKER_ARGS "$@" -c "test -f /exec" docker run $DOKKU_GLOBAL_RUN_ARGS --entrypoint="/bin/sh" $DOCKER_ARGS "$@" -c "test -f /exec"
} }
is_number() { is_number() {
@@ -207,7 +211,7 @@ copy_from_image() {
verify_app_name $APP verify_app_name $APP
if verify_image "$IMAGE"; then if verify_image "$IMAGE"; then
CID=$(docker run -d $IMAGE bash) CID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $IMAGE bash)
docker cp "$CID:$SRC_FILE" "$DST_DIR" docker cp "$CID:$SRC_FILE" "$DST_DIR"
docker rm -f "$CID" &> /dev/null docker rm -f "$CID" &> /dev/null
else else
@@ -316,12 +320,23 @@ release_and_deploy() {
IMAGE_SOURCE_TYPE="dockerfile" IMAGE_SOURCE_TYPE="dockerfile"
fi fi
DOKKU_APP_SKIP_DEPLOY="$(dokku config:get $APP DOKKU_SKIP_DEPLOY || true)"
DOKKU_GLOBAL_SKIP_DEPLOY="$(dokku config:get --global DOKKU_SKIP_DEPLOY || true)"
DOKKU_SKIP_DEPLOY=${DOKKU_APP_SKIP_DEPLOY:="$DOKKU_GLOBAL_SKIP_DEPLOY"}
dokku_log_info1 "Releasing $APP ($IMAGE)..." dokku_log_info1 "Releasing $APP ($IMAGE)..."
dokku release "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG" dokku release "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG"
dokku_log_info1 "Deploying $APP ($IMAGE)..."
dokku deploy "$APP" "$IMAGE_TAG" if [[ "$DOKKU_SKIP_DEPLOY" != "true" ]]; then
dokku_log_info2 "Application deployed:" dokku_log_info1 "Deploying $APP ($IMAGE)..."
dokku urls $APP | sed "s/^/ /" dokku deploy "$APP" "$IMAGE_TAG"
dokku_log_info2 "Application deployed:"
dokku urls $APP | sed "s/^/ /"
else
dokku_log_info1 "Skipping deployment"
fi
echo echo
fi fi
} }
@@ -390,7 +405,7 @@ get_ipv4_regex() {
} }
get_ipv6_regex() { get_ipv6_regex() {
local RE_IPV6="$(_ipv4_regex)" local RE_IPV6="$(_ipv6_regex)"
# Ensure the ip address continues to the end of the line # Ensure the ip address continues to the end of the line
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io # Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
echo "${RE_IPV6}\$" echo "${RE_IPV6}\$"

View File

@@ -1,4 +1,3 @@
#!/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"
@@ -188,6 +187,7 @@ ${var}"
config_styled_hash "$ENV_ADD" " " config_styled_hash "$ENV_ADD" " "
config_write "$ENV_TEMP" config_write "$ENV_TEMP"
plugn trigger post-config-update $APP "set" "$@"
fi fi
if [[ "$DOKKU_CONFIG_RESTART" == "true" ]]; then if [[ "$DOKKU_CONFIG_RESTART" == "true" ]]; then
@@ -219,6 +219,8 @@ config_unset() {
[[ "$var" == "NO_VHOST" ]] && config_set --no-restart $APP NO_VHOST=0 && DOKKU_CONFIG_RESTART=true [[ "$var" == "NO_VHOST" ]] && config_set --no-restart $APP NO_VHOST=0 && DOKKU_CONFIG_RESTART=true
done done
plugn trigger post-config-update $APP "unset" "$@"
if [[ "$DOKKU_CONFIG_RESTART" == "true" ]]; then if [[ "$DOKKU_CONFIG_RESTART" == "true" ]]; then
dokku_log_info1 "Restarting app $APP" dokku_log_info1 "Restarting app $APP"
dokku ps:restart $APP dokku ps:restart $APP

View File

@@ -1,118 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " docker-options docker-options:add docker-options:remove help docker-options:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT [[ " docker-options docker-options:add docker-options:remove help docker-options:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
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_CORE_AVAILABLE_PATH/docker-options/functions"
get_app() { declare APP # global assigned in case
[[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$1"
APP="$1"
}
get_phases() {
local passed_phases_list=$1
local phase
if [[ -n $passed_phases_list ]]; then
IFS=',' read -ra passed_phases <<< "$passed_phases_list"
for phase in "${passed_phases[@]}"; do
verify_phase $phase
done
fi
}
verify_phase() {
local phase
local phases=(build deploy run)
for phase in "${phases[@]}"; do
if [[ "$phase" = "$1" ]]; then
return 0
fi
done
dokku_log_fail "Phase(s) must be one of [${phases[*]}]"
}
get_phase_file_path() {
local phase=$1
local prefix="DOCKER_OPTIONS_"
phase_file_path="${DOKKU_ROOT}/${APP}/${prefix}${phase^^}"
}
create_phase_file_if_required() {
local phase_file_path=$1
[[ -f $phase_file_path ]] || {
touch $phase_file_path
}
}
display_phase_options() {
local phase=$1
local phase_file_path=$2
echo "${phase^} options:"
sed -e 's/^/ /' $phase_file_path
}
display_all_phases_options() {
local phases=(build deploy run)
for phase in "${phases[@]}"; do
get_phase_file_path $phase
if [[ -s $phase_file_path ]]; then
display_phase_options $phase $phase_file_path
fi
done
}
display_passed_phases_options() {
local passed_phases=("${!1}")
local phase
for phase in "${passed_phases[@]}"; do
get_phase_file_path $phase
if [[ ! -s $phase_file_path ]]; then
echo "${phase^} options: none"
else
display_phase_options $phase $phase_file_path
fi
done
}
get_passed_docker_option() {
[[ -z "$@" ]] && dokku_log_fail "Please specify docker options to add to the phase"
passed_docker_option=("$@")
}
add_passed_docker_option() {
local passed_phases=("${!1}")
shift
local passed_option_string="$*"
local phase
for phase in "${passed_phases[@]}"; do
get_phase_file_path $phase
create_phase_file_if_required $phase_file_path
echo "${passed_option_string}" >> $phase_file_path
all_phase_options=$(< $phase_file_path)
echo -e "${all_phase_options}" | sed '/^$/d' | sort -u > $phase_file_path
done
}
remove_passed_docker_option() {
local passed_phases=("${!1}")
shift
local passed_option_string="$*"
local phase
for phase in "${passed_phases[@]}"; do
get_phase_file_path $phase
[[ ! -s $phase_file_path ]] || {
all_phase_options=$(< $phase_file_path)
all_phase_options=$(echo -e "${all_phase_options}" | sed "s#^${passed_option_string}\$##")
echo -e "${all_phase_options}" | sed '/^$/d' | sort -u > $phase_file_path
}
done
}
case "$1" in case "$1" in
# Display applications docker options # Display applications docker options
docker-options) docker-options)
get_app $2 verify_app_name "$2" && APP="$2"
get_phases $3 read -ra passed_phases <<< "$(get_phases "$3")"
if [[ ! "${passed_phases[@]}" ]]; then if [[ ! "${passed_phases[@]}" ]]; then
display_all_phases_options display_all_phases_options
else else
@@ -122,19 +20,20 @@ case "$1" in
# Add a docker option to application # Add a docker option to application
docker-options:add) docker-options:add)
get_app $2 verify_app_name "$2" && APP="$2"
get_phases $3 read -ra passed_phases <<< "$(get_phases "$3")"
shift 3 # everything else passed is the docker option shift 3 # everything else passed is the docker option
get_passed_docker_option "$@" passed_docker_option="$*"
[[ -z "$passed_docker_option" ]] && dokku_log_fail "Please specify docker options to add to the phase"
add_passed_docker_option passed_phases[@] "${passed_docker_option[@]}" add_passed_docker_option passed_phases[@] "${passed_docker_option[@]}"
;; ;;
# Remove a docker option from application # Remove a docker option from application
docker-options:remove) docker-options:remove)
get_app $2 verify_app_name "$2" && APP="$2"
get_phases $3 read -ra passed_phases <<< "$(get_phases "$3")"
shift 3 # everything else passed is the docker option shift 3 # everything else passed is the docker option
get_passed_docker_option "$@" [[ -z ${passed_docker_option="$@"} ]] && dokku_log_fail "Please specify docker options to add to the phase"
remove_passed_docker_option passed_phases[@] "${passed_docker_option[@]}" remove_passed_docker_option passed_phases[@] "${passed_docker_option[@]}"
;; ;;
@@ -149,7 +48,7 @@ EOF
;; ;;
*) *)
exit $DOKKU_NOT_IMPLEMENTED_EXIT exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
;; ;;
esac esac

View File

@@ -0,0 +1,96 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
AVAILABLE_PHASES=(build deploy run)
get_phase_file_path() {
local phase_file_prefix="DOCKER_OPTIONS_"
local phase=$1
[[ "$DOKKU_ROOT" && "$APP" && "$phase_file_prefix" && "$phase" ]] || dokku_log_fail "Error: phase_file_path is incomplete."
echo "${DOKKU_ROOT}/${APP}/${phase_file_prefix}${phase^^}"
}
get_phases() {
local passed_phases_list="$1"
local -r phases_allowed=$(sed -e 's/ /\|/g' <<< "${AVAILABLE_PHASES[@]}")
local phase
local passed_phases
if [[ -n "$passed_phases_list" ]]; then
IFS=',' read -ra passed_phases <<< "$passed_phases_list"
for phase in "${passed_phases[@]}"; do
[[ "$phase" = @($phases_allowed) ]] || dokku_log_fail "Phase(s) must be one of [${AVAILABLE_PHASES[*]}]"
done
echo "${passed_phases[@]}"
fi
}
create_phase_file_if_required() {
local phase_file_path="$1"
[[ -f "$phase_file_path" ]] || {
touch "$phase_file_path"
}
}
display_phase_options() {
local phase="$1"
local phase_file_path="$2"
echo "${phase^} options:"
sed -e 's/^/ /' "$phase_file_path"
}
display_all_phases_options() {
local phases=("${AVAILABLE_PHASES[@]}")
for phase in "${phases[@]}"; do
local phase_file_path
phase_file_path="$(get_phase_file_path "$phase")"
if [[ -s "$phase_file_path" ]]; then
display_phase_options "$phase" "$phase_file_path"
fi
done
}
display_passed_phases_options() {
local passed_phases=("${!1}")
local phase
for phase in "${passed_phases[@]}"; do
local phase_file_path
phase_file_path="$(get_phase_file_path "$phase")"
if [[ ! -s "$phase_file_path" ]]; then
echo "${phase^} options: none"
else
display_phase_options "$phase" "$phase_file_path"
fi
done
}
add_passed_docker_option() {
local passed_phases=("${!1}")
shift
local passed_option_string="$*"
local phase
for phase in "${passed_phases[@]}"; do
local phase_file_path
phase_file_path="$(get_phase_file_path "$phase")"
create_phase_file_if_required "$phase_file_path"
echo "${passed_option_string}" >> "$phase_file_path"
all_phase_options="$(< "$phase_file_path")"
echo -e "${all_phase_options}" | sed '/^$/d' | sort -u > "$phase_file_path"
done
}
remove_passed_docker_option() {
local passed_phases=("${!1}")
shift
local passed_option_string="$*"
local phase
for phase in "${passed_phases[@]}"; do
local phase_file_path
phase_file_path="$(get_phase_file_path "$phase")"
[[ ! -s "$phase_file_path" ]] || {
all_phase_options="$(< "$phase_file_path")"
all_phase_options=$(echo -e "${all_phase_options}" | sed "s#^${passed_option_string}\$##")
echo -e "${all_phase_options}" | sed '/^$/d' | sort -u > "$phase_file_path"
}
done
}

View File

@@ -75,7 +75,7 @@ case "$1" in
for DOMAIN in "$@"; do for DOMAIN in "$@"; do
echo "$DOMAIN" >> "$DOKKU_ROOT/$APP/VHOST" echo "$DOMAIN" >> "$DOKKU_ROOT/$APP/VHOST"
done done
plugn trigger post-domains-update $APP plugn trigger post-domains-update $APP "add" "$@"
for DOMAIN in "$@"; do for DOMAIN in "$@"; do
dokku_log_info1 "Added $DOMAIN to $APP" dokku_log_info1 "Added $DOMAIN to $APP"
done done
@@ -89,7 +89,7 @@ case "$1" in
rm -f "$DOKKU_ROOT/$APP/VHOST" rm -f "$DOKKU_ROOT/$APP/VHOST"
dokku domains:setup $APP dokku domains:setup $APP
plugn trigger post-domains-update $APP plugn trigger post-domains-update $APP "clear"
dokku_log_info1 "Cleared domains in $APP" dokku_log_info1 "Cleared domains in $APP"
;; ;;
@@ -110,7 +110,7 @@ case "$1" in
for DOMAIN in "$@"; do for DOMAIN in "$@"; do
sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST" sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST"
done done
plugn trigger post-domains-update $APP plugn trigger post-domains-update $APP "remove" "$@"
for DOMAIN in "$@"; do for DOMAIN in "$@"; do
dokku_log_info1 "Removed $DOMAIN from $APP" dokku_log_info1 "Removed $DOMAIN from $APP"
done done

View File

@@ -1,6 +1,7 @@
#!/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"
git_build_app_repo() { git_build_app_repo() {
verify_app_name "$1" verify_app_name "$1"
@@ -10,14 +11,24 @@ git_build_app_repo() {
TMP_WORK_DIR=$(mktemp -d) TMP_WORK_DIR=$(mktemp -d)
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN
# git clone
# git clone - this method creates a new git repository and adds the primary
# repo as a remote, then does a fetch depth=1 to avoid cloning
# the entire repo
TMP_TAG="dokku/$REV"
chmod 755 $TMP_WORK_DIR chmod 755 $TMP_WORK_DIR
unset GIT_DIR GIT_WORK_TREE unset GIT_DIR GIT_WORK_TREE
pushd $TMP_WORK_DIR > /dev/null pushd $TMP_WORK_DIR > /dev/null
git clone -q "$DOKKU_ROOT/$APP" "$TMP_WORK_DIR" &> /dev/null [[ ! -d "$DOKKU_ROOT/$APP" ]] && apps_create $APP
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
GIT_DIR="$DOKKU_ROOT/$APP" git tag "$TMP_TAG" "$REV" &> /dev/null
git init &> /dev/null
git config advice.detachedHead false git config advice.detachedHead false
git checkout "$REV" &> /dev/null git remote add origin "$DOKKU_ROOT/$APP" &> /dev/null
git fetch --depth=1 origin "refs/tags/$TMP_TAG" &> /dev/null
git reset --hard FETCH_HEAD &> /dev/null
git submodule update --init --recursive &> /dev/null git submodule update --init --recursive &> /dev/null
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
find -name .git -prune -exec rm -rf {} \; > /dev/null find -name .git -prune -exec rm -rf {} \; > /dev/null
if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then

View File

@@ -1,16 +1,29 @@
#!/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"
APP="$1"; APP_ROOT="$DOKKU_ROOT/$APP" APP="$1"; APP_ROOT="$DOKKU_ROOT/$APP"
[[ -z $(stat -t "$APP_ROOT"/CONTAINER.* 2>/dev/null) ]] && exit 0 [[ -z $(stat -t "$APP_ROOT"/CONTAINER.* 2>/dev/null) ]] && exit 0
for container in "$APP_ROOT"/CONTAINER.*; do for container in "$APP_ROOT"/CONTAINER.*; do
DYNO=$(echo "$container" | sed -r 's/.*CONTAINER\.(.*)/\1/') || true DYNO=$(echo "$container" | sed -r 's/.*CONTAINER\.(.*)/\1/') || true
NAME="$APP.$DYNO" NAME="$APP.$DYNO"
PREVIOUS=$(docker ps -a -q -f name="$NAME\$") || true CURRENT_CONTAINER_ID="$(< $container)"
if [[ -n $PREVIOUS ]]; then PREVIOUS_CIDS=$(docker ps -a -q -f name="^.?$NAME\$" | xargs) || true
docker rename "$NAME" "$NAME.$(date +%s)" > /dev/null if [[ -n $PREVIOUS_CIDS ]]; then
dokku_log_info1_quiet "Found previous container(s) ($PREVIOUS_CIDS) named $NAME"
# in case $PREVIOUS_CIDS has more than one entry
for cid in $PREVIOUS_CIDS; do
PREVIOUS_CONTAINER_STATUS=$(docker inspect -f '{{.State.Status}}' "$cid" || echo "dead")
# dead containers cannot be renamed
if [[ "$PREVIOUS_CONTAINER_STATUS" != "dead" ]]; then
CONTAINER_DATE_NAME="$NAME.$(date +%s)"
dokku_log_info2_quiet "renaming container ($cid) ${NAME} to $CONTAINER_DATE_NAME"
docker rename "$NAME" "$CONTAINER_DATE_NAME" > /dev/null
fi
done
fi fi
ID=$(cat "$container") ID=$(cat "$container")
CURRENT_NAME=$(docker inspect -f '{{.Name}}' "$ID" | tr -d /) CURRENT_NAME=$(docker inspect -f '{{.Name}}' "$ID" | tr -d /)
dokku_log_info2_quiet "renaming container (${ID:0:12}) $CURRENT_NAME to $NAME"
docker rename "$CURRENT_NAME" "$NAME" > /dev/null docker rename "$CURRENT_NAME" "$NAME" > /dev/null
done done

View File

@@ -11,6 +11,12 @@ case "$DOKKU_DISTRO" in
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
[[ -z "$CIRCLECI" ]] && apt-get install -qq -y software-properties-common python-software-properties [[ -z "$CIRCLECI" ]] && apt-get install -qq -y software-properties-common python-software-properties
[[ -n "$CIRCLECI" ]] && aptitude install -q -y software-properties-common python-software-properties [[ -n "$CIRCLECI" ]] && aptitude install -q -y software-properties-common python-software-properties
ubuntu_year=$(lsb_release -d | cut -d ' ' -f 2 | awk '{split($0,a,"."); print a[1]}')
ubuntu_month=$(lsb_release -d | cut -d ' ' -f 2 | awk '{split($0,a,"."); print a[2]}')
[[ "$ubuntu_year" -ge "16" ]] && exit 0
[[ "$ubuntu_year" -eq "15" ]] && [[ "$ubuntu_month" -eq "10" ]] && exit 0
add-apt-repository -y ppa:nginx/stable add-apt-repository -y ppa:nginx/stable
apt-get update -qq > /dev/null apt-get update -qq > /dev/null
apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes -qq -y nginx dnsutils apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes -qq -y nginx dnsutils

View File

@@ -235,8 +235,13 @@ EOF
echo "}" >> $NGINX_CONF echo "}" >> $NGINX_CONF
fi fi
dokku_log_info1 "Creating $SCHEME nginx.conf" if is_deployed "$APP"; then
mv $NGINX_CONF "$DOKKU_ROOT/$APP/nginx.conf" dokku_log_info1 "Creating $SCHEME nginx.conf"
mv $NGINX_CONF "$DOKKU_ROOT/$APP/nginx.conf"
else
dokku_log_info1 "App $APP has not been deployed. Skipping nginx config creation"
rm -f $NGINX_CONF
fi
if is_deployed "$APP"; then if is_deployed "$APP"; then
dokku_log_info1 "Running nginx-pre-reload" dokku_log_info1 "Running nginx-pre-reload"

View File

@@ -16,8 +16,8 @@ case "$1" in
PLUGIN_PATH="$PLUGIN_CORE_PATH" plugn trigger install PLUGIN_PATH="$PLUGIN_CORE_PATH" plugn trigger install
;; ;;
https:*|git:*|ssh:*) https:*|git:*|ssh:*)
PLUGIN_GIT_URL="$2" shift
download_and_enable_plugin "$PLUGIN_GIT_URL" "$3" download_and_enable_plugin "$@"
plugn trigger install plugn trigger install
;; ;;
*) *)
@@ -34,16 +34,12 @@ case "$1" in
;; ;;
plugin:update) plugin:update)
case "$2" in if [[ -n "$2" ]]; then
https:*|git:*) PLUGIN="$2"
PLUGIN_GIT_URL="$2" PLUGIN_COMMITTISH="$3"
download_and_enable_plugin "$PLUGIN_GIT_URL" "$3" plugn update "$PLUGIN" "$PLUGIN_COMMITTISH"
plugn trigger update fi
;; plugn trigger update
*)
plugn trigger update
;;
esac
;; ;;
plugin:disable) plugin:disable)
@@ -67,9 +63,9 @@ case "$1" in
help | plugin:help) help | plugin:help)
cat<<EOF cat<<EOF
plugin, Print active plugins plugin, Print active plugins
plugin:install [--core|git-url], Optionally download git-url & run install trigger for active plugins (or only core ones) plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]], Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones) plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones)
plugin:update [git-url], Optionally download git-url & run update trigger for active plugins plugin:update [name [committish]], Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
plugin:enable <name>, Enable a previously disabled plugin plugin:enable <name>, Enable a previously disabled plugin
plugin:disable <name>, Disable an installed plugin (third-party only) plugin:disable <name>, Disable an installed plugin (third-party only)
plugin:uninstall <name>, Uninstall a plugin (third-party only) plugin:uninstall <name>, Uninstall a plugin (third-party only)

View File

@@ -27,18 +27,44 @@ download_plugin() {
download_and_enable_plugin() { download_and_enable_plugin() {
local PLUGIN_GIT_URL="$1" local PLUGIN_GIT_URL="$1"
local CUSTOM_NAME="$2" shift
while getopts ":-:" opt "$@"; do
case "$opt" in
-)
case "$OPTARG" in
committish)
val="${!OPTIND}"; OPTIND=$(( OPTIND + 1 ))
local PLUGIN_COMMITTISH="$val"
;;
name)
val="${!OPTIND}"; OPTIND=$(( OPTIND + 1 ))
local CUSTOM_NAME="$val"
;;
esac
;;
esac
done
local PLUGIN_NAME=${CUSTOM_NAME:-$(plugin_name "$PLUGIN_GIT_URL")} local PLUGIN_NAME=${CUSTOM_NAME:-$(plugin_name "$PLUGIN_GIT_URL")}
dokku_log_info1_quiet "Cloning plugin repo $PLUGIN_GIT_URL to $PLUGIN_AVAILABLE_PATH/$PLUGIN_NAME" dokku_log_info1_quiet "Cloning plugin repo $PLUGIN_GIT_URL to $PLUGIN_AVAILABLE_PATH/$PLUGIN_NAME"
download_plugin "$PLUGIN_GIT_URL" "$PLUGIN_NAME" download_plugin "$PLUGIN_GIT_URL" "$PLUGIN_NAME"
enable_plugin "$PLUGIN_NAME" enable_plugin "$PLUGIN_NAME"
if [[ -n "$PLUGIN_COMMITTISH" ]];then
update_plugin "$PLUGIN_NAME" "$PLUGIN_COMMITTISH"
fi
}
update_plugin() {
local PLUGIN="$1"
local PLUGIN_COMMITTISH="$2"
[[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed"
plugn update "$@"
} }
uninstall_plugin() { uninstall_plugin() {
local PLUGIN_NAME="$1" local PLUGIN="$1"
[[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot uninstall a core plugin" [[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot uninstall a core plugin"
[[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin does not exist" [[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed"
plugn uninstall $PLUGIN_NAME plugn uninstall $PLUGIN
dokku_log_info1_quiet "Plugin $PLUGIN uninstalled" dokku_log_info1_quiet "Plugin $PLUGIN uninstalled"
} }

View File

@@ -55,11 +55,9 @@ case "$1" in
;; ;;
ps:rebuildall) ps:rebuildall)
shopt -s nullglob
for app in $(dokku_apps); do for app in $(dokku_apps); do
is_deployed $app && dokku ps:rebuild $app is_deployed $app && dokku ps:rebuild $app
done done
shopt -u nullglob
;; ;;
ps:restart) ps:restart)
@@ -73,15 +71,12 @@ case "$1" in
;; ;;
ps:restartall) ps:restartall)
shopt -s nullglob
for app in $(dokku_apps); do for app in $(dokku_apps); do
dokku ps:restart $app dokku ps:restart $app
done done
shopt -u nullglob
;; ;;
ps:restore) ps:restore)
shopt -s nullglob
for app in $(dokku_apps); do for app in $(dokku_apps); do
DOKKU_APP_RESTORE=$(dokku config:get $app DOKKU_APP_RESTORE || true) DOKKU_APP_RESTORE=$(dokku config:get $app DOKKU_APP_RESTORE || true)
if [[ $DOKKU_APP_RESTORE != 0 ]]; then if [[ $DOKKU_APP_RESTORE != 0 ]]; then
@@ -89,7 +84,6 @@ case "$1" in
dokku ps:start $app dokku ps:start $app
fi fi
done done
shopt -u nullglob
;; ;;
ps:scale) ps:scale)

View File

@@ -26,11 +26,11 @@ generate_scale_file() {
echo "web=1" >> $DOKKU_SCALE_FILE echo "web=1" >> $DOKKU_SCALE_FILE
else else
while read -r line || [[ -n "$line" ]]; do while read -r line || [[ -n "$line" ]]; do
[[ -z "$line" ]] && continue [[ "$line" =~ ^#.* ]] && continue
NAME=${line%%:*} NAME=${line%%:*}
NUM_PROCS=0 NUM_PROCS=0
[[ "$NAME" == "web" ]] && NUM_PROCS=1 [[ "$NAME" == "web" ]] && NUM_PROCS=1
echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE [[ -n "$NAME" ]] && echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE
done < "$PROCFILE" done < "$PROCFILE"
fi fi
dokku_log_info1_quiet "New DOKKU_SCALE file generated" dokku_log_info1_quiet "New DOKKU_SCALE file generated"

View File

@@ -5,8 +5,7 @@
"express": "4.x" "express": "4.x"
}, },
"engines": { "engines": {
"node": "0.12.x", "node": "4.2.x"
"npm": "2.x"
}, },
"scripts": { "scripts": {
"start": "node index.js" "start": "node index.js"

View File

@@ -5,7 +5,6 @@
"express": "2.5.x" "express": "2.5.x"
}, },
"engines": { "engines": {
"node": "0.10.x", "node": "4.2.x"
"npm": "2.7.x"
} }
} }

View File

@@ -10,7 +10,7 @@
"express": "^4.0.0" "express": "^4.0.0"
}, },
"engines": { "engines": {
"node": "0.10.x" "node": "4.2.x"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -10,7 +10,7 @@
"express": "^4.0.0" "express": "^4.0.0"
}, },
"engines": { "engines": {
"node": "0.10.x" "node": "4.2.x"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -5,7 +5,6 @@
"express": "~3.3.4" "express": "~3.3.4"
}, },
"engines": { "engines": {
"node": "0.10.x", "node": "4.2.x"
"npm": "2.7.x"
} }
} }

View File

@@ -1,6 +1,6 @@
source "https://rubygems.org" source "https://rubygems.org"
ruby '1.9.3' ruby '2.2.4'
gem 'compass', ">= 1.0.1" gem 'compass', ">= 1.0.1"
gem 'sass-globbing' gem 'sass-globbing'

View File

@@ -10,7 +10,7 @@
}, },
"description": "Test application for heroku multi buildpack.", "description": "Test application for heroku multi buildpack.",
"engines": { "engines": {
"node": "~0.10.30" "node": "4.2.x"
}, },
"license": "ISC", "license": "ISC",
"name": "test-buildpack-multi", "name": "test-buildpack-multi",

View File

@@ -5,8 +5,7 @@
"express": "2.5.x" "express": "2.5.x"
}, },
"engines": { "engines": {
"node": "0.10.x", "node": "4.2.x"
"npm": "2.7.x"
}, },
"scripts": { "scripts": {
"start": "node web.js" "start": "node web.js"

View File

@@ -1,3 +1,52 @@
###############################
# DEVELOPMENT #
###############################
# Procfile for development using the new threaded worker (scheduler, twitter stream and delayed job)
cron: node worker.js cron: node worker.js
web: node web.js web: node web.js
worker: node worker.js worker: node worker.js
# Old version with separate processes (use this if you have issues with the threaded version)
# web: bundle exec rails server
# schedule: bundle exec rails runner bin/schedule.rb
# twitter: bundle exec rails runner bin/twitter_stream.rb
# dj: bundle exec script/delayed_job run
###############################
# PRODUCTION #
###############################
# You need to copy or link config/unicorn.rb.example to config/unicorn.rb for both production versions.
# Have a look at the deployment guides, if you want to set up huginn on your server:
# https://github.com/cantino/huginn/doc
# Using the threaded worker (consumes less RAM but can run slower)
# web: bundle exec unicorn -c config/unicorn.rb
# jobs: bundle exec rails runner bin/threaded.rb
# Old version with separate processes (use this if you have issues with the threaded version)
# web: bundle exec unicorn -c config/unicorn.rb
# schedule: bundle exec rails runner bin/schedule.rb
# twitter: bundle exec rails runner bin/twitter_stream.rb
# dj: bundle exec script/delayed_job run
###############################
# Multiple DelayedJob workers #
###############################
# Per default Huginn can just run one agent at a time. Using a lot of agents or calling slow
# external services frequently might require more DelayedJob workers (an indicator for this is
# a backlog in your 'Job Management' page).
# Every uncommented line starts an additional DelayedJob worker. This works for development, production
# and for the threaded and separate worker processes. Keep in mind one worker needs about 300MB of RAM.
#
#dj2: bundle exec script/delayed_job -i 2 run
#dj3: bundle exec script/delayed_job -i 3 run
#dj4: bundle exec script/delayed_job -i 4 run
#dj5: bundle exec script/delayed_job -i 5 run
#dj6: bundle exec script/delayed_job -i 6 run
#dj7: bundle exec script/delayed_job -i 7 run
#dj8: bundle exec script/delayed_job -i 8 run
#dj9: bundle exec script/delayed_job -i 9 run
#dj10: bundle exec script/delayed_job -i 10 run

View File

@@ -5,7 +5,6 @@
"express": "2.5.x" "express": "2.5.x"
}, },
"engines": { "engines": {
"node": "0.10.x", "node": "4.2.x"
"npm": "2.7.x"
} }
} }

View File

@@ -2,7 +2,6 @@
"name": "node-example", "name": "node-example",
"version": "0.0.1", "version": "0.0.1",
"engines": { "engines": {
"node": "0.10.x", "node": "4.2.x"
"npm": "2.7.x"
} }
} }

View File

@@ -4,6 +4,7 @@ set -eo pipefail
MODE="$1"; MODE=${MODE:="testing"} MODE="$1"; MODE=${MODE:="testing"}
# shellcheck disable=SC2120
setup_circle() { setup_circle() {
echo "=====> setup_circle on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> setup_circle on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E CI=true make -e sshcommand sudo -E CI=true make -e sshcommand
@@ -18,39 +19,52 @@ setup_circle() {
sudo -E CI=true make -e install sudo -E CI=true make -e install
sudo -E make -e setup-deploy-tests sudo -E make -e setup-deploy-tests
make -e ci-dependencies make -e ci-dependencies
# circleci runs Ubuntu 12.04 and thus a previous version of bash (4.2) than 14.04
sudo apt-get install -y -q "bash=$(apt-cache show bash | egrep "^Version: 4.3" | head -1 | awk -F: '{ print $2 }' | xargs)"
bash --version
docker version
# setup .dokkurc
sudo -E mkdir -p /home/dokku/.dokkurc
sudo -E chown dokku:ubuntu /home/dokku/.dokkurc
sudo -E chmod 775 /home/dokku/.dokkurc
} }
if [[ -n "$CIRCLE_NODE_INDEX" ]] && [[ "$MODE" == "setup" ]]; then if [[ -n "$CIRCLE_NODE_INDEX" ]] && [[ "$MODE" == "setup" ]]; then
case "$CIRCLE_NODE_INDEX" in # shellcheck disable=SC2119
3) setup_circle
setup_circle buildstack exit $?
exit $? # case "$CIRCLE_NODE_INDEX" in
;; # 3)
*) # setup_circle buildstack
setup_circle # exit $?
exit $? # ;;
;; # *)
esac # setup_circle
# exit $?
# ;;
# esac
fi fi
case "$CIRCLE_NODE_INDEX" in case "$CIRCLE_NODE_INDEX" in
0) 0)
echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make unit-tests (1/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E UNIT_TEST_BATCH=1 make -e unit-tests sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
;; ;;
1) 1)
echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make unit-tests (2/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E UNIT_TEST_BATCH=2 make -e unit-tests sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
;; ;;
2) 2)
echo "=====> make deploy-tests (herokuish release) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make unit-tests (3/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E make -e deploy-tests sudo -E UNIT_TEST_BATCH=3 make -e unit-tests
echo "=====> make deploy tests"
sudo -E make -e deploy-test-checks-root deploy-test-config deploy-test-multi
;; ;;
3) 3)
echo "=====> make deploy-tests (herokuish master) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make unit-tests (4/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E make -e deploy-tests sudo -E UNIT_TEST_BATCH=4 make -e unit-tests
;; ;;
esac esac

View File

@@ -22,6 +22,6 @@ exec /usr/local/bin/gitreceived -p 2022 -n /root/.ssh/id_rsa /tmp/receiver
EOF EOF
cat<<EOF > /etc/rc.local cat<<EOF > /etc/rc.local
curl https://raw.githubusercontent.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver curl https://raw.githubusercontent.com/dokku/dokku/master/tests/ci/receiver -s > /tmp/receiver
chmod +x /tmp/receiver chmod +x /tmp/receiver
EOF EOF

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
is_number() { is_number() {
local NUMBER=$1; local NUM_RE='^[0-9]+$' local NUMBER=$1; local NUM_RE='^[1-4]+$'
if [[ $NUMBER =~ $NUM_RE ]]; then if [[ $NUMBER =~ $NUM_RE ]]; then
return 0 return 0
else else
@@ -10,28 +10,13 @@ is_number() {
} }
usage() { usage() {
echo "usage: $0 1|2" echo "usage: $0 1|2|3|4"
exit 0 exit 0
} }
BATCH_NUM="$1" BATCH_NUM="$1"
is_number $BATCH_NUM || usage is_number $BATCH_NUM || usage
TESTS=($(find "$(dirname $0)"/../unit -maxdepth 1 -name "*.bats")) TESTS=$(find "$(dirname $0)"/../unit -maxdepth 1 -name "${BATCH_NUM}0*.bats" | sort -n | xargs)
HALF_TESTS=$(( ${#TESTS[@]} / 2 )) echo "running the following tests $TESTS"
FIRST_HALF=("${TESTS[@]:0:${HALF_TESTS}}") bats $TESTS
LAST_HALF=("${TESTS[@]:${HALF_TESTS}:${#TESTS[@]}}")
case "$BATCH_NUM" in
1)
bats "${FIRST_HALF[@]}"
;;
2)
bats "${LAST_HALF[@]}"
;;
*)
usage
;;
esac

59
tests/unit/10_apps.bats Normal file
View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bats
load test_helper
@test "(apps) apps" {
create_app
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_output $TEST_APP
destroy_app
}
@test "(apps) apps:create" {
run dokku apps:create $TEST_APP
echo "output: "$output
echo "status: "$status
assert_success
destroy_app
run dokku apps:create 1994testapp
echo "output: "$output
echo "status: "$status
assert_success
dokku --force apps:destroy 1994testapp
run dokku apps:create TestApp
echo "output: "$output
echo "status: "$status
assert_failure
}
@test "(apps) apps:destroy" {
create_app
run bash -c "dokku --force apps:destroy $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(apps) apps:rename" {
deploy_app
run bash -c "dokku apps:rename $TEST_APP great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_output ""
run bash -c "curl --silent --write-out '%{http_code}\n' `dokku url great-test-name` | grep 404"
echo "output: "$output
echo "status: "$status
assert_output ""
run bash -c "dokku --force apps:destroy great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -24,28 +24,35 @@ teardown() {
teardown_local_tls teardown_local_tls
} }
@test "certs:add" { @test "(certs) certs:add" {
run bash -c "dokku certs:add $TEST_APP $BATS_TMPDIR/tls/server.crt $BATS_TMPDIR/tls/server.key" run bash -c "dokku certs:add $TEST_APP $BATS_TMPDIR/tls/server.crt $BATS_TMPDIR/tls/server.key"
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
assert_success assert_success
} }
@test "certs:add < tar" { @test "(certs) certs:add < tar" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar" run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar"
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
assert_success assert_success
} }
@test "certs:info" { @test "(certs) certs:add < tar should ignore OSX hidden files" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/osx_ssl_tarred.tar"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(certs) certs:info" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:info $TEST_APP" run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:info $TEST_APP"
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
assert_success assert_success
} }
@test "certs:remove" { @test "(certs) certs:remove" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:remove $TEST_APP" run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:remove $TEST_APP"
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status

70
tests/unit/10_core_1.bats Normal file
View File

@@ -0,0 +1,70 @@
#!/usr/bin/env bats
load test_helper
setup() {
create_app
}
teardown() {
rm -rf /home/dokku/$TEST_APP/tls /home/dokku/tls
destroy_app
disable_tls_wildcard
}
assert_urls() {
urls=$@
run dokku urls $TEST_APP
echo "output: "$output
echo "status: "$status
assert_output < <(tr ' ' '\n' <<< "${urls}")
}
build_nginx_config() {
# simulate nginx post-deploy
dokku domains:setup $TEST_APP
dokku nginx:build-config $TEST_APP
}
@test "(core) remove exited containers" {
deploy_app
# make sure we have many exited containers of the same 'type'
run bash -c "for cnt in 1 2 3; do dokku run $TEST_APP hostname; done"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
echo "output: "$output
echo "status: "$status
assert_success
run dokku cleanup
echo "output: "$output
echo "status: "$status
assert_success
sleep 5 # wait for dokku cleanup to happen in the background
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
echo "output: "$output
echo "status: "$status
assert_failure
run bash -c "docker ps -a -f 'status=exited' -q --no-trunc=false"
echo "output: "$output
echo "status: "$status
assert_output ""
}
@test "(core) run (with tty)" {
deploy_app
run /bin/bash -c "dokku run $TEST_APP ls /app/package.json"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(core) run (without tty)" {
deploy_app
run /bin/bash -c ": |dokku run $TEST_APP ls /app/package.json"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -3,14 +3,17 @@
load test_helper load test_helper
setup() { setup() {
[[ -f $DOKKU_ROOT/ENV ]] && mv -f $DOKKU_ROOT/ENV $DOKKU_ROOT/ENV.bak [[ -f ${DOKKU_ROOT}/ENV ]] && mv -f ${DOKKU_ROOT}/ENV ${DOKKU_ROOT}/ENV.bak
sudo -H -u dokku /bin/bash -c "echo 'export global_test=true' > $DOKKU_ROOT/ENV" sudo -H -u dokku /bin/bash -c "echo 'export global_test=true' > ${DOKKU_ROOT}/ENV"
create_app create_app
} }
teardown() { teardown() {
destroy_app destroy_app
[[ -f $DOKKU_ROOT/ENV.bak ]] && mv -f $DOKKU_ROOT/ENV.bak $DOKKU_ROOT/ENV ls -la ${DOKKU_ROOT}
if [[ -f ${DOKKU_ROOT}/ENV.bak ]];then
mv -f ${DOKKU_ROOT}/ENV.bak ${DOKKU_ROOT}/ENV
fi
} }
@test "(config) config:set --global" { @test "(config) config:set --global" {

View File

@@ -0,0 +1,91 @@
#!/usr/bin/env bats
load test_helper
setup() {
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -f "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
[[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -f "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
DOCKERFILE="$BATS_TMPDIR/Dockerfile"
}
teardown() {
destroy_app
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST"
[[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME"
}
check_urls() {
local PATTERN="$1"
run bash -c "dokku --quiet urls $TEST_APP | egrep \"${1}\""
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(core) port exposure (with global VHOST)" {
echo "dokku.me" > "$DOKKU_ROOT/VHOST"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_failure
check_urls http://${TEST_APP}.dokku.me
}
@test "(core) port exposure (without global VHOST and real HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
echo "${TEST_APP}.dokku.me" > "$DOKKU_ROOT/HOSTNAME"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}
@test "(core) port exposure (with NO_VHOST set)" {
deploy_app
dokku config:set $TEST_APP NO_VHOST=1
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}
@test "(core) port exposure (without global VHOST and IPv4 address as HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
echo "127.0.0.1" > "$DOKKU_ROOT/HOSTNAME"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}
@test "(core) port exposure (without global VHOST and IPv6 address as HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
echo "fda5:c7db:a520:bb6d::aabb:ccdd:eeff" > "$DOKKU_ROOT/HOSTNAME"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}

View File

@@ -10,7 +10,7 @@ teardown() {
destroy_app destroy_app
} }
@test "docker-options:add (all phases)" { @test "(docker-options) docker-options:add (all phases)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -21,7 +21,7 @@ teardown() {
assert_success assert_success
} }
@test "docker-options:add (build phase)" { @test "(docker-options) docker-options:add (build phase)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP build \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP build \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -32,7 +32,7 @@ teardown() {
assert_success assert_success
} }
@test "docker-options:add (deploy phase)" { @test "(docker-options) docker-options:add (deploy phase)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP deploy \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -43,7 +43,7 @@ teardown() {
assert_success assert_success
} }
@test "docker-options:add (run phase)" { @test "(docker-options) docker-options:add (run phase)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP run \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP run \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -54,7 +54,7 @@ teardown() {
assert_success assert_success
} }
@test "docker-options:remove (all phases)" { @test "(docker-options) docker-options:remove (all phases)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -73,7 +73,7 @@ teardown() {
assert_success assert_success
} }
@test "docker-options:remove (build phase)" { @test "(docker-options) docker-options:remove (build phase)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -92,7 +92,7 @@ teardown() {
assert_output "Build options: none" assert_output "Build options: none"
} }
@test "docker-options:remove (deploy phase)" { @test "(docker-options) docker-options:remove (deploy phase)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -111,7 +111,7 @@ teardown() {
assert_output "Deploy options: none" assert_output "Deploy options: none"
} }
@test "docker-options:remove (run phase)" { @test "(docker-options) docker-options:remove (run phase)" {
run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP build,deploy,run \"-v /tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -130,7 +130,7 @@ teardown() {
assert_output "Run options: none" assert_output "Run options: none"
} }
@test "docker-options (deploy with options)" { @test "(docker-options) deploy with options" {
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy \"-v /var/tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP deploy \"-v /var/tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -150,7 +150,7 @@ teardown() {
deploy_app deploy_app
} }
@test "docker-options:add (all phases over SSH)" { @test "(docker-options) docker-options:add (all phases over SSH)" {
run ssh dokku@dokku.me docker-options:add $TEST_APP build,deploy,run "-v /tmp" run ssh dokku@dokku.me docker-options:add $TEST_APP build,deploy,run "-v /tmp"
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
@@ -161,7 +161,7 @@ teardown() {
assert_success assert_success
} }
@test "docker-options (dockerfile deploy with link)" { @test "(docker-options) dockerfile deploy with link" {
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy \"-v /var/tmp\"" run /bin/bash -c "dokku docker-options:add $TEST_APP deploy \"-v /var/tmp\""
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status

View File

@@ -23,73 +23,6 @@ check_urls() {
assert_success assert_success
} }
@test "(core) port exposure (with global VHOST)" {
echo "dokku.me" > "$DOKKU_ROOT/VHOST"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_failure
check_urls http://${TEST_APP}.dokku.me
}
@test "(core) port exposure (without global VHOST and real HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
echo "${TEST_APP}.dokku.me" > "$DOKKU_ROOT/HOSTNAME"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}
@test "(core) port exposure (with NO_VHOST set)" {
deploy_app
dokku config:set $TEST_APP NO_VHOST=1
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}
@test "(core) port exposure (without global VHOST and IPv4 address as HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
echo "127.0.0.1" > "$DOKKU_ROOT/HOSTNAME"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}
@test "(core) port exposure (without global VHOST and IPv6 address as HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
echo "fda5:c7db:a520:bb6d::aabb:ccdd:eeff" > "$DOKKU_ROOT/HOSTNAME"
deploy_app
CONTAINER_ID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "docker port $CONTAINER_ID | sed 's/[0-9.]*://' | egrep -q '[0-9]*'"
echo "output: "$output
echo "status: "$status
assert_success
HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
check_urls http://${HOSTNAME}:[0-9]+
}
@test "(core) port exposure (pre-deploy domains:add)" { @test "(core) port exposure (pre-deploy domains:add)" {
create_app create_app
run dokku domains:add $TEST_APP www.test.app.dokku.me run dokku domains:add $TEST_APP www.test.app.dokku.me

View File

@@ -26,48 +26,6 @@ build_nginx_config() {
dokku nginx:build-config $TEST_APP dokku nginx:build-config $TEST_APP
} }
@test "(core) remove exited containers" {
deploy_app
# make sure we have many exited containers of the same 'type'
run bash -c "for cnt in 1 2 3; do dokku run $TEST_APP hostname; done"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
echo "output: "$output
echo "status: "$status
assert_success
run dokku cleanup
echo "output: "$output
echo "status: "$status
assert_success
sleep 5 # wait for dokku cleanup to happen in the background
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
echo "output: "$output
echo "status: "$status
assert_failure
run bash -c "docker ps -a -f 'status=exited' -q --no-trunc=false"
echo "output: "$output
echo "status: "$status
assert_output ""
}
@test "(core) run (with tty)" {
deploy_app
run /bin/bash -c "dokku run $TEST_APP ls /app/package.json"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(core) run (without tty)" {
deploy_app
run /bin/bash -c ": |dokku run $TEST_APP ls /app/package.json"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(core) run (with --options)" { @test "(core) run (with --options)" {
deploy_app deploy_app
run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version" run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version"

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