Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58ca13e838 | ||
|
|
7c2f21fd2a | ||
|
|
887637fb6b | ||
|
|
c706344a94 | ||
|
|
a1bbc1ec4d | ||
|
|
793f1b6058 | ||
|
|
20977fc2a2 | ||
|
|
6cad7ef8f4 | ||
|
|
407436b4cc | ||
|
|
04dbe31919 | ||
|
|
56185fc1c2 | ||
|
|
303bd77226 | ||
|
|
c6e39c08f0 | ||
|
|
12194e2cc8 | ||
|
|
a3b3a6a12a | ||
|
|
c6f80bcf55 | ||
|
|
4d8c7033a9 | ||
|
|
d2547c4233 | ||
|
|
4fa567dbe3 | ||
|
|
463f725872 | ||
|
|
aa1c7f6fa4 | ||
|
|
5f6f73ff22 | ||
|
|
ad497191df | ||
|
|
53c58ec8b9 | ||
|
|
9eab9ed1e1 | ||
|
|
3faa37b2e1 | ||
|
|
fd55e8d41b | ||
|
|
303bc18265 | ||
|
|
2141435ce1 | ||
|
|
03e5248256 | ||
|
|
d307a5b8ec | ||
|
|
1e5a904747 | ||
|
|
a46582225a | ||
|
|
8bc3d372ec | ||
|
|
14b1743c2a | ||
|
|
2d776292c3 | ||
|
|
f0fe32a9c6 | ||
|
|
c4f5b3e219 | ||
|
|
fd0bafa7d9 | ||
|
|
09df79cd8b | ||
|
|
9c0667c51a | ||
|
|
939a876348 |
24
HISTORY.md
24
HISTORY.md
@@ -1,5 +1,29 @@
|
|||||||
# History
|
# History
|
||||||
|
|
||||||
|
## 0.3.6
|
||||||
|
|
||||||
|
- #782: @josegonzalez Simplified config checking
|
||||||
|
- #785: @lsde fix missing semicolon in nginx config
|
||||||
|
|
||||||
|
## 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
|
## 0.3.2
|
||||||
|
|
||||||
- #675: @michaelhobbs port wait-to-retire from broadly/dokku
|
- #675: @michaelhobbs port wait-to-retire from broadly/dokku
|
||||||
|
|||||||
11
Makefile
11
Makefile
@@ -5,6 +5,7 @@ PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_
|
|||||||
STACK_URL ?= https://github.com/progrium/buildstep.git
|
STACK_URL ?= https://github.com/progrium/buildstep.git
|
||||||
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz
|
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz
|
||||||
DOKKU_ROOT ?= /home/dokku
|
DOKKU_ROOT ?= /home/dokku
|
||||||
|
PLUGINS_PATH ?= /var/lib/dokku/plugins
|
||||||
|
|
||||||
# If the first argument is "vagrant-dokku"...
|
# If the first argument is "vagrant-dokku"...
|
||||||
ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS)))
|
ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS)))
|
||||||
@@ -23,12 +24,12 @@ install: dependencies stack copyfiles plugin-dependencies plugins version
|
|||||||
|
|
||||||
copyfiles: addman
|
copyfiles: addman
|
||||||
cp dokku /usr/local/bin/dokku
|
cp dokku /usr/local/bin/dokku
|
||||||
mkdir -p /var/lib/dokku/plugins
|
mkdir -p ${PLUGINS_PATH}
|
||||||
find /var/lib/dokku/plugins -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf
|
find ${PLUGINS_PATH} -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf
|
||||||
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \
|
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \
|
||||||
rm -Rf /var/lib/dokku/plugins/$$plugin && \
|
rm -Rf ${PLUGINS_PATH}/$$plugin && \
|
||||||
cp -R plugins/$$plugin /var/lib/dokku/plugins && \
|
cp -R plugins/$$plugin ${PLUGINS_PATH} && \
|
||||||
touch /var/lib/dokku/plugins/$$plugin/.core; \
|
touch ${PLUGINS_PATH}/$$plugin/.core; \
|
||||||
done
|
done
|
||||||
|
|
||||||
addman:
|
addman:
|
||||||
|
|||||||
@@ -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:
|
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.6/bootstrap.sh | sudo DOKKU_TAG=v0.3.6 bash
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if ARGV[0] == "onboot"
|
|||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
version = "v0.3.2"
|
version = "v0.3.6"
|
||||||
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
|
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
|
||||||
admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first
|
admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first
|
||||||
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip
|
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip
|
||||||
|
|||||||
32
contrib/dokku_client.sh
Executable file
32
contrib/dokku_client.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
if [ -z "$DOKKU_HOST" ]
|
||||||
|
then
|
||||||
|
function dokku {
|
||||||
|
appname=$(git remote -v 2>/dev/null | grep dokku | head -n 1 | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
|
||||||
|
if [ "$?" != "0" ]
|
||||||
|
then
|
||||||
|
donotshift="YES"
|
||||||
|
fi
|
||||||
|
if [ "$1" = "create" ]
|
||||||
|
then
|
||||||
|
appname=$(echo "print(elfs.GenName())" | lua -l elfs)
|
||||||
|
if git remote add dokku dokku@$DOKKU_HOST:$appname
|
||||||
|
then
|
||||||
|
echo "-----> Dokku remote added at $DOKKU_HOST"
|
||||||
|
echo "-----> Application name is $appname"
|
||||||
|
else
|
||||||
|
echo "! Dokku remote not added! Do you already have a dokku remote?"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
git push dokku master
|
||||||
|
else
|
||||||
|
if [ -z "$donotshift" ]
|
||||||
|
then
|
||||||
|
ssh dokku@$DOKKU_HOST $*
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
verb=$1
|
||||||
|
shift
|
||||||
|
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
fi
|
||||||
@@ -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:
|
To install the latest stable version of dokku, you can run the following bootstrapper command:
|
||||||
|
|
||||||
```bash
|
```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.6/bootstrap.sh | sudo DOKKU_TAG=v0.3.6 bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuring
|
## Configuring
|
||||||
|
|||||||
@@ -28,6 +28,49 @@ If you create your own plugin:
|
|||||||
3. edit this page and add a link to it below!
|
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
|
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/$2" ]] && echo "App $2 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
|
## Community plugins
|
||||||
|
|
||||||
Note: The following plugins have been supplied by our community and may not have been tested by dokku maintainers.
|
Note: The following plugins have been supplied by our community and may not have been tested by dokku maintainers.
|
||||||
|
|||||||
37
dokku
37
dokku
@@ -1,14 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
|
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
|
||||||
|
export DOKKU_IMAGE=${DOKKU_IMAGE:="progrium/buildstep"}
|
||||||
export DOKKU_ROOT=${DOKKU_ROOT:="/home/dokku"}
|
export DOKKU_ROOT=${DOKKU_ROOT:="/home/dokku"}
|
||||||
|
|
||||||
export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
|
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
|
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
|
||||||
|
|
||||||
[[ $DOKKU_TRACE ]] && set -x
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
if [[ $(id -un) != "dokku" && $1 != plugins-install* ]]; then
|
if [[ $(id -un) != "dokku" && $1 != plugins-install* && $1 != "plugins-update" ]]; then
|
||||||
sudo -u dokku -H $0 "$@"
|
sudo -u dokku -E -H $0 "$@"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -36,7 +42,7 @@ case "$1" in
|
|||||||
|
|
||||||
build)
|
build)
|
||||||
APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||||
id=$(cat | docker run -i -a stdin progrium/buildstep /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
|
test $(docker wait $id) -eq 0
|
||||||
docker commit $id $IMAGE > /dev/null
|
docker commit $id $IMAGE > /dev/null
|
||||||
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
|
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
|
||||||
@@ -130,6 +136,10 @@ case "$1" in
|
|||||||
pluginhook dependencies
|
pluginhook dependencies
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
plugins-update)
|
||||||
|
pluginhook update
|
||||||
|
;;
|
||||||
|
|
||||||
# temporary hack for https://github.com/progrium/dokku/issues/82
|
# temporary hack for https://github.com/progrium/dokku/issues/82
|
||||||
deploy:all)
|
deploy:all)
|
||||||
for app in $(ls -d $DOKKU_ROOT/*/CONTAINER); do
|
for app in $(ls -d $DOKKU_ROOT/*/CONTAINER); do
|
||||||
@@ -139,17 +149,36 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
help|'')
|
help|'')
|
||||||
|
echo "Usage: dokku COMMAND <app> [command-specific-options]"
|
||||||
|
echo ""
|
||||||
|
|
||||||
cat<<EOF | pluginhook commands help | sort
|
cat<<EOF | pluginhook commands help | sort
|
||||||
help Print the list of commands
|
help Print the list of commands
|
||||||
plugins Print active plugins
|
plugins Print active plugins
|
||||||
plugins-install Install active plugins
|
plugins-install Install active plugins
|
||||||
|
plugins-update Update active plugins
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
implemented=0
|
||||||
for script in $(ls -d $PLUGIN_PATH/*/commands); do
|
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
|
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
|
esac
|
||||||
|
|||||||
21
dokku.1
21
dokku.1
@@ -1,4 +1,4 @@
|
|||||||
.TH DOKKU 1 2014-05-10
|
.TH DOKKU 1 2014-11-22
|
||||||
.\"Make sure to change that date when you commit a change!
|
.\"Make sure to change that date when you commit a change!
|
||||||
.\"
|
.\"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
@@ -15,6 +15,15 @@ work with plugins and inspect the current state of your server.
|
|||||||
.\"
|
.\"
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
|
.BI apps:create " <app>"
|
||||||
|
Create a new app.
|
||||||
|
.TP
|
||||||
|
.BI apps:destroy " <app>"
|
||||||
|
Permanantly destroy an app.
|
||||||
|
.TP
|
||||||
|
.B apps
|
||||||
|
List your apps.
|
||||||
|
.TP
|
||||||
.BI backup:import " file"
|
.BI backup:import " file"
|
||||||
Import dokku config files.
|
Import dokku config files.
|
||||||
.TP
|
.TP
|
||||||
@@ -33,18 +42,22 @@ Set one or more config vars for an app.
|
|||||||
.BI config:unset " <app> KEY1" \fR\ (KEY2\ \.\.\.)
|
.BI config:unset " <app> KEY1" \fR\ (KEY2\ \.\.\.)
|
||||||
Remove one or more config vars from an app.
|
Remove one or more config vars from an app.
|
||||||
.TP
|
.TP
|
||||||
.BI delete " <app>"
|
|
||||||
Delete an application.
|
|
||||||
.TP
|
|
||||||
.B help
|
.B help
|
||||||
Print the list of commands.
|
Print the list of commands.
|
||||||
.TP
|
.TP
|
||||||
.B logs \ \fI<app> \fR[\fI-t\fR]
|
.B logs \ \fI<app> \fR[\fI-t\fR]
|
||||||
Show the last logs for an application (-t follows)
|
Show the last logs for an application (-t follows)
|
||||||
.TP
|
.TP
|
||||||
|
.BI nginx:import-ssl " <app>"
|
||||||
|
Imports a tarball from stdin which should contain
|
||||||
|
server\.crt and server\.key
|
||||||
|
.TP
|
||||||
.B plugins-install
|
.B plugins-install
|
||||||
Install active plugins.
|
Install active plugins.
|
||||||
.TP
|
.TP
|
||||||
|
.B plugins-update
|
||||||
|
Update active plugins.
|
||||||
|
.TP
|
||||||
.B plugins
|
.B plugins
|
||||||
Print active plugins.
|
Print active plugins.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
@@ -7,15 +7,9 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
logs)
|
logs)
|
||||||
if [[ -z $2 ]]; then
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
echo "Please specify an app to run the command on"
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
APP="$2";
|
APP="$2";
|
||||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
|
||||||
echo "App $APP does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
|
||||||
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
|
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
|
||||||
@@ -30,15 +24,10 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
run)
|
run)
|
||||||
if [[ -z $2 ]]; then
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
echo "Please specify an app to run the command on"
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
APP="$2"; IMAGE="dokku/$APP"
|
APP="$2"; IMAGE="dokku/$APP"
|
||||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
|
||||||
echo "App $APP does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shift 2
|
shift 2
|
||||||
|
|
||||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP)
|
DOCKER_ARGS=$(: | pluginhook docker-args $APP)
|
||||||
@@ -46,11 +35,9 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
url)
|
url)
|
||||||
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
APP="$2";
|
APP="$2";
|
||||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
|
||||||
echo "App $APP does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
||||||
echo $(< "$DOKKU_ROOT/$APP/URL")
|
echo $(< "$DOKKU_ROOT/$APP/URL")
|
||||||
@@ -73,4 +60,8 @@ case "$1" in
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ fi
|
|||||||
|
|
||||||
# temporary hack for https://github.com/progrium/dokku/issues/82
|
# temporary hack for https://github.com/progrium/dokku/issues/82
|
||||||
# redeploys all apps after a reboot
|
# redeploys all apps after a reboot
|
||||||
cat<<EOF > /etc/init/dokku-redeploy.conf
|
case "$DOKKU_DISTRO" in
|
||||||
|
ubuntu)
|
||||||
|
cat<<EOF > /etc/init/dokku-redeploy.conf
|
||||||
description "Dokku app redeploy service"
|
description "Dokku app redeploy service"
|
||||||
|
|
||||||
start on (started docker)
|
start on (started docker)
|
||||||
@@ -17,3 +19,21 @@ script
|
|||||||
sudo -i -u dokku /usr/local/bin/dokku deploy:all
|
sudo -i -u dokku /usr/local/bin/dokku deploy:all
|
||||||
end script
|
end script
|
||||||
EOF
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
|
opensuse)
|
||||||
|
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
|
||||||
|
[Unit]
|
||||||
|
Description=Dokku app redeploy service
|
||||||
|
After=docker.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=dokku
|
||||||
|
ExecStart=/usr/local/bin/dokku deploy:all
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -8,35 +8,19 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
apps:create)
|
apps:create)
|
||||||
if [[ -z $2 ]]; then
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
echo "Please specify an app to create"
|
[[ -d "$DOKKU_ROOT/$APP" ]] && echo " ! Name is already taken" && exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
APP="$2"
|
APP="$2"
|
||||||
if [[ -d "$DOKKU_ROOT/$APP" ]]; then
|
|
||||||
echo " ! Name is already taken"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "$DOKKU_ROOT/$APP"
|
mkdir -p "$DOKKU_ROOT/$APP"
|
||||||
echo "Creating $APP... done"
|
echo "Creating $APP... done"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
apps:destroy)
|
apps:destroy)
|
||||||
if [[ -z $2 ]]; then
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
echo "Please specify an app to delete"
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
exit 1
|
[[ "$2" == "tls" ]] && echo "Unable to destroy tls directory" && exit 1
|
||||||
fi
|
|
||||||
APP="$2"; IMAGE="dokku/$APP";
|
APP="$2"; IMAGE="dokku/$APP";
|
||||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
|
||||||
echo "App $APP does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$APP" == "tls" ]]; then
|
|
||||||
echo "Unable to destroy tls directory"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo " ! WARNING: Potentially Destructive Action"
|
echo " ! WARNING: Potentially Destructive Action"
|
||||||
echo " ! This command will destroy $APP (including all add-ons)."
|
echo " ! This command will destroy $APP (including all add-ons)."
|
||||||
@@ -72,4 +56,8 @@ case "$1" in
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -92,4 +92,8 @@ case "$1" in
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,28 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
# Check if name is specified
|
ENV_FILE="$DOKKU_ROOT/$2/ENV"
|
||||||
if [[ $1 == config ]] || [[ $1 == config:* ]]; then
|
ENV_FILE_TEMP="$DOKKU_ROOT/$2/ENV.tmp"
|
||||||
if [[ -z $2 ]]; then
|
config_create () {
|
||||||
echo "You must specify an app name"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
APP="$2"
|
|
||||||
ENV_FILE="$DOKKU_ROOT/$APP/ENV"
|
|
||||||
ENV_FILE_TEMP="$DOKKU_ROOT/$APP/ENV.tmp"
|
|
||||||
|
|
||||||
# Check if app exists with the same name
|
|
||||||
if [ ! -d "$DOKKU_ROOT/$APP" ]; then
|
|
||||||
echo "App $APP does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f $ENV_FILE ] || {
|
[ -f $ENV_FILE ] || {
|
||||||
echo "-----> Creating $ENV_FILE"
|
echo "-----> Creating $ENV_FILE"
|
||||||
touch $ENV_FILE
|
touch $ENV_FILE
|
||||||
}
|
}
|
||||||
fi
|
}
|
||||||
fi
|
|
||||||
|
|
||||||
config_styled_hash () {
|
config_styled_hash () {
|
||||||
vars="$1"
|
vars="$1"
|
||||||
@@ -76,12 +62,12 @@ config_write() {
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
config)
|
config)
|
||||||
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
APP="$2"
|
APP="$2"
|
||||||
|
|
||||||
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
|
config_create
|
||||||
echo "$APP has no config vars"
|
[[ ! -s $ENV_FILE ]] && echo "$APP has no config vars" && exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2-`
|
VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2-`
|
||||||
|
|
||||||
@@ -97,14 +83,19 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
config:get)
|
config:get)
|
||||||
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
|
APP="$2"
|
||||||
|
|
||||||
if [[ -z $3 ]]; then
|
if [[ -z $3 ]]; then
|
||||||
echo "Usage: dokku config:get APP KEY"
|
echo "Usage: dokku config:get APP KEY"
|
||||||
echo "Must specify KEY."
|
echo "Must specify KEY."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
|
config_create
|
||||||
exit 1
|
if [[ ! -s $ENV_FILE ]] ; then
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
KEY="$3"
|
KEY="$3"
|
||||||
@@ -113,13 +104,17 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
config:set)
|
config:set)
|
||||||
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
|
APP="$2"
|
||||||
|
|
||||||
if [[ -z "${*:3}" ]]; then
|
if [[ -z "${*:3}" ]]; then
|
||||||
echo "Usage: dokku config:set APP KEY1=VALUE1 [KEY2=VALUE2 ...]"
|
echo "Usage: dokku config:set APP KEY1=VALUE1 [KEY2=VALUE2 ...]"
|
||||||
echo "Must specify KEY and VALUE to set."
|
echo "Must specify KEY and VALUE to set."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
|
config_create
|
||||||
ENV_ADD=""
|
ENV_ADD=""
|
||||||
ENV_TEMP=`cat "${ENV_FILE}"`
|
ENV_TEMP=`cat "${ENV_FILE}"`
|
||||||
RESTART_APP=false
|
RESTART_APP=false
|
||||||
@@ -157,13 +152,17 @@ ${var}"
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
config:unset)
|
config:unset)
|
||||||
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
|
APP="$2"
|
||||||
|
|
||||||
if [[ -z $3 ]]; then
|
if [[ -z $3 ]]; then
|
||||||
echo "Usage: dokku config:unset APP KEY1 [KEY2 ...]"
|
echo "Usage: dokku config:unset APP KEY1 [KEY2 ...]"
|
||||||
echo "Must specify KEY to unset."
|
echo "Must specify KEY to unset."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
|
config_create
|
||||||
ENV_TEMP=`cat "${ENV_FILE}"`
|
ENV_TEMP=`cat "${ENV_FILE}"`
|
||||||
VARS="${*:3}"
|
VARS="${*:3}"
|
||||||
|
|
||||||
@@ -184,4 +183,8 @@ ${var}"
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ git_archive_all() {
|
|||||||
TMP_WORK_DIR=$(mktemp -d)
|
TMP_WORK_DIR=$(mktemp -d)
|
||||||
chmod 755 $TMP_WORK_DIR
|
chmod 755 $TMP_WORK_DIR
|
||||||
unset GIT_DIR GIT_WORK_TREE
|
unset GIT_DIR GIT_WORK_TREE
|
||||||
git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null
|
git clone -q $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null
|
||||||
pushd $TMP_WORK_DIR > /dev/null
|
pushd $TMP_WORK_DIR > /dev/null
|
||||||
git config advice.detachedHead false
|
git config advice.detachedHead false
|
||||||
git checkout $REV &> /dev/null
|
git checkout $REV &> /dev/null
|
||||||
@@ -34,6 +34,13 @@ case "$1" in
|
|||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
git-upload-pack)
|
||||||
|
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
|
||||||
|
pluginhook git-pre-pull $APP
|
||||||
|
cat | git-upload-pack "$DOKKU_ROOT/$APP"
|
||||||
|
pluginhook git-post-pull $APP
|
||||||
|
;;
|
||||||
|
|
||||||
git-*)
|
git-*)
|
||||||
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
|
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
|
||||||
APP_PATH=$DOKKU_ROOT/$APP
|
APP_PATH=$DOKKU_ROOT/$APP
|
||||||
@@ -58,4 +65,8 @@ EOF
|
|||||||
cat
|
cat
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -3,41 +3,31 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
nginx:import-ssl)
|
nginx:import-ssl)
|
||||||
if [[ -z $2 ]]; then
|
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||||
echo "Please specify an app to create"
|
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||||
exit 1
|
[[ -t 0 ]] && echo "Tar archive containing server.crt and server.key expected on stdin" && exit 1
|
||||||
fi
|
|
||||||
APP="$2"
|
APP="$2"
|
||||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
|
||||||
echo "App $APP does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ -t 0 ]]; then
|
|
||||||
echo "Tar archive containing server.crt and server.key expected on stdin"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
TEMP_DIR=`mktemp -d`
|
TEMP_DIR=`mktemp -d`
|
||||||
cd $TEMP_DIR
|
cd $TEMP_DIR
|
||||||
tar xvf - <&0
|
tar xvf - <&0
|
||||||
if [[ -f "$TEMP_DIR/server.crt" ]]; then
|
[[ -f "$TEMP_DIR/server.crt" ]] && echo "Tar archive missing server.crt" && exit 1
|
||||||
echo "Tar archive missing server.crt"
|
[[ -f "$TEMP_DIR/server.key" ]] && echo "Tar archive missing server.key" && exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ -f "$TEMP_DIR/server.key" ]]; then
|
|
||||||
echo "Tar archive missing server.key"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "$DOKKU_ROOT/$APP/tls"
|
mkdir -p "$DOKKU_ROOT/$APP/tls"
|
||||||
mv "$TEMP_DIR/server.crt" "$DOKKU_ROOT/$APP/tls/server.crt"
|
mv "$TEMP_DIR/server.crt" "$DOKKU_ROOT/$APP/tls/server.crt"
|
||||||
mv "$TEMP_DIR/server.key" "$DOKKU_ROOT/$APP/tls/server.key"
|
mv "$TEMP_DIR/server.key" "$DOKKU_ROOT/$APP/tls/server.key"
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
;;
|
;;
|
||||||
|
|
||||||
help | nginx:help)
|
help | nginx:help)
|
||||||
cat && cat<<EOF
|
cat && cat<<EOF
|
||||||
nginx:import-ssl <app> Imports a tarball from stdin; should contain server.crt and server.key
|
nginx:import-ssl <app> Imports a tarball from stdin; should contain server.crt and server.key
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
# latest stable NGINX 1.4.x with websocket support
|
case "$DOKKU_DISTRO" in
|
||||||
apt-get install -qq -y software-properties-common python-software-properties
|
ubuntu)
|
||||||
add-apt-repository -y ppa:nginx/stable
|
apt-get install -qq -y software-properties-common python-software-properties
|
||||||
apt-get update
|
add-apt-repository -y ppa:nginx/stable
|
||||||
apt-get install -qq -y nginx dnsutils
|
apt-get update
|
||||||
|
apt-get install -qq -y nginx dnsutils
|
||||||
|
;;
|
||||||
|
|
||||||
|
opensuse)
|
||||||
|
zypper -q in -y nginx bind-utils
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
|
if [[ ! -f /etc/sudoers.d/dokku-nginx ]]; then
|
||||||
touch /etc/sudoers.tmp
|
case "$DOKKU_DISTRO" in
|
||||||
cp /etc/sudoers /tmp/sudoers.new
|
ubuntu)
|
||||||
echo "%dokku ALL=(ALL)NOPASSWD:/etc/init.d/nginx reload # dokku-nginx-reload" >> /tmp/sudoers.new
|
echo "%dokku ALL=(ALL) NOPASSWD:/etc/init.d/nginx reload" >> /etc/sudoers.d/dokku-nginx
|
||||||
EDITOR="cp /tmp/sudoers.new" visudo
|
;;
|
||||||
rm /tmp/sudoers.new
|
|
||||||
|
opensuse)
|
||||||
|
echo "%dokku ALL=(ALL) NOPASSWD:/sbin/service nginx reload" >> /etc/sudoers.d/dokku-nginx
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
chmod 0440 /etc/sudoers.d/dokku-nginx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if dokku.conf has not been created, create it
|
# if dokku.conf has not been created, create it
|
||||||
@@ -25,10 +31,19 @@ ssl_prefer_server_ciphers on;
|
|||||||
#ssl_certificate_key $DOKKU_ROOT/tls/server.key;
|
#ssl_certificate_key $DOKKU_ROOT/tls/server.key;
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/nginx/nginx.conf
|
|
||||||
|
echo 'server_names_hash_bucket_size 64;' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf
|
||||||
|
|
||||||
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
|
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||||
[[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
[[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/etc/init.d/nginx start
|
case "$DOKKU_DISTRO" in
|
||||||
|
ubuntu)
|
||||||
|
/etc/init.d/nginx start
|
||||||
|
;;
|
||||||
|
|
||||||
|
opensuse)
|
||||||
|
/sbin/service nginx start
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
sudo /etc/init.d/nginx reload > /dev/null
|
case "$DOKKU_DISTRO" in
|
||||||
|
ubuntu)
|
||||||
|
sudo /etc/init.d/nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
|
||||||
|
opensuse)
|
||||||
|
sudo /sbin/service nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ set +e
|
|||||||
NO_VHOST=$(dokku config:get $APP NO_VHOST)
|
NO_VHOST=$(dokku config:get $APP NO_VHOST)
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [[ -z "$NO_VHOST" ]]; then
|
if [[ -n "$NO_VHOST" ]]; then
|
||||||
echo "-----> NO_VHOST config detected"
|
echo "-----> NO_VHOST config detected"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$DOKKU_ROOT/VHOST" && ! -z "$NO_VHOST" ]]; then
|
if [[ -f "$DOKKU_ROOT/VHOST" && ! -n "$NO_VHOST" ]]; then
|
||||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||||
@@ -101,8 +101,17 @@ EOF
|
|||||||
|
|
||||||
echo "-----> Running nginx-pre-reload"
|
echo "-----> Running nginx-pre-reload"
|
||||||
pluginhook nginx-pre-reload $APP $PORT
|
pluginhook nginx-pre-reload $APP $PORT
|
||||||
|
|
||||||
echo " Reloading nginx"
|
echo " Reloading nginx"
|
||||||
|
case "$DOKKU_DISTRO" in
|
||||||
|
ubuntu)
|
||||||
sudo /etc/init.d/nginx reload > /dev/null
|
sudo /etc/init.d/nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
|
||||||
|
opensuse)
|
||||||
|
sudo /sbin/service nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
||||||
echo "------> NO_VHOST set, deleting $APP/URL"
|
echo "------> NO_VHOST set, deleting $APP/URL"
|
||||||
@@ -112,6 +121,15 @@ else
|
|||||||
echo "------> NO_VHOST set, deleting $APP/nginx.conf"
|
echo "------> NO_VHOST set, deleting $APP/nginx.conf"
|
||||||
rm "$DOKKU_ROOT/$APP/nginx.conf"
|
rm "$DOKKU_ROOT/$APP/nginx.conf"
|
||||||
echo "------> NO_VHOST set, reloading nginx after nginx.conf deletion"
|
echo "------> NO_VHOST set, reloading nginx after nginx.conf deletion"
|
||||||
|
case "$DOKKU_DISTRO" in
|
||||||
|
ubuntu)
|
||||||
|
sudo /etc/init.d/nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
|
||||||
|
opensuse)
|
||||||
|
sudo /sbin/service nginx reload > /dev/null
|
||||||
|
;;
|
||||||
|
esac
|
||||||
sudo /etc/init.d/nginx reload > /dev/null
|
sudo /etc/init.d/nginx reload > /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user