Compare commits
83 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35dc92fb3f | ||
|
|
eecd262eff | ||
|
|
6fbe8cabde | ||
|
|
dd0d0a3873 | ||
|
|
4a36cbad53 | ||
|
|
3c3e5a962d | ||
|
|
8775a2de1a | ||
|
|
d7b1e38cb7 | ||
|
|
e323770f89 | ||
|
|
32f1bc5396 | ||
|
|
9d0f099e86 | ||
|
|
76ad65b715 | ||
|
|
d320203c2c | ||
|
|
30118d1b32 | ||
|
|
88be5083e0 | ||
|
|
2955150dfe | ||
|
|
321c178f9f | ||
|
|
a24b12eece | ||
|
|
8b88cb8867 | ||
|
|
8b879079e4 | ||
|
|
e4a23048ec | ||
|
|
a06166c08b | ||
|
|
b3e9893e9d | ||
|
|
d31ac73066 | ||
|
|
6366aad1e7 | ||
|
|
208d3c13d9 | ||
|
|
e408351ec6 | ||
|
|
66e255a396 | ||
|
|
441272d54b | ||
|
|
3d21132e98 | ||
|
|
51cd991174 | ||
|
|
104b76129d | ||
|
|
4608a382b1 | ||
|
|
1286529c6e | ||
|
|
a00d4ef792 | ||
|
|
d097a34735 | ||
|
|
dda3c721e0 | ||
|
|
715e51b80c | ||
|
|
260b294ee9 | ||
|
|
16242e78ba | ||
|
|
90ea6a5ba4 | ||
|
|
74ebcb472f | ||
|
|
2d147cfd12 | ||
|
|
7fa6b1901a | ||
|
|
1c33159dcd | ||
|
|
4e6f03a2c1 | ||
|
|
89a2dbfb3e | ||
|
|
9001c1079b | ||
|
|
ab2721bc37 | ||
|
|
b4e56c43fc | ||
|
|
80dc4cc3b6 | ||
|
|
f66d764197 | ||
|
|
37db940d1f | ||
|
|
fb5bc6c3e3 | ||
|
|
244fd15d48 | ||
|
|
6d58c8af40 | ||
|
|
bed6254450 | ||
|
|
711a0c12d4 | ||
|
|
be1a9d3d9a | ||
|
|
9ba2d15f86 | ||
|
|
c1dfb46bf0 | ||
|
|
3fd4f519bf | ||
|
|
c2153aa840 | ||
|
|
f8f9aa7b1b | ||
|
|
012d8eabe7 | ||
|
|
9d3c856afd | ||
|
|
65cda8b04e | ||
|
|
da70a18601 | ||
|
|
783cf417a0 | ||
|
|
63867d4abe | ||
|
|
606036a50f | ||
|
|
0606d1a805 | ||
|
|
a86119ddb6 | ||
|
|
f0b260d7dc | ||
|
|
2f95fa0a95 | ||
|
|
cfe7604696 | ||
|
|
8e9d04ae36 | ||
|
|
e0143ed226 | ||
|
|
4894a03bfe | ||
|
|
21799dcf40 | ||
|
|
d520be9e81 | ||
|
|
757e6b8f68 | ||
|
|
f11459faad |
@@ -2,12 +2,12 @@
|
||||
|
||||
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
|
||||
* Write test cases for open bug issues
|
||||
* Write patches for open bug/feature issues, preferably with test cases
|
||||
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
|
||||
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!
|
||||
|
||||
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
|
||||
time, we will also pull plugins into the dokku core when the task they solve is
|
||||
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.
|
||||
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.
|
||||
@@ -55,8 +55,10 @@ When reporting issues, please include your host OS (Ubuntu 14.04, Fedora 19,
|
||||
etc). Please include:
|
||||
|
||||
* The output of `uname -a`.
|
||||
* The output of `free -m`
|
||||
* The output of `docker version`.
|
||||
* The output of `docker -D info`.
|
||||
* The output of `docker run -ti gliderlabs/herokuish:latest herokuish version`
|
||||
* The output of `dokku version`.
|
||||
* The output of `dokku plugin`.
|
||||
|
||||
@@ -72,13 +74,15 @@ Description of problem:
|
||||
Output of the following commands
|
||||
|
||||
- `uname -a`:
|
||||
- `free -m`:
|
||||
- `docker version`:
|
||||
- `docker -D info`:
|
||||
- `docker run -ti gliderlabs/herokuish:latest herokuish version`:
|
||||
- `dokku version`:
|
||||
- `dokku plugin`:
|
||||
- `docker inspect CONTAINER_ID` (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):
|
||||
|
||||
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
|
||||
|
||||
* 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.
|
||||
* 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.
|
||||
@@ -132,7 +136,7 @@ need to do
|
||||
* Check for unnecessary whitespace with `git diff --check` before committing.
|
||||
* Use descriptive commit messages and reference the #issue number.
|
||||
* 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.
|
||||
* 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
|
||||
@@ -182,13 +186,13 @@ To run the shellcheck sniffs for Dokku coding standards:
|
||||
make ci-dependencies
|
||||
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.
|
||||
|
||||
# Additional Resources
|
||||
|
||||
* [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/)
|
||||
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
|
||||
* [#dokku IRC channel on freenode.org](https://webchat.freenode.net/?channels=dokku)
|
||||
|
||||
77
HISTORY.md
77
HISTORY.md
@@ -1,5 +1,74 @@
|
||||
# History
|
||||
|
||||
## 0.4.7
|
||||
|
||||
### 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: @michaelshobbs 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
|
||||
|
||||
This release is mostly a bugfix release. Two notable changes:
|
||||
@@ -204,9 +273,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:
|
||||
|
||||
- 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.
|
||||
- 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.
|
||||
- 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.
|
||||
- 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://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://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.
|
||||
|
||||
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 +384,7 @@ This release is a bugfix release covering dokku packaging.
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
16
Makefile
16
Makefile
@@ -1,7 +1,7 @@
|
||||
DOKKU_VERSION = master
|
||||
|
||||
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/progrium/sshcommand/master/sshcommand
|
||||
PLUGN_URL ?= https://github.com/progrium/dokku/releases/download/v0.4.0/plugn_0.2.0_linux_x86_64.tgz
|
||||
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/master/sshcommand
|
||||
PLUGN_URL ?= https://github.com/dokku/dokku/releases/download/v0.4.0/plugn_0.2.0_linux_x86_64.tgz
|
||||
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
|
||||
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
|
||||
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 sshcommand*.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
|
||||
|
||||
packer:
|
||||
@@ -72,10 +71,10 @@ version:
|
||||
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
|
||||
|
||||
plugin-dependencies: plugn
|
||||
dokku plugin:install-dependencies --core
|
||||
sudo -E dokku plugin:install-dependencies --core
|
||||
|
||||
plugins: plugn docker
|
||||
dokku plugin:install --core
|
||||
sudo -E dokku plugin:install --core
|
||||
|
||||
dependencies: apt-update sshcommand plugn docker help2man man-db
|
||||
$(MAKE) -e stack
|
||||
@@ -140,12 +139,7 @@ count:
|
||||
@find tests -type f -not -name .DS_Store | xargs cat | sed 's/^$$//g' | wc -l
|
||||
|
||||
dokku-installer:
|
||||
apt-get install -qq -y ruby
|
||||
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 || python contrib/dokku-installer.py onboot
|
||||
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 || touch /var/lib/dokku/.dokku-installer-created
|
||||
|
||||
16
README.md
16
README.md
@@ -1,4 +1,4 @@
|
||||
# Dokku [](https://circleci.com/gh/progrium/dokku/tree/master) [](https://packagecloud.io/dokku/dokku) [](https://webchat.freenode.net/?channels=dokku) [](http://progrium.viewdocs.io/dokku/) [](https://gratipay.com/dokku/)
|
||||
# Dokku [](https://circleci.com/gh/dokku/dokku/tree/master) [](https://packagecloud.io/dokku/dokku) [](https://webchat.freenode.net/?channels=dokku) [](http://dokku.viewdocs.io/dokku/) [](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/).
|
||||
|
||||
@@ -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`:
|
||||
|
||||
wget https://raw.githubusercontent.com/progrium/dokku/v0.4.5/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.4.5 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.4.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.4.7 bash bootstrap.sh
|
||||
|
||||
### 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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
@@ -37,4 +37,4 @@ Dokku is currently sponsored by the enterprise grade, multi-host PaaS project [D
|
||||
|
||||
## 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
|
||||
|
||||
3
SPONSORS
3
SPONSORS
@@ -1 +1,2 @@
|
||||
Deis http://deis.io
|
||||
Deis http://deis.io
|
||||
DigitalOcean https://www.digitalocean.com/
|
||||
|
||||
8
Vagrantfile
vendored
8
Vagrantfile
vendored
@@ -40,6 +40,14 @@ Vagrant::configure("2") do |config|
|
||||
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 => "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
|
||||
|
||||
# For windows users. Sharing folder from windows creates problem with sym links and so, sync the repo instead from GOS.
|
||||
|
||||
10
bootstrap.sh
10
bootstrap.sh
@@ -16,11 +16,11 @@ bootstrap () {
|
||||
|
||||
set -eo pipefail
|
||||
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..."
|
||||
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
|
||||
fi
|
||||
|
||||
@@ -53,7 +53,7 @@ dokku_install_package() {
|
||||
echo "--> Installing docker"
|
||||
if uname -r | grep -q linode; then
|
||||
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."
|
||||
sleep 10
|
||||
fi
|
||||
@@ -90,14 +90,14 @@ elif [[ -n $DOKKU_TAG ]]; then
|
||||
elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then
|
||||
export DOKKU_CHECKOUT="$DOKKU_SEMVER"
|
||||
dokku_install_package
|
||||
dokku plugin:install-dependencies --core
|
||||
sudo -E dokku plugin:install-dependencies --core
|
||||
else
|
||||
export DOKKU_CHECKOUT="$DOKKU_TAG"
|
||||
dokku_install_source
|
||||
fi
|
||||
else
|
||||
dokku_install_package
|
||||
dokku plugin:install-dependencies --core
|
||||
sudo -E dokku plugin:install-dependencies --core
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
machine:
|
||||
pre:
|
||||
- echo 'DOCKER_OPTS="-s btrfs -e lxc -D --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.8.2-circleci-cp-workaround'
|
||||
- sudo chmod 0755 /usr/bin/docker
|
||||
services:
|
||||
- docker
|
||||
dependencies:
|
||||
|
||||
217
contrib/dokku-installer.py
Executable file
217
contrib/dokku-installer.py
Executable file
@@ -0,0 +1,217 @@
|
||||
#!/usr/bin/env python2.7
|
||||
|
||||
import cgi
|
||||
import json
|
||||
import os
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.4.7'
|
||||
|
||||
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=#{File.absolute_path(__FILE__)} selfdestruct\n")
|
||||
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
|
||||
|
||||
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://<app-name>."+$("#hostname").val())
|
||||
} else {
|
||||
$("#example").html("http://"+$("#hostname").val()+":<app-port>")
|
||||
}
|
||||
}
|
||||
$("#vhost").change(update);
|
||||
$("#hostname").change(update);
|
||||
update();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -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://<app-name>."+$("#hostname").val())
|
||||
} else {
|
||||
$("#example").html("http://"+$("#hostname").val()+":<app-port>")
|
||||
}
|
||||
}
|
||||
$("#vhost").change(update);
|
||||
$("#hostname").change(update);
|
||||
update();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
34
deb.mk
34
deb.mk
@@ -5,28 +5,26 @@ HEROKUISH_ARCHITECTURE = amd64
|
||||
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
|
||||
|
||||
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
|
||||
|
||||
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_ARCHITECTURE = amd64
|
||||
PLUGN_PACKAGE_NAME = plugn_$(PLUGN_VERSION)_$(PLUGN_ARCHITECTURE).deb
|
||||
|
||||
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_ARCHITECTURE = amd64
|
||||
SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb
|
||||
|
||||
GEM_ARCHITECTURE = amd64
|
||||
|
||||
GOROOT = /usr/lib/go
|
||||
GOBIN = /usr/bin/go
|
||||
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:
|
||||
echo "--> Initial apt-get update"
|
||||
@@ -42,7 +40,7 @@ install-from-deb:
|
||||
sudo apt-get update -qq > /dev/null
|
||||
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 .
|
||||
echo "Done"
|
||||
|
||||
@@ -96,7 +94,7 @@ deb-dokku: deb-setup
|
||||
$(MAKE) help2man
|
||||
$(MAKE) addman
|
||||
cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/local/share/man/man1/dokku.1
|
||||
cp contrib/dokku-installer.rb /tmp/build/usr/local/share/dokku/contrib
|
||||
cp contrib/dokku-installer.py /tmp/build/usr/local/share/dokku/contrib
|
||||
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
|
||||
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
|
||||
@@ -104,18 +102,6 @@ deb-dokku: deb-setup
|
||||
dpkg-deb --build /tmp/build "/vagrant/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
|
||||
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
|
||||
rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build
|
||||
@@ -129,10 +115,10 @@ deb-plugn: deb-setup
|
||||
sudo apt-get clean
|
||||
sudo apt-get update -qq > /dev/null
|
||||
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 && 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/progrium/plugn && rm plugn && go build -o plugn
|
||||
mv /home/vagrant/gocode/src/github.com/progrium/plugn/plugn /tmp/build/usr/local/bin/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/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/dokku/plugn && rm plugn && go build -o plugn
|
||||
mv /home/vagrant/gocode/src/github.com/dokku/plugn/plugn /tmp/build/usr/local/bin/plugn
|
||||
|
||||
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' .
|
||||
|
||||
10
debian/control
vendored
10
debian/control
vendored
@@ -1,9 +1,11 @@
|
||||
Package: dokku
|
||||
Version: 0.4.5
|
||||
Version: 0.4.7
|
||||
Section: web
|
||||
Priority: optional
|
||||
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
|
||||
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
|
||||
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
|
||||
Recommends: herokuish
|
||||
Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo
|
||||
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
Description: Docker powered mini-Heroku in around 100 lines of Bash
|
||||
Description: A docker-powered PaaS that helps you build and manage the lifecycle of applications
|
||||
|
||||
|
||||
8
debian/postinst
vendored
8
debian/postinst
vendored
@@ -46,8 +46,8 @@ case "$1" in
|
||||
|
||||
dokku plugin:install --core
|
||||
|
||||
rm -f /home/dokku/VERSION
|
||||
cp /var/lib/dokku/STABLE_VERSION /home/dokku/VERSION
|
||||
rm -f ${DOKKU_ROOT}/VERSION
|
||||
cp /var/lib/dokku/STABLE_VERSION ${DOKKU_ROOT}/VERSION
|
||||
|
||||
if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then
|
||||
sudo service dokku-installer start
|
||||
@@ -71,7 +71,9 @@ case "$1" in
|
||||
|
||||
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
|
||||
db_get "dokku/key_file"
|
||||
sshcommand acl-add dokku default < "$RET"
|
||||
if [ -f "$RET" ]; then
|
||||
sshcommand acl-add dokku default < "$RET"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
2
debian/preinst
vendored
2
debian/preinst
vendored
@@ -13,7 +13,7 @@ case "$1" in
|
||||
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
|
||||
echo 'exec /usr/local/share/dokku/contrib/dokku-installer.py selfdestruct' >> $INIT_CONF
|
||||
|
||||
rm -f $NGINX_CONF
|
||||
touch $NGINX_CONF
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
You can always install dokku straight from the latest - potentially unstable - master release via the following bash command:
|
||||
|
||||
```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
|
||||
@@ -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:
|
||||
|
||||
```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
|
||||
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.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/progrium/dokku.git
|
||||
git clone https://github.com/dokku/dokku.git
|
||||
cd dokku
|
||||
sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make install
|
||||
```
|
||||
|
||||
@@ -100,6 +100,16 @@ This will prompt you to verify the application's name before destroying it. You
|
||||
dokku --force apps:destroy APP
|
||||
```
|
||||
|
||||
### Renaming a deployed app
|
||||
|
||||
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
|
||||
|
||||
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 +126,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.
|
||||
|
||||
### 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
|
||||
|
||||
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 +180,7 @@ This is in particular useful, then you want to deploy to root domain, as
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.5/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
|
||||
@@ -2,37 +2,37 @@
|
||||
"name": "Dokku",
|
||||
"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.7\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"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.7\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"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.7\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"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.7\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"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.7\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"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.7\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
|
||||
@@ -25,7 +25,7 @@ h1 {
|
||||
padding: 0 0 0 1em;
|
||||
}
|
||||
.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.7/docs/assets/dokku.png);
|
||||
color: #fff;
|
||||
text-indent: 40px;
|
||||
background-position: center left;
|
||||
@@ -40,7 +40,7 @@ h1 {
|
||||
.blurb {
|
||||
color: #424242;
|
||||
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.7/docs/assets/gplaypattern.png);
|
||||
padding: 45px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
```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
|
||||
# .bashrc, .bash_profile, or .profile file
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
|
||||
* [Herokuish](https://github.com/gliderlabs/herokuish) - Buildpack builder
|
||||
* [plugn](https://github.com/progrium/plugn) - Shell based plugins and hooks
|
||||
* [sshcommand](https://github.com/progrium/sshcommand) - Fixed commands over SSH
|
||||
* [plugn](https://github.com/dokku/plugn) - Shell based plugins and hooks
|
||||
* [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.
|
||||
|
||||
@@ -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 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.
|
||||
|
||||
|
||||
@@ -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)...
|
||||
-----> Running pre-flight 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...
|
||||
-----> Waiting for 10 seconds ...
|
||||
-----> Default container check successful!
|
||||
|
||||
@@ -26,7 +26,13 @@ The `certs:add` command can be used to push a `tar` containing a certificate `.c
|
||||
```shell
|
||||
tar cvf cert-key.tar server.crt server.key
|
||||
# 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
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
If you create your own plugin:
|
||||
|
||||
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`)
|
||||
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
|
||||
|
||||
### Sample plugin
|
||||
@@ -89,4 +89,4 @@ A few notes:
|
||||
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.
|
||||
- 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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:
|
||||
|
||||
@@ -380,6 +380,27 @@ docker commit $id $IMAGE > /dev/null
|
||||
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`
|
||||
|
||||
- Description: Allows running of commands after a deploy has completed. Dokku core currently uses this to switch traffic on nginx.
|
||||
@@ -525,9 +546,9 @@ echo false
|
||||
|
||||
### `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`
|
||||
- Arguments: `$APP`
|
||||
- Arguments: `$APP` `action name` `domains`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
|
||||
@@ -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:
|
||||
|
||||
- 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 `docs/home.html` file
|
||||
- The installable version must be changed in the `docs/index.md` file
|
||||
|
||||
@@ -14,7 +14,7 @@ Example apps can be found here:
|
||||
|
||||
### 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
|
||||
|
||||
```shell
|
||||
|
||||
@@ -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 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!
|
||||
|
||||
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
|
||||
@@ -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.
|
||||
|
||||
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)
|
||||
|
||||
|
||||
@@ -36,4 +36,4 @@ __Warning__: These steps will delete *everything* on your 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.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
- 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`
|
||||
|
||||
@@ -4,7 +4,7 @@ If you’re stuck, there are a number of places you can get help:
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
@@ -10,26 +10,26 @@
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/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="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="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="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="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="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="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="180x180" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/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/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/progrium/dokku/v0.4.5/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="manifest" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/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="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/progrium/dokku/v0.4.5/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-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/browserconfig.xml">
|
||||
<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">
|
||||
@@ -87,12 +87,12 @@
|
||||
<p class="line">
|
||||
<span class="path">~</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.7/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path">~</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.7 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"># => Go to your server's IP and follow the web installer</span>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<p class="line">
|
||||
<span class="path">~</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.7/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path">~</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.7 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"># => Go to your server's IP and follow the web installer</span>
|
||||
|
||||
@@ -19,8 +19,8 @@ To install the latest stable version of dokku, you can run the following shell c
|
||||
|
||||
```shell
|
||||
# installs dokku via apt-get
|
||||
wget https://raw.githubusercontent.com/progrium/dokku/v0.4.5/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.4.5 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.4.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.4.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
- [Digital Ocean Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/digitalocean)
|
||||
- [Linode Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/linode/)
|
||||
- [Microsoft Azure Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/azure/)
|
||||
- [Digital Ocean Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/digitalocean)
|
||||
- [Linode Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/linode/)
|
||||
- [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:
|
||||
|
||||
- [Debian Package Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/debian)
|
||||
- [Vagrant Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/vagrant)
|
||||
- [Advanced Install Customization](http://progrium.viewdocs.io/dokku/advanced-installation)
|
||||
- [Debian Package Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/debian)
|
||||
- [Vagrant Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/vagrant)
|
||||
- [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>[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>
|
||||
|
||||
@@ -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:
|
||||
|
||||
- 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.ssl_terminated.template` (since 0.4.0)
|
||||
- `nginx.ssl.conf.template` (since 0.4.2)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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.
|
||||
|
||||
@@ -26,7 +26,7 @@ dokku plugins-install
|
||||
|
||||
## 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)
|
||||
|
||||
@@ -40,6 +40,7 @@ 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+ |
|
||||
| [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+ |
|
||||
| [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+ |
|
||||
| [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+ |
|
||||
@@ -114,6 +115,8 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
[abossard]: https://github.com/dudagroup
|
||||
[alexkruegger]: https://github.com/alexkruegger
|
||||
[dokku]: https://github.com/dokku
|
||||
[sgulseth]: https://github.com/sgulseth
|
||||
[sseemayer]: https://github.com/sseemayer
|
||||
|
||||
### Datastores
|
||||
|
||||
@@ -140,8 +143,8 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [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](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 |
|
||||
|
||||
#### Other
|
||||
|
||||
@@ -163,8 +166,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 |
|
||||
| [Supervisord](https://github.com/statianzo/dokku-supervisord) | [statianzo][] | 0.3.x |
|
||||
|
||||
[c77cbf1]: https://github.com/progrium/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
|
||||
[28de3ec]: https://github.com/progrium/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
|
||||
[c77cbf1]: https://github.com/dokku/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
|
||||
[28de3ec]: https://github.com/dokku/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
|
||||
|
||||
### Dokku Features
|
||||
|
||||
@@ -180,6 +183,8 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
| [Graduate (Environment Management)](https://github.com/glassechidna/dokku-graduate) | [Benjamin-Dobell][] | 0.3.14+ |
|
||||
| [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+ |
|
||||
| [Lets Encrypt (Zero-Downtime)](https://github.com/sseemayer/dokku-letsencrypt) | [sseemayer][] | 0.4.0+ |
|
||||
| [Lets Encrypt](https://github.com/sgulseth/dokku-letsencrypt) | [sgulseth][] | 0.4.0+ |
|
||||
| [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | |
|
||||
| [Nuke Containers](https://github.com/heichblatt/dokku-nuke) | [heichblatt][] | |
|
||||
| [Open App Ports](https://github.com/heichblatt/dokku-ports) | [heichblatt][] | |
|
||||
@@ -188,7 +193,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 |
|
||||
| [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)
|
||||
|
||||
@@ -210,7 +215,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+ |
|
||||
| [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][] | |
|
||||
| [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+ |
|
||||
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | |
|
||||
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | |
|
||||
|
||||
@@ -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">
|
||||
<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="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="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="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="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="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="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="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="180x180" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/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/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/progrium/dokku/v0.4.5/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="manifest" href="https://cdn.rawgit.com/progrium/dokku/v0.4.5/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="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/progrium/dokku/v0.4.5/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-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.7/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/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.7/docs/assets/style.css" rel="stylesheet">
|
||||
<style>
|
||||
</style>
|
||||
</head>
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-offset-2">
|
||||
<h1 class="heading navbar-brand">
|
||||
<a href="http://progrium.viewdocs.io/dokku/">Dokku</a>
|
||||
<a href="http://dokku.viewdocs.io/dokku/">Dokku</a>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -87,7 +87,7 @@ __Solution (Less solution, more helpful troubleshooting steps):__
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
* https://github.com/progrium/dokku/issues/509
|
||||
* https://github.com/dokku/dokku/issues/509
|
||||
* https://github.com/dokku-alt/dokku-alt/issues/169
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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.
|
||||
|
||||
|
||||
7
dokku
7
dokku
@@ -49,12 +49,16 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
|
||||
fi
|
||||
! 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)
|
||||
sudo -u dokku -E -H $0 "$@"
|
||||
exit $?
|
||||
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
|
||||
export -n SSH_ORIGINAL_COMMAND
|
||||
if [[ $1 =~ config-* ]] || [[ $1 =~ docker-options* ]]; then
|
||||
@@ -104,6 +108,7 @@ case "$1" in
|
||||
DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG)
|
||||
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
[[ "$line" =~ ^#.* ]] && continue
|
||||
TRIM=${line%#*}
|
||||
PROC_TYPE=${TRIM%%=*}
|
||||
PROC_COUNT=${TRIM#*=}
|
||||
|
||||
@@ -9,7 +9,7 @@ if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
||||
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
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
@@ -20,7 +20,7 @@ start on filesystem and started docker
|
||||
|
||||
script
|
||||
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
|
||||
EOF
|
||||
;;
|
||||
@@ -34,11 +34,12 @@ After=docker.target
|
||||
[Service]
|
||||
Type=simple
|
||||
User=dokku
|
||||
ExecStart=/usr/local/bin/dokku ps:restartall
|
||||
ExecStart=/usr/local/bin/dokku ps:restore
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable dokku-redeploy
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/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
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||
|
||||
case "$1" in
|
||||
apps)
|
||||
@@ -10,14 +11,27 @@ case "$1" in
|
||||
;;
|
||||
|
||||
apps:create)
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -d "$DOKKU_ROOT/$2" ]] && dokku_log_fail "Name is already taken"
|
||||
APP="$2"
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$APP"
|
||||
echo "Creating $APP... done"
|
||||
apps_create $2
|
||||
;;
|
||||
|
||||
apps:rename)
|
||||
[[ -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 --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"
|
||||
dokku ps:rebuild $NEW_APP
|
||||
plugn trigger post-app-rename $OLD_APP $NEW_APP
|
||||
echo "Renaming $OLD_APP to $NEW_APP... done"
|
||||
;;
|
||||
|
||||
apps:destroy)
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ "$2" == "tls" ]] && dokku_log_fail "Unable to destroy tls directory"
|
||||
@@ -56,6 +70,7 @@ case "$1" in
|
||||
apps, List your apps
|
||||
apps:create <app>, Create a new app
|
||||
apps:destroy <app>, Permanently destroy an app
|
||||
apps:rename <old-app> <new-app>, Rename an app
|
||||
EOF
|
||||
;;
|
||||
|
||||
|
||||
13
plugins/apps/functions
Executable file
13
plugins/apps/functions
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/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"
|
||||
[[ -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
|
||||
}
|
||||
@@ -95,7 +95,7 @@ case "$1" in
|
||||
dokku_log_info1 "Installing certificate and key..."
|
||||
mv -f $TMP_WORK_DIR/server.key $TMP_WORK_DIR/server.crt $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)
|
||||
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"
|
||||
|
||||
@@ -85,7 +85,7 @@ if [[ ! -s "${TMPDIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]];
|
||||
exit 0
|
||||
fi
|
||||
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..."
|
||||
|
||||
rm -rf $TMPDIR
|
||||
|
||||
@@ -316,12 +316,23 @@ release_and_deploy() {
|
||||
IMAGE_SOURCE_TYPE="dockerfile"
|
||||
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 release "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG"
|
||||
dokku_log_info1 "Deploying $APP ($IMAGE)..."
|
||||
dokku deploy "$APP" "$IMAGE_TAG"
|
||||
dokku_log_info2 "Application deployed:"
|
||||
dokku urls $APP | sed "s/^/ /"
|
||||
|
||||
if [[ "$DOKKU_SKIP_DEPLOY" != "true" ]]; then
|
||||
dokku_log_info1 "Deploying $APP ($IMAGE)..."
|
||||
dokku deploy "$APP" "$IMAGE_TAG"
|
||||
dokku_log_info2 "Application deployed:"
|
||||
dokku urls $APP | sed "s/^/ /"
|
||||
else
|
||||
dokku_log_info1 "Skipping deployment"
|
||||
fi
|
||||
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
@@ -188,6 +187,7 @@ ${var}"
|
||||
config_styled_hash "$ENV_ADD" " "
|
||||
|
||||
config_write "$ENV_TEMP"
|
||||
plugn trigger post-config-update $APP "set" "$@"
|
||||
fi
|
||||
|
||||
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
|
||||
done
|
||||
|
||||
plugn trigger post-config-update $APP "unset" "$@"
|
||||
|
||||
if [[ "$DOKKU_CONFIG_RESTART" == "true" ]]; then
|
||||
dokku_log_info1 "Restarting app $APP"
|
||||
dokku ps:restart $APP
|
||||
|
||||
@@ -75,7 +75,7 @@ case "$1" in
|
||||
for DOMAIN in "$@"; do
|
||||
echo "$DOMAIN" >> "$DOKKU_ROOT/$APP/VHOST"
|
||||
done
|
||||
plugn trigger post-domains-update $APP
|
||||
plugn trigger post-domains-update $APP "add" "$@"
|
||||
for DOMAIN in "$@"; do
|
||||
dokku_log_info1 "Added $DOMAIN to $APP"
|
||||
done
|
||||
@@ -89,7 +89,7 @@ case "$1" in
|
||||
|
||||
rm -f "$DOKKU_ROOT/$APP/VHOST"
|
||||
dokku domains:setup $APP
|
||||
plugn trigger post-domains-update $APP
|
||||
plugn trigger post-domains-update $APP "clear"
|
||||
dokku_log_info1 "Cleared domains in $APP"
|
||||
|
||||
;;
|
||||
@@ -110,7 +110,7 @@ case "$1" in
|
||||
for DOMAIN in "$@"; do
|
||||
sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST"
|
||||
done
|
||||
plugn trigger post-domains-update $APP
|
||||
plugn trigger post-domains-update $APP "remove" "$@"
|
||||
for DOMAIN in "$@"; do
|
||||
dokku_log_info1 "Removed $DOMAIN from $APP"
|
||||
done
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||
|
||||
git_build_app_repo() {
|
||||
verify_app_name "$1"
|
||||
@@ -10,14 +11,24 @@ git_build_app_repo() {
|
||||
TMP_WORK_DIR=$(mktemp -d)
|
||||
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
|
||||
unset GIT_DIR GIT_WORK_TREE
|
||||
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 checkout "$REV" &> /dev/null
|
||||
git submodule update --init --recursive &> /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 --depth=1 &> /dev/null
|
||||
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
|
||||
find -name .git -prune -exec rm -rf {} \; > /dev/null
|
||||
|
||||
if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then
|
||||
|
||||
@@ -6,7 +6,7 @@ APP="$1"; APP_ROOT="$DOKKU_ROOT/$APP"
|
||||
for container in "$APP_ROOT"/CONTAINER.*; do
|
||||
DYNO=$(echo "$container" | sed -r 's/.*CONTAINER\.(.*)/\1/') || true
|
||||
NAME="$APP.$DYNO"
|
||||
PREVIOUS=$(docker ps -a -q -f name="$NAME\$") || true
|
||||
PREVIOUS=$(docker ps -a -q -f name="^.?$NAME\$") || true
|
||||
if [[ -n $PREVIOUS ]]; then
|
||||
docker rename "$NAME" "$NAME.$(date +%s)" > /dev/null
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,12 @@ case "$DOKKU_DISTRO" in
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
[[ -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
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
@@ -26,11 +26,11 @@ generate_scale_file() {
|
||||
echo "web=1" >> $DOKKU_SCALE_FILE
|
||||
else
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
[[ -z "$line" ]] && continue
|
||||
[[ "$line" =~ ^#.* ]] && continue
|
||||
NAME=${line%%:*}
|
||||
NUM_PROCS=0
|
||||
[[ "$NAME" == "web" ]] && NUM_PROCS=1
|
||||
echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE
|
||||
[[ -n "$NAME" ]] && echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE
|
||||
done < "$PROCFILE"
|
||||
fi
|
||||
dokku_log_info1_quiet "New DOKKU_SCALE file generated"
|
||||
|
||||
@@ -1,3 +1,52 @@
|
||||
###############################
|
||||
# DEVELOPMENT #
|
||||
###############################
|
||||
|
||||
# Procfile for development using the new threaded worker (scheduler, twitter stream and delayed job)
|
||||
cron: node worker.js
|
||||
web: node web.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
|
||||
|
||||
@@ -4,6 +4,7 @@ set -eo pipefail
|
||||
|
||||
MODE="$1"; MODE=${MODE:="testing"}
|
||||
|
||||
# shellcheck disable=SC2120
|
||||
setup_circle() {
|
||||
echo "=====> setup_circle on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
sudo -E CI=true make -e sshcommand
|
||||
@@ -21,36 +22,39 @@ setup_circle() {
|
||||
}
|
||||
|
||||
if [[ -n "$CIRCLE_NODE_INDEX" ]] && [[ "$MODE" == "setup" ]]; then
|
||||
case "$CIRCLE_NODE_INDEX" in
|
||||
3)
|
||||
setup_circle buildstack
|
||||
exit $?
|
||||
;;
|
||||
*)
|
||||
setup_circle
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
# shellcheck disable=SC2119
|
||||
setup_circle
|
||||
exit $?
|
||||
# case "$CIRCLE_NODE_INDEX" in
|
||||
# 3)
|
||||
# setup_circle buildstack
|
||||
# exit $?
|
||||
# ;;
|
||||
# *)
|
||||
# setup_circle
|
||||
# exit $?
|
||||
# ;;
|
||||
# esac
|
||||
fi
|
||||
|
||||
case "$CIRCLE_NODE_INDEX" in
|
||||
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
|
||||
;;
|
||||
|
||||
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
|
||||
;;
|
||||
|
||||
2)
|
||||
echo "=====> make deploy-tests (herokuish release) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
sudo -E make -e deploy-tests
|
||||
echo "=====> make unit-tests (3/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
sudo -E UNIT_TEST_BATCH=3 make -e unit-tests
|
||||
;;
|
||||
|
||||
3)
|
||||
echo "=====> make deploy-tests (herokuish master) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
sudo -E make -e deploy-tests
|
||||
echo "=====> make unit-tests (4/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
sudo -E UNIT_TEST_BATCH=4 make -e unit-tests
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -22,6 +22,6 @@ exec /usr/local/bin/gitreceived -p 2022 -n /root/.ssh/id_rsa /tmp/receiver
|
||||
EOF
|
||||
|
||||
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
|
||||
EOF
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
is_number() {
|
||||
local NUMBER=$1; local NUM_RE='^[0-9]+$'
|
||||
local NUMBER=$1; local NUM_RE='^[1-4]+$'
|
||||
if [[ $NUMBER =~ $NUM_RE ]]; then
|
||||
return 0
|
||||
else
|
||||
@@ -10,28 +10,13 @@ is_number() {
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 1|2"
|
||||
echo "usage: $0 1|2|3|4"
|
||||
exit 0
|
||||
}
|
||||
|
||||
BATCH_NUM="$1"
|
||||
is_number $BATCH_NUM || usage
|
||||
|
||||
TESTS=($(find "$(dirname $0)"/../unit -maxdepth 1 -name "*.bats"))
|
||||
HALF_TESTS=$(( ${#TESTS[@]} / 2 ))
|
||||
FIRST_HALF=("${TESTS[@]:0:${HALF_TESTS}}")
|
||||
LAST_HALF=("${TESTS[@]:${HALF_TESTS}:${#TESTS[@]}}")
|
||||
|
||||
case "$BATCH_NUM" in
|
||||
1)
|
||||
bats "${FIRST_HALF[@]}"
|
||||
;;
|
||||
|
||||
2)
|
||||
bats "${LAST_HALF[@]}"
|
||||
;;
|
||||
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
TESTS=$(find "$(dirname $0)"/../unit -maxdepth 1 -name "${BATCH_NUM}0*.bats" | sort -n | xargs)
|
||||
echo "running the following tests $TESTS"
|
||||
bats $TESTS
|
||||
|
||||
48
tests/unit/10_apps.bats
Normal file
48
tests/unit/10_apps.bats
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
@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
|
||||
}
|
||||
@@ -24,28 +24,28 @@ teardown() {
|
||||
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"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
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"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "certs:info" {
|
||||
@test "(certs) certs:info" {
|
||||
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:info $TEST_APP"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
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"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
70
tests/unit/10_core_1.bats
Normal file
70
tests/unit/10_core_1.bats
Normal 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
|
||||
}
|
||||
|
||||
@@ -3,14 +3,17 @@
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
[[ -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"
|
||||
[[ -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"
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
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" {
|
||||
91
tests/unit/20_core_1.bats
Normal file
91
tests/unit/20_core_1.bats
Normal 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]+
|
||||
}
|
||||
@@ -10,7 +10,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -21,7 +21,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -32,7 +32,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -43,7 +43,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -54,7 +54,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -73,7 +73,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -92,7 +92,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -111,7 +111,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -130,7 +130,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -150,7 +150,7 @@ teardown() {
|
||||
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"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -161,7 +161,7 @@ teardown() {
|
||||
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\""
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -23,73 +23,6 @@ check_urls() {
|
||||
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)" {
|
||||
create_app
|
||||
run dokku domains:add $TEST_APP www.test.app.dokku.me
|
||||
@@ -26,48 +26,6 @@ build_nginx_config() {
|
||||
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)" {
|
||||
deploy_app
|
||||
run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version"
|
||||
@@ -23,6 +23,11 @@ teardown() {
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "sudo -E -u nobody dokku plugin:uninstall $TEST_PLUGIN_NAME"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_failure
|
||||
|
||||
run bash -c "dokku plugin:disable $TEST_PLUGIN_NAME"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
@@ -43,3 +48,25 @@ teardown() {
|
||||
echo "status: "$status
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "(plugin) plugin:install, plugin:disable, plugin:uninstall as non-root user failure" {
|
||||
run bash -c "sudo -E -u nobody dokku plugin:install $TEST_PLUGIN_GIT_REPO"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_failure
|
||||
|
||||
run bash -c "dokku plugin:install $TEST_PLUGIN_GIT_REPO"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku plugin | grep enabled | grep $TEST_PLUGIN_NAME"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "sudo -E -u nobody dokku plugin:disable $TEST_PLUGIN_NAME"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_failure
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
@test "(apps) apps:destroy" {
|
||||
create_app
|
||||
run bash -c "dokku --force apps:destroy $TEST_APP"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
Reference in New Issue
Block a user