Compare commits

...

32 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
474ea3c9b3 Release 0.4.1 2015-09-28 21:50:40 -04:00
Jose Diaz-Gonzalez
781b8e9009 Merge pull request #1514 from progrium/mh-no-exit0-in-config-func
do not use exit 0 in config functions
2015-09-28 21:49:58 -04:00
Michael Hobbs
6b01da6dda fix CURL_TIMEOUT settings 2015-09-28 18:06:10 -07:00
Michael Hobbs
b49cceefd7 don't use exit 0 in config functions 2015-09-28 17:44:10 -07:00
Jose Diaz-Gonzalez
c941a64eba Merge pull request #1512 from Flink/colored-logs
Colorize logs
2015-09-28 11:33:36 -04:00
Loïc Guitaut
03dee47d69 Colorize logs
Move logs into a dedicated plugin.
2015-09-28 12:34:58 +02:00
Jose Diaz-Gonzalez
3ff11e0b9f Merge pull request #1504 from progrium/1503_mh-add-plugin-doc
change plugin install doc to show one-step method
2015-09-27 17:45:53 -04:00
Michael Hobbs
a79834739e [ci skip] change plugin install doc to show one-step method. closes #1503 2015-09-25 13:09:52 -07:00
Jose Diaz-Gonzalez
f8c9d9b823 Merge pull request #1502 from Cactusbone/patch-1
dokku-apt compatibility
2015-09-25 12:53:08 -04:00
Charly Koza
9ace6cfec5 dokku-apt compatibility 2015-09-25 12:18:43 +02:00
Jose Diaz-Gonzalez
9e0f8dc7d1 Merge pull request #1501 from progrium/josegonzalez-patch-1
Clarify bootstrap installation documentation
2015-09-24 12:30:15 -04:00
Jose Diaz-Gonzalez
7978aa9011 Clarify bootstrap installation documentation
We actually have the reverse situation where the bootstrap.sh uses the web installer by default.

[ci skip]
2015-09-24 12:25:15 -04:00
Jose Diaz-Gonzalez
be1dc623db Merge pull request #1500 from jazzzz/log-name
Log user name and fingerprint in events
2015-09-24 11:59:17 -04:00
Jazz
895b4d2c6a Log user name and fingerprint in events 2015-09-24 17:22:03 +02:00
Michael Hobbs
5e9c88ca63 Merge pull request #1496 from callahad/issue-1495
Don't prompt users when installing dokku package
2015-09-23 16:01:44 -07:00
Michael Hobbs
e345cb6b93 Merge pull request #1494 from callahad/issue-1493
Correctly install packages for DOKKU_TAG=v0.4.0
2015-09-23 15:59:48 -07:00
Dan Callahan
8f2db587f2 Don't prompt users when installing dokku package
Fixes #1495
2015-09-23 16:55:02 -05:00
Dan Callahan
80a2018c1f Correctly install packages for DOKKU_TAG=v0.4.0
Fixes #1493
2015-09-23 16:43:39 -05:00
Jose Diaz-Gonzalez
f25fabeae5 Merge pull request #1492 from progrium/josegonzalez-patch-1
Upgrade hostname plugin to 0.4.0+ compatibility
2015-09-23 13:52:11 -04:00
Jose Diaz-Gonzalez
a8be09a866 Upgrade hostname plugin to 0.4.0+ compatibility
[ci skip]
2015-09-23 13:52:06 -04:00
Jose Diaz-Gonzalez
616c3a6c50 Merge pull request #1491 from progrium/josegonzalez-patch-1
Promote plugins to official status
2015-09-23 13:43:43 -04:00
Jose Diaz-Gonzalez
b43422f544 Promote plugins to official status
[ci skip]
2015-09-23 13:43:38 -04:00
Jose Diaz-Gonzalez
dce98529d3 Merge pull request #1488 from progrium/josegonzalez-patch-1
Update plugins list
2015-09-23 00:52:18 -04:00
Jose Diaz-Gonzalez
ec893fe330 Reorder plugins
[ci skip]
2015-09-23 00:51:04 -04:00
Jose Diaz-Gonzalez
c7820c0cf2 Update plugins for @heichblatt
[ci skip]
2015-09-23 00:01:13 -04:00
Jose Diaz-Gonzalez
d11b976de3 Deprecate dokku-link plugin
Users would be better suited to use the official `docker-options` plugin.

[ci skip]
2015-09-22 23:34:34 -04:00
Jose Diaz-Gonzalez
fa033a2589 Move app-url to unmaintained
Also update compatibility on pre-deploy-tasks plugin.

[ci skip]
2015-09-22 23:32:44 -04:00
Jose Diaz-Gonzalez
02d63b9d8d Update compatibility to 0.4.0 on plugins by Flink
[ci skip]
2015-09-22 23:26:36 -04:00
Jose Diaz-Gonzalez
1aee4fdde8 Merge pull request #1482 from Flink/lg-strip-dokku-part-plugin
Strip the `dokku-` part from plugins on install
2015-09-22 23:00:35 -04:00
Jose Diaz-Gonzalez
92ec4462be Merge pull request #1485 from matto1990/patch-1
Update Slack plugin compatability
2015-09-22 19:46:55 -04:00
Matt Oakes
2282b48ff1 Update Slack plugin compatability
The Slack plugin now supports 0.4.0+ thanks to a pull request from @Flink. This is a small update to the docs to reflect this.
2015-09-22 23:46:25 +01:00
Loïc Guitaut
9b9e983d2c Strip the dokku- part from plugins on install 2015-09-22 15:45:49 +02:00
17 changed files with 191 additions and 81 deletions

View File

@@ -1,5 +1,29 @@
# History
## 0.4.1
### Bug Fixes
- #1494: @callahad Correctly install packages for DOKKU_TAG=v0.4.0
- #1496: @callahad Don't prompt users when installing dokku package
- #1514: @michaelshobbs Do not use exit 0 in config functions and fix CURL environment variable setting
### New Features
- #1482: @Flink Strip the `dokku-` part from plugins on install
- #1500: @jazzzz Log user name and fingerprint in events
- #1512: @Flink Colorize output from logs
### Documentation
- #1485: @matto1990 Update Slack plugin compatability
- #1488: @josegonzalez Update plugins list with compatibility changes
- #1491: @josegonzalez Promote [maintenance](https://github.com/dokku/dokku-maintenance) and [http basic auth](https://github.com/dokku/dokku-http-auth) plugins to official status
- #1492: @josegonzalez Upgrade hostname plugin to 0.4.0+ compatibility
- #1501: @josegonzalez Clarify bootstrap installation documentation
- #1502: @josegonzalez Update dokku-apt compatibility
- #1504: @michaelshobbs Change plugin install doc to show one-step method
## 0.4.0
This is our first minor release in almost a year. Many new features and removals have occurred, so here is a neat summary:

View File

@@ -10,8 +10,8 @@ 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.github.com/progrium/dokku/v0.4.0/bootstrap.sh
sudo DOKKU_TAG=v0.4.0 bash bootstrap.sh
wget https://raw.github.com/progrium/dokku/v0.4.1/bootstrap.sh
sudo DOKKU_TAG=v0.4.1 bash bootstrap.sh
### Upgrading

View File

@@ -55,9 +55,9 @@ dokku_install_package() {
apt-get update -qq > /dev/null
if [[ -n $DOKKU_CHECKOUT ]]; then
apt-get install dokku=$DOKKU_CHECKOUT
apt-get install -y dokku=$DOKKU_CHECKOUT
else
apt-get install dokku
apt-get install -y dokku
fi
}
@@ -71,16 +71,16 @@ elif [[ -n $DOKKU_TAG ]]; then
patch=$(echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[3]}')
# 0.3.13 was the first version with a debian package
if [[ "$major" -eq "0" ]] && [[ "$minor" -ge "3" ]] && [[ "$patch" -ge "13" ]]; then
if [[ "$major" -eq "0" ]] && [[ "$minor" -eq "3" ]] && [[ "$patch" -ge "13" ]]; then
export DOKKU_CHECKOUT="$DOKKU_SEMVER"
dokku_install_package
echo "--> Running post-install dependency installation"
# 0.4.0 implemented a `plugin` plugin
if [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then
dokku plugin:install-dependencies --core
else
dokku plugins-install-dependencies
fi
dokku plugins-install-dependencies
# 0.4.0 implemented a `plugin` plugin
elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then
export DOKKU_CHECKOUT="$DOKKU_SEMVER"
dokku_install_package
dokku plugin:install-dependencies --core
else
export DOKKU_CHECKOUT="$DOKKU_TAG"
dokku_install_source

View File

@@ -21,7 +21,7 @@ if ARGV[0] == "onboot"
exit
end
version = "v0.4.0"
version = "v0.4.1"
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
admin_keys = `cat /root/.ssh/authorized_keys`.split("\n")
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip

View File

@@ -64,12 +64,12 @@
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">wget https://raw.github.com/progrium/dokku/v0.4.0/bootstrap.sh</span>
<span class="command">wget https://raw.github.com/progrium/dokku/v0.4.1/bootstrap.sh</span>
</p>
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.4.0 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.4.1 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span>

View File

@@ -15,12 +15,12 @@
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">wget https://raw.github.com/progrium/dokku/v0.4.0/bootstrap.sh</span>
<span class="command">wget https://raw.github.com/progrium/dokku/v0.4.1/bootstrap.sh</span>
</p>
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.4.0 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.4.1 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span>

View File

@@ -14,11 +14,11 @@ To install the latest stable version of dokku, you can run the following bootstr
```shell
# installs dokku via apt-get
wget https://raw.github.com/progrium/dokku/v0.4.0/bootstrap.sh
sudo DOKKU_TAG=v0.4.0 bash bootstrap.sh
wget https://raw.github.com/progrium/dokku/v0.4.1/bootstrap.sh
sudo DOKKU_TAG=v0.4.1 bash bootstrap.sh
# By default, this will do cli-based setup, though you may *also*
# go to your server's IP and follow the web installer
# By default, this will start the web-based installer on your server's IP
# You may *instead* follow the debian packaging notes for a more automated installation
```
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:

View File

@@ -13,10 +13,17 @@ Let's take a quick look at the current dokku nginx plugin that's shipped with do
## Installing a plugin
```shell
cd /var/lib/dokku/plugins/available
# This command requires `root` permissions as the `install` and `install-dependencies`
# plugin triggers may utilize commands such as `apt-get`. For non-core plugins, please
# inspect those plugins before running the following command as `root` user.
sudo plugin:install <git_url>
# previous versions (0.3.x and below) of dokku require a manual process to install plugins
cd /var/lib/dokku/plugins
git clone <git url>
dokku plugin:install
dokku plugins-install
```
## Creating your own plugin
[See the full documentation](http://progrium.viewdocs.io/dokku/development/plugin-creation).
@@ -36,6 +43,8 @@ The following plugins are available and provided by dokku maintainers. Where not
| [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+ |
| [RethinkDB (beta)](https://github.com/dokku/dokku-rethinkdb-plugin) | [dokku][] | 0.4.0+ |
| [Maintenance mode (beta)](https://github.com/dokku/dokku-maintenance) | [dokku][] | 0.4.0+ |
| [HTTP Auth (beta)](https://github.com/dokku/dokku-http-auth) | [dokku][] | 0.4.0+ |
## Community plugins
@@ -122,7 +131,7 @@ Note: The following plugins have been supplied by our community and may not have
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [Memcached](https://github.com/Flink/dokku-memcached-plugin) | [Flink][] | 0.3.26+. Sets a MEMCACHE_SERVERS environment variable|
| [Memcached](https://github.com/Flink/dokku-memcached-plugin) | [Flink][] | 0.4.0+ |
| [Redis](https://github.com/luxifer/dokku-redis-plugin) | [luxifer][] | |
| [Redis](https://github.com/sekjun9878/dokku-redis-plugin) | [sekjun9878][] | 0.3.26+. A better Redis plugin with automatic instance creation and Dokku Link support
| [Redis (single container)](https://github.com/ohardy/dokku-redis) | [ohardy][] | Compatible with 0.2.0 |
@@ -156,7 +165,7 @@ Note: The following plugins have been supplied by our community and may not have
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [Circus](https://github.com/apmorton/dokku-circus) | [apmorton][] | |
| [Forego](https://github.com/iskandar/dokku-forego) | [iskandar][] | Compatible with 0.2.x |
| [Forego](https://github.com/Flink/dokku-forego) | [Flink][] | 0.3.26+ |
| [Forego](https://github.com/Flink/dokku-forego) | [Flink][] | 0.4.0++ |
| [Logging Supervisord](https://github.com/sehrope/dokku-logging-supervisord) | [sehrope][] | Works with dokku @ [c77cbf1][] - no 0.2.0 compatibility |
| [Monit](https://github.com/cjblomqvist/dokku-monit) | [cjblomqvist][] | |
| [Shoreman ](https://github.com/statianzo/dokku-shoreman) | [statianzo][] | Compatible with 0.2.0 |
@@ -169,25 +178,23 @@ Note: The following plugins have been supplied by our community and may not have
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh][] | Works with 0.2.0 |
| [Docker Direct](https://github.com/heichblatt/dokku-docker-direct) | [heichblatt][] | |
| [Dokku Copy App Config Files](https://github.com/alexkruegger/dokku-app-configfiles) | [alexkruegger][] | Compatible with 0.3.17+ |
| [Dokku Copy App Config Files](https://github.com/heichblatt/dokku-supply-config) | [heichblatt][] | |
| [Dokku Name](https://github.com/alex-sherwin/dokku-name) | [alex-sherwin][] | dokku >= [c77cbf1][] |
| [Dokku Registry](https://github.com/agco-adm/dokku-registry)<sup>1</sup> | [agco-adm][] | |
| [git rev-parse HEAD in env](https://github.com/cjblomqvist/dokku-git-rev) | [cjblomqvist][] | Compatible with 0.3.0 |
| [Graduate (Environment Management)](https://github.com/glassechidna/dokku-graduate) | [Benjamin-Dobell][] | dokku >= v0.3.14 |
| [HTTP Auth](https://github.com/Flink/dokku-http-auth) | [Flink][] | 0.3.26+ |
| [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | Works with v0.2.3 |
| [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | |
| [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | dokku >= [c77cbf1][] |
| [Maintenance mode](https://github.com/Flink/dokku-maintenance) | [Flink][] | 0.3.26+ |
| [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | 0.4.0+ |
| [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | |
| [Named-containers](https://github.com/Flink/dokku-named-containers) | [Flink][] | 0.3.26+ |
| [Ports](https://github.com/heichblatt/dokku-ports) | [heichblatt][] | |
| [Pre-Deploy Tasks](https://github.com/michaelshobbs/dokku-app-predeploy-tasks) | [michaelshobbs][] | |
| [Named-containers](https://github.com/Flink/dokku-named-containers) | [Flink][] | 0.4.0+ |
| [Nuke Containers](https://github.com/heichblatt/dokku-nuke) | [heichblatt][] | |
| [Open App Ports](https://github.com/heichblatt/dokku-ports) | [heichblatt][] | |
| [Pre-Deploy Tasks](https://github.com/michaelshobbs/dokku-app-predeploy-tasks) | [michaelshobbs][] | 0.4.0+ |
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>2</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
| [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | Compatible with 0.2.0 |
| [App Configfiles](https://github.com/alexkruegger/dokku-app-configfiles) | [alexkruegger][] | Compatible with 0.3.17+ |
[217d00a]: https://github.com/progrium/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
@@ -201,21 +208,21 @@ Note: The following plugins have been supplied by our community and may not have
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [Airbrake deploy](https://github.com/Flink/dokku-airbrake-deploy) | [Flink][] | 0.3.26+ |
| [APT](https://github.com/F4-Group/dokku-apt) | [F4-Group][] | |
| [Airbrake deploy](https://github.com/Flink/dokku-airbrake-deploy) | [Flink][] | 0.4.0+ |
| [APT](https://github.com/F4-Group/dokku-apt) | [F4-Group][] | 0.2.0+ (tag 0.2.0), 0.3.0+ (tag 0.3.0), 0.4.0+ |
| [Chef cookbooks](https://github.com/fgrehm/chef-dokku) | [fgrehm][] | |
| [Bower install](https://github.com/alexanderbeletsky/dokku-bower-install) | [alexanderbeletsky][] | |
| [Bower/Grunt](https://github.com/thrashr888/dokku-bower-grunt-build-plugin) | [thrashr888][] | |
| [Bower/Gulp](https://github.com/gdi2290/dokku-bower-gulp-build-plugin) | [gdi2290][] | |
| [Bower/Gulp](https://github.com/jagandecapri/dokku-bower-gulp-build-plugin) | [jagandecapri][] | |
| [Docker auto volumes](https://github.com/Flink/dokku-docker-auto-volumes) | [Flink][] | 0.3.26+, auto-persist docker volumes |
| [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][] | |
| [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][] | |
| [Reset mtime](https://github.com/mixxorz/dokku-docker-reset-mtime) | [mixxorz][] | 0.3.15+, Dockerfile support |
| [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.3.26+ |
| [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ |
| [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Łebkowski][] | |
| [Webhooks](https://github.com/nickstenning/dokku-webhooks) | [nickstenning][] | |
| [Wordpress](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | Dokku dev, mariadb, volume, domains |
@@ -229,22 +236,32 @@ The following plugins have been removed as their functionality is now in Dokku C
| Plugin | Author | In Dokku Since |
| ------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------- |
| [Custom Domains](https://github.com/neam/dokku-custom-domains) | [motin][] | v0.3.10 (domains plugin) |
| [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | v0.3.9 (trace command) |
| [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | v0.3.9 (trace command) |
| [Docker Options](https://github.com/dyson/dokku-docker-options) | [dyson][] | v0.3.17 (docker-options plugin) |
| [Events Logger](https://github.com/alessio/dokku-events) | [alessio][] | v0.3.21 (events plugin) |
| [Host Port binding](https://github.com/stuartpb/dokku-bind-port) | [stuartpb][] | v0.3.17 (docker-options plugin) |
| [List Containers](https://github.com/heichblatt/dokku-list) | [heichblatt][] | v0.3.14 (ps plugin |
| [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | v0.3.17 (docker-options plugin) |
| [Multiple Domains](https://github.com/wmluke/dokku-domains-plugin)<sup>1</sup> | [wmluke][] | v0.3.10 (domains plugin) |
| [Nginx-Alt](https://github.com/mikexstudios/dokku-nginx-alt) | [mikexstudios][] | v0.3.10 (domains plugin) |
| [Persistent Storage](https://github.com/dyson/dokku-persistent-storage) | [dyson][] | v0.3.17 (docker-options plugin) |
| [PrimeCache](https://github.com/darkpixel/dokku-prime-cache) | [darkpixel][] | v0.3.0 (zero downtime deploys) |
| [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | v0.3.14 (ps plugin) |
| [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | v0.3.14 (ps plugin) |
| [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env)<sup>2</sup> | [cameron-martin][] | v0.3.9 (build-env plugin) |
| [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)<sup>2</sup> | [musicglue][] | v0.3.9 (build-env plugin) |
| [user-env-compile](https://github.com/motin/dokku-user-env-compile)<sup>2</sup> | [motin][] | v0.3.9 (build-env plugin) |
| [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) | [motin][] | v0.3.10 (domains plugin) |
<sup>1</sup> Conflicts with [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration)
<sup>2</sup> Similar to the heroku-labs feature (see https://devcenter.heroku.com/articles/labs-user-env-compile)
[a043e98]: https://github.com/stuartpb/dokku-bind-port/commit/a043e9892f4815b6525c850131e09fd64db5c1fa
### Unmaintained Plugins
The following plugins are no longer maintained by their developers.
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh][] | Works with 0.2.0 |

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ " build release trace delete ls logs run url urls version help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
[[ " build release trace delete ls run url urls version 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/config/functions"
@@ -126,32 +126,6 @@ case "$1" in
done
;;
logs)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; verify_app_name "$2"
if (is_deployed $APP); then
CONTAINER_IDS=( $(get_app_container_ids $APP) )
LAST_CONTAINER_ID=${CONTAINER_IDS[${#CONTAINER_IDS[@]} - 1]}
if [[ $3 == "-t" ]]; then
DOKKU_LOGS_ARGS="--follow --tail 100"
else
DOKKU_LOGS_ARGS="--tail 100"
fi
for CID in "${CONTAINER_IDS[@]}"; do
if [[ "$CID" != "$LAST_CONTAINER_ID" ]]; then
DOKKU_LOGS_CMD+="docker logs $DOKKU_LOGS_ARGS $CID& "
else
DOKKU_LOGS_CMD+="docker logs $DOKKU_LOGS_ARGS $CID; "
fi
done
bash -c "($DOKKU_LOGS_CMD)"
else
echo "Application's container not found"
fi
;;
run)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; IMAGE_TAG=$(get_running_image_tag $APP); IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
@@ -217,7 +191,6 @@ case "$1" in
help)
cat<<EOF
ls, Pretty listing of deployed applications and containers
logs <app> [-t], Show the last logs for an application (-t follows)
run <app> <cmd>, Run a command in the environment of an application
url <app>, Show the first URL for an application (compatibility)
urls <app>, Show all URLs for an application

View File

@@ -6,8 +6,8 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
APP="$1"; IMAGE=$(get_app_image_name $APP); BUILD_ENV=""
verify_app_name "$APP"
config_get --global CURL_CONNECT_TIMEOUT > /dev/null 2>&1 || config_set --global CURL_CONNECT_TIMEOUT=5
config_get --global CURL_TIMEOUT > /dev/null 2>&1 || config_set --global CURL_TIMEOUT=30
[[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=5
[[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=30
if [[ -n $(config_export global) ]]; then
BUILD_ENV+=$'\n'

View File

@@ -98,7 +98,7 @@ dokku_log_plugn_trigger_call() {
local l_hook
l_hook="$1" ; shift
dokku_log_event "INVOKED: ${l_hook}( $@ )"
dokku_log_event "INVOKED: ${l_hook}( $@ ) NAME=$NAME FINGERPRINT=$FINGERPRINT"
}
dokku_container_log_verbose_quiet() {

View File

@@ -102,7 +102,7 @@ config_all() {
[[ "$1" == "config" ]] || set -- "config" "$@"
config_parse_args "$@"
config_create "$ENV_FILE"
is_config_export "$@" && config_export "$DOKKU_CONFIG_TYPE" "$APP" && exit 0
is_config_export "$@" && config_export "$DOKKU_CONFIG_TYPE" "$APP" && return 0
[[ "$APP" ]] && DOKKU_CONFIG_TYPE=$APP
[[ ! -s $ENV_FILE ]] && dokku_log_fail "no config vars for $DOKKU_CONFIG_TYPE"
@@ -112,7 +112,7 @@ config_all() {
for var in "$@"; do
if [[ "$var" == "--shell" ]]; then
echo $VARS
exit 0
return 0
fi
done
@@ -132,7 +132,7 @@ config_get() {
config_create "$ENV_FILE"
if [[ ! -s $ENV_FILE ]]; then
exit 0
return 0
fi
KEY="$3"

49
plugins/logs/commands Executable file
View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
case "$1" in
logs)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; verify_app_name "$2"
APP_ROOT="$DOKKU_ROOT/$APP"
COLORS=(36 33 32 35 31)
if (is_deployed "$APP"); then
CONTAINERS=("$APP_ROOT"/CONTAINER.*)
if [[ $3 == "-t" ]]; then
DOKKU_LOGS_ARGS="--follow --tail 100"
else
DOKKU_LOGS_ARGS="--tail 100"
fi
((MAX_INDEX=${#CONTAINERS[*]} - 1)) || true
for i in ${!CONTAINERS[*]}; do
DYNO=$(echo "${CONTAINERS[i]}" | sed -r 's/.*CONTAINER\.(.*)/\1/')
CID=$(< "${CONTAINERS[i]}")
COLOR=${COLORS[i % ${#COLORS[*]}]}
DOKKU_LOGS_CMD+="(docker logs -t $DOKKU_LOGS_ARGS $CID 2>&1 | sed -r 's/^([^Z]+Z )/\x1b[${COLOR}m\1$APP[$DYNO]:\x1b[0m /gm')"
if [[ $i != "$MAX_INDEX" ]]; then
DOKKU_LOGS_CMD+="& "
else
DOKKU_LOGS_CMD+="; "
fi
done
bash -c "($DOKKU_LOGS_CMD)"
else
echo "Application's container not found"
fi
;;
help)
cat<<EOF
logs <app> [-t], Show the last logs for an application (-t follows)
EOF
;;
*)
exit $DOKKU_NOT_IMPLEMENTED_EXIT
;;
esac

4
plugins/logs/plugin.toml Normal file
View File

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

View File

@@ -17,7 +17,7 @@ case "$1" in
;;
https:*|git:*)
PLUGIN_GIT_URL="$2"
download_and_enable_plugin $PLUGIN_GIT_URL
download_and_enable_plugin "$PLUGIN_GIT_URL" "$3"
plugn trigger install
;;
*)
@@ -37,7 +37,7 @@ case "$1" in
case "$2" in
https:*|git:*)
PLUGIN_GIT_URL="$2"
download_and_enable_plugin $PLUGIN_GIT_URL
download_and_enable_plugin "$PLUGIN_GIT_URL" "$3"
plugn trigger update
;;
*)

View File

@@ -21,15 +21,17 @@ enable_plugin() {
download_plugin() {
local PLUGIN_GIT_URL="$1"
plugn install $PLUGIN_GIT_URL
local PLUGIN_NAME="$2"
plugn install "$PLUGIN_GIT_URL" "$PLUGIN_NAME"
}
download_and_enable_plugin() {
local PLUGIN_GIT_URL="$1"
local PLUGIN_NAME=$(echo $PLUGIN_GIT_URL | awk -F '/' '{ print $NF }' | sed -e "s:.git::g")
local CUSTOM_NAME="$2"
local PLUGIN_NAME=${CUSTOM_NAME:-$(plugin_name "$PLUGIN_GIT_URL")}
dokku_log_info1_quiet "Cloning plugin repo $PLUGIN_GIT_URL to $PLUGIN_AVAILABLE_PATH/$PLUGIN_NAME"
download_plugin $PLUGIN_GIT_URL
enable_plugin $PLUGIN_NAME
download_plugin "$PLUGIN_GIT_URL" "$PLUGIN_NAME"
enable_plugin "$PLUGIN_NAME"
}
uninstall_plugin() {
@@ -39,3 +41,8 @@ uninstall_plugin() {
plugn uninstall $PLUGIN_NAME
dokku_log_info1_quiet "Plugin $PLUGIN uninstalled"
}
plugin_name() {
local PLUGIN_GIT_URL="$1"
echo "$PLUGIN_GIT_URL" | awk -F '/' '{ print $NF }' | sed -e "s:.git::g" | sed 's:^dokku-::'
}

View File

@@ -11,11 +11,47 @@ teardown() {
}
@test "(build-env) special characters" {
run dokku config:set $TEST_APP NEWRELIC_APP_NAME="$TEST_APP (Staging)"
run dokku config:set --no-restart $TEST_APP NEWRELIC_APP_NAME="$TEST_APP (Staging)"
echo "output: "$output
echo "status: "$status
assert_success
deploy_app
run dokku config $TEST_APP
assert_success
}
@test "(build-env) default curl timeouts" {
run dokku config:unset --global CURL_CONNECT_TIMEOUT
echo "output: "$output
echo "status: "$status
assert_success
run dokku config:unset --global CURL_TIMEOUT
echo "output: "$output
echo "status: "$status
assert_success
deploy_app
run /bin/bash -c "dokku config:get --global CURL_CONNECT_TIMEOUT | grep 5"
echo "output: "$output
echo "status: "$status
assert_success
run /bin/bash -c "dokku config:get --global CURL_TIMEOUT | grep 30"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(build-env) buildpack failure" {
run dokku config:set --no-restart $TEST_APP BUILDPACK_URL='https://github.com/dokku/fake-buildpack'
echo "output: "$output
echo "status: "$status
assert_success
run deploy_app
echo "output: "$output
echo "status: "$status
assert_failure
}