Add special case commands for instances where we are running dokku in debian

Refs #976
This commit is contained in:
Jose Diaz-Gonzalez
2015-10-24 23:12:38 -04:00
parent 6674d7823e
commit 18d6e1be3b
6 changed files with 25 additions and 3 deletions

View File

@@ -62,9 +62,10 @@ fi
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
export DEBIAN_FRONTEND=noninteractive
case "$DOKKU_DISTRO" in
ubuntu)
export DEBIAN_FRONTEND=noninteractive
debian|ubuntu)
apt-get install --force-yes -qq -y nginx
;;

View File

@@ -25,7 +25,7 @@ end script
EOF
;;
opensuse)
debian|opensuse)
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
[Unit]
Description=Dokku app redeploy service

View File

@@ -2,6 +2,11 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$DOKKU_DISTRO" in
debian)
export DEBIAN_FRONTEND=noninteractive
apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes -qq -y nginx dnsutils
;;
ubuntu)
export DEBIAN_FRONTEND=noninteractive
[[ -z "$CIRCLECI" ]] && apt-get install -qq -y software-properties-common python-software-properties

View File

@@ -114,6 +114,10 @@ validate_nginx() {
restart_nginx() {
case "$DOKKU_DISTRO" in
debian)
/usr/sbin/invoke-rc.d nginx reload > /dev/null
;;
ubuntu)
sudo /etc/init.d/nginx reload > /dev/null
;;

View File

@@ -2,6 +2,10 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$DOKKU_DISTRO" in
debian)
echo "%dokku ALL=(ALL) NOPASSWD:/usr/sbin/invoke-rc.d nginx reload, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
;;
ubuntu)
echo "%dokku ALL=(ALL) NOPASSWD:/etc/init.d/nginx reload, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
;;
@@ -41,6 +45,10 @@ chmod g+r /var/log/nginx
[[ -f /etc/logrotate.d/nginx ]] && sed -i -e 's/invoke-rc.d/service/g' /etc/logrotate.d/nginx
case "$DOKKU_DISTRO" in
debian)
/usr/sbin/invoke-rc.d nginx start
;;
ubuntu)
/etc/init.d/nginx start
;;

View File

@@ -2,6 +2,10 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$DOKKU_DISTRO" in
debian)
sudo /usr/sbin/invoke-rc.d nginx reload > /dev/null
;;
ubuntu)
sudo /etc/init.d/nginx reload > /dev/null
;;