diff --git a/etc/nginx-proxy b/cfg/etc/etc/nginx/sites-available/melpa similarity index 100% rename from etc/nginx-proxy rename to cfg/etc/etc/nginx/sites-available/melpa diff --git a/cfg/etc/runit/melpa/run b/cfg/etc/runit/melpa/run new file mode 100755 index 00000000..221ea11f --- /dev/null +++ b/cfg/etc/runit/melpa/run @@ -0,0 +1,3 @@ +#!/bin/sh -e +exec 2>&1 +exec chpst -u melpa runsvdir /home/melpa/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' diff --git a/etc/logrotate b/cfg/home/etc/logrotate similarity index 100% rename from etc/logrotate rename to cfg/home/etc/logrotate diff --git a/etc/nginx b/cfg/home/etc/nginx similarity index 100% rename from etc/nginx rename to cfg/home/etc/nginx diff --git a/cfg/home/service/builder/run b/cfg/home/service/builder/run new file mode 100755 index 00000000..3a4738f8 --- /dev/null +++ b/cfg/home/service/builder/run @@ -0,0 +1,23 @@ +#!/bin/bash -e + +exec 2>&1 + +export HOME=/home/melpa +cd ${HOME}/melpa + +source $HOME/melpa/scripts/env + +## git pull +cd ${MELPA_HOME} +git fetch origin +git reset --hard origin/${MELPA_BRANCH} +git pull origin ${MELPA_BRANCH} +echo + +# Build all the packages. +scripts/parallel_build_all + +echo '{"completed":' `date "+%s"` '}' > /home/melpa/www/build-status.json + +# Sleep for an hour before rebuilding. +sleep 1h diff --git a/cfg/home/service/nginx/run b/cfg/home/service/nginx/run new file mode 100755 index 00000000..0e5c2e39 --- /dev/null +++ b/cfg/home/service/nginx/run @@ -0,0 +1,4 @@ +#!/bin/bash -e + +exec /usr/sbin/nginx -g 'error_log /dev/null crit;' -c ~/etc/nginx + diff --git a/cfg/home/service/process_log/run b/cfg/home/service/process_log/run new file mode 100755 index 00000000..f74dca9e --- /dev/null +++ b/cfg/home/service/process_log/run @@ -0,0 +1,8 @@ +#!/bin/bash -e + +cd /home/melpa/melpa +/usr/bin/python /home/melpa/melpa/scripts/process_log.py + +/usr/sbin/logrotate -s /home/melpa/var/lib/logrotate/status /home/melpa/etc/logrotate + +sleep 6h diff --git a/cfg/home/service/reporter/run b/cfg/home/service/reporter/run new file mode 100755 index 00000000..20ee371f --- /dev/null +++ b/cfg/home/service/reporter/run @@ -0,0 +1,24 @@ +#!/bin/bash -e + +# Service for reporting missing and old packages. + +export HOME=/home/melpa + +BODY=`mktemp` + +cd ${HOME}/melpa + +echo "To: MP " > ${BODY} +echo "Subject: [MELPA] `date "+%Y%m%d %H:%M %z"`" >> ${BODY} +echo >> ${BODY} +echo "# Old Packages" >> ${BODY} +echo >> ${BODY} +scripts/expired >> ${BODY} +echo >> ${BODY} +echo "# Missing Packages" >> ${BODY} +echo >> ${BODY} +scripts/missing >> ${BODY} + +/usr/sbin/sendmail -t < ${BODY} + +sleep 12h diff --git a/cfg/home/service/syncer/run b/cfg/home/service/syncer/run new file mode 100755 index 00000000..0908dc6a --- /dev/null +++ b/cfg/home/service/syncer/run @@ -0,0 +1,13 @@ +#!/bin/bash -e + +export HOME=/home/melpa +cd ${HOME}/melpa +[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" + +make cleanup +make json +make html +make sync + +# Sync every 5 minutes. +sleep 5m