Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1bbc1ec4d | ||
|
|
793f1b6058 | ||
|
|
20977fc2a2 | ||
|
|
6cad7ef8f4 | ||
|
|
c6f80bcf55 | ||
|
|
4d8c7033a9 | ||
|
|
d2547c4233 | ||
|
|
4fa567dbe3 | ||
|
|
d307a5b8ec | ||
|
|
fd0bafa7d9 | ||
|
|
09df79cd8b | ||
|
|
9c0667c51a |
19
HISTORY.md
19
HISTORY.md
@@ -1,5 +1,24 @@
|
||||
# History
|
||||
|
||||
## 0.3.5
|
||||
|
||||
- #784: @josegonzalez Fix NO_VHOST check
|
||||
|
||||
## 0.3.4
|
||||
|
||||
- #780: @josegonzalez Output error message when a command is not found. Closes #778
|
||||
- #781: @michaelhobbs use DOKKU_IMAGE (i.e. progrium/buildstep)
|
||||
|
||||
## 0.3.3
|
||||
|
||||
- #659: @Xe contrib: add dokku client shell script
|
||||
- #669 @ohardy Handle dokku plugins-update command
|
||||
- #722: @wrboyce Add `git pull` support with git-pre-pull and git-post-pull hooks
|
||||
- #751: @tboerger Partial openSUSE support
|
||||
- #776: @joliv Update man page for new commands
|
||||
- #777: @tboerger Use PLUGINS_PATH env var and persist environment when running dokku with sudo
|
||||
- #779: @josegonzalez Minor bash formatting changes
|
||||
|
||||
## 0.3.2
|
||||
|
||||
- #675: @michaelhobbs port wait-to-retire from broadly/dokku
|
||||
|
||||
@@ -10,7 +10,7 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
|
||||
|
||||
To install the latest stable version of dokku, you can run the following bootstrapper command:
|
||||
|
||||
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.2/bootstrap.sh | sudo DOKKU_TAG=v0.3.2 bash
|
||||
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.5/bootstrap.sh | sudo DOKKU_TAG=v0.3.5 bash
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ if ARGV[0] == "onboot"
|
||||
exit
|
||||
end
|
||||
|
||||
version = "v0.3.2"
|
||||
version = "v0.3.5"
|
||||
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
|
||||
admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first
|
||||
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip
|
||||
|
||||
@@ -11,7 +11,7 @@ Ubuntu 14.04 x64 x64. Ideally have a domain ready to point to your host. It's de
|
||||
To install the latest stable version of dokku, you can run the following bootstrapper command:
|
||||
|
||||
```bash
|
||||
wget -qO- https://raw.github.com/progrium/dokku/v0.3.2/bootstrap.sh | sudo DOKKU_TAG=v0.3.2 bash
|
||||
wget -qO- https://raw.github.com/progrium/dokku/v0.3.5/bootstrap.sh | sudo DOKKU_TAG=v0.3.5 bash
|
||||
```
|
||||
|
||||
## Configuring
|
||||
|
||||
@@ -28,6 +28,49 @@ If you create your own plugin:
|
||||
3. edit this page and add a link to it below!
|
||||
4. subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases
|
||||
|
||||
### Sample plugin
|
||||
|
||||
The below plugin is a dummy `dokku hello` plugin. If your plugin exposes commands, this is a good template for your `commands` file:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
case "$1" in
|
||||
hello)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$APP" ]] && echo "App $APP does not exist" && exit 1
|
||||
APP="$2";
|
||||
|
||||
echo "Hello $APP"
|
||||
;;
|
||||
|
||||
hello:world)
|
||||
echo "Hello world"
|
||||
;;
|
||||
|
||||
help)
|
||||
cat && cat<<EOF
|
||||
hello <app> Says "Hello <app>"
|
||||
hello:world Says "Hello world"
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
```
|
||||
|
||||
A few notes:
|
||||
|
||||
- You should always support `DOKKU_TRACE` as specified on the 2nd line of the plugin.
|
||||
- If your command requires that an application exists, ensure you check for it's existence in the manner prescribed above.
|
||||
- A `help` command is required, though it is allowed to be empty.
|
||||
- Commands *should* be namespaced.
|
||||
- As of 0.3.3, a catch-all should be implemented which exits with a `DOKKU_NOT_IMPLEMENTED_EXIT` code. This allows dokku to output a `command not found` message.
|
||||
|
||||
## Community plugins
|
||||
|
||||
Note: The following plugins have been supplied by our community and may not have been tested by dokku maintainers.
|
||||
|
||||
24
dokku
24
dokku
@@ -6,6 +6,8 @@ export DOKKU_IMAGE=${DOKKU_IMAGE:="progrium/buildstep"}
|
||||
export DOKKU_ROOT=${DOKKU_ROOT:="/home/dokku"}
|
||||
|
||||
export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
|
||||
export DOKKU_NOT_IMPLEMENTED_EXIT=10
|
||||
export DOKKU_VALID_EXIT=0
|
||||
|
||||
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
|
||||
|
||||
@@ -40,7 +42,7 @@ case "$1" in
|
||||
|
||||
build)
|
||||
APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||
id=$(cat | docker run -i -a stdin $DOKKU_DISTRO /bin/bash -c "mkdir -p /app && tar -xC /app")
|
||||
id=$(cat | docker run -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app")
|
||||
test $(docker wait $id) -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
|
||||
@@ -147,6 +149,9 @@ case "$1" in
|
||||
;;
|
||||
|
||||
help|'')
|
||||
echo "Usage: dokku COMMAND <app> [command-specific-options]"
|
||||
echo ""
|
||||
|
||||
cat<<EOF | pluginhook commands help | sort
|
||||
help Print the list of commands
|
||||
plugins Print active plugins
|
||||
@@ -156,9 +161,24 @@ EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
implemented=0
|
||||
for script in $(ls -d $PLUGIN_PATH/*/commands); do
|
||||
$script "$@"
|
||||
set +e; $script "$@" ; exit_code=$? ; set -e
|
||||
if [ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
implemented=1
|
||||
if [ "$exit_code" -ne "$DOKKU_VALID_EXIT" ]; then
|
||||
exit $exit_code
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$implemented" -eq 0 ]; then
|
||||
echo " ! \`$@\` is not a dokku command."
|
||||
echo " ! See \`dokku help\` for a list of available commands."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -73,4 +73,8 @@ case "$1" in
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -72,4 +72,8 @@ case "$1" in
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -92,4 +92,8 @@ case "$1" in
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -184,4 +184,8 @@ ${var}"
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -65,4 +65,8 @@ EOF
|
||||
cat
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -41,4 +41,8 @@ case "$1" in
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -9,11 +9,11 @@ set +e
|
||||
NO_VHOST=$(dokku config:get $APP NO_VHOST)
|
||||
set -e
|
||||
|
||||
if [[ -z "$NO_VHOST" ]]; then
|
||||
if [[ -n "$NO_VHOST" ]]; then
|
||||
echo "-----> NO_VHOST config detected"
|
||||
fi
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/VHOST" && ! -z "$NO_VHOST" ]]; then
|
||||
if [[ -f "$DOKKU_ROOT/VHOST" && ! -n "$NO_VHOST" ]]; then
|
||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||
|
||||
Reference in New Issue
Block a user