Adds support for ArchLinux as host OS

* fix rsyslog handling
* don't hardcode dokku path
* add documentation for ArchLinux package build
* add vagrant machine to run the ArchLinux specific steps
* add step in release process for ArchLinux
* enhance docs for easy ArchLinux steps
This commit is contained in:
Morris Jobke
2016-02-15 14:59:14 +01:00
parent a146849a58
commit 7a9cf8abb1
11 changed files with 116 additions and 8 deletions

View File

@@ -9,6 +9,8 @@ if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
fi
dokku_path=$(which dokku)
# temporary hack for https://github.com/dokku/dokku/issues/82
# redeploys all apps after a reboot
if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then
@@ -19,7 +21,7 @@ start on filesystem and started docker
script
sleep 2 # give docker some time
sudo -i -u dokku /usr/local/bin/dokku ps:restore
sudo -i -u dokku $dokku_path ps:restore
end script
EOF
fi
@@ -33,7 +35,7 @@ After=docker.target
[Service]
Type=simple
User=dokku
ExecStart=/usr/local/bin/dokku ps:restore
ExecStart=$dokku_path ps:restore
[Install]
WantedBy=multi-user.target

View File

@@ -2,7 +2,8 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
DOKKU_RSYSLOG_FILTER=/etc/rsyslog.d/99-dokku.conf
DOKKU_RSYSLOG_FILTER_DIR=/etc/rsyslog.d
DOKKU_RSYSLOG_FILTER=$DOKKU_RSYSLOG_FILTER_DIR/99-dokku.conf
DOKKU_LOGROTATE_FILE=/etc/logrotate.d/dokku
flag_rsyslog_needs_restart=n
@@ -11,7 +12,7 @@ flag_rsyslog_needs_restart=n
# exits gracefully if the path already exists
mkdir -m 775 -p "$DOKKU_LOGS_DIR"
case "$DOKKU_DISTRO" in
debian)
arch|debian)
chgrp dokku "$DOKKU_LOGS_DIR"
;;
*)
@@ -22,7 +23,7 @@ esac
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
touch "$DOKKU_EVENTS_LOGFILE"
case "$DOKKU_DISTRO" in
debian)
arch|debian)
chgrp dokku "$DOKKU_EVENTS_LOGFILE"
;;
*)
@@ -33,7 +34,7 @@ if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
chmod 664 "$DOKKU_EVENTS_LOGFILE"
fi
if [[ ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then
if [[ -d "$DOKKU_RSYSLOG_FILTER_DIR" && ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then
cat >"$DOKKU_RSYSLOG_FILTER" <<EOF
:syslogtag, contains, "dokku" $DOKKU_EVENTS_LOGFILE
EOF
@@ -64,7 +65,7 @@ EOF
flag_rsyslog_needs_restart=y
fi
if [[ "$flag_rsyslog_needs_restart" == "y" ]]; then
if [[ -f "$DOKKU_RSYSLOG_FILTER" && "$flag_rsyslog_needs_restart" == "y" ]]; then
service rsyslog restart
fi

View File

@@ -25,4 +25,8 @@ case "$DOKKU_DISTRO" in
opensuse)
zypper -q in -y nginx bind-utils
;;
arch)
pacman -S --noconfirm --noprogressbar --needed nginx bind-tools
;;
esac

View File

@@ -32,6 +32,10 @@ restart_nginx() {
opensuse)
sudo /sbin/service nginx reload > /dev/null
;;
arch)
sudo /usr/bin/systemctl reload nginx
;;
esac
}

View File

@@ -13,6 +13,10 @@ case "$DOKKU_DISTRO" in
opensuse)
echo "%dokku ALL=(ALL) NOPASSWD:/sbin/service nginx reload, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
;;
arch)
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload nginx, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
;;
esac
chmod 0440 /etc/sudoers.d/dokku-nginx
@@ -57,4 +61,8 @@ case "$DOKKU_DISTRO" in
opensuse)
/sbin/service nginx start
;;
arch)
/usr/bin/systemctl start nginx
;;
esac

View File

@@ -14,4 +14,8 @@ case "$DOKKU_DISTRO" in
opensuse)
sudo /sbin/service nginx reload > /dev/null
;;
arch)
sudo /usr/bin/systemctl reload nginx
;;
esac