mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(docker): add cron service (aurblup + mkpkglists)
Normally, these scripts are used to update official providers in the aurweb database along with archives that can be retrieved. Run both of these scripts in a 5 minute cron job, to both reflect the live instance database and production load. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
338a44839f
commit
4b8963b7ba
5 changed files with 43 additions and 1 deletions
|
@ -144,6 +144,19 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- git_data:/aurweb/aur.git
|
- git_data:/aurweb/aur.git
|
||||||
|
|
||||||
|
cron:
|
||||||
|
image: aurweb:latest
|
||||||
|
init: true
|
||||||
|
environment:
|
||||||
|
- AUR_CONFIG=/aurweb/conf/config
|
||||||
|
entrypoint: /docker/cron-entrypoint.sh
|
||||||
|
command: /docker/scripts/run-cron.sh
|
||||||
|
depends_on:
|
||||||
|
mariadb_init:
|
||||||
|
condition: service_started
|
||||||
|
volumes:
|
||||||
|
- mariadb_run:/var/run/mysqld
|
||||||
|
|
||||||
php-fpm:
|
php-fpm:
|
||||||
image: aurweb:latest
|
image: aurweb:latest
|
||||||
init: true
|
init: true
|
||||||
|
@ -163,6 +176,8 @@ services:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
memcached:
|
memcached:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
cron:
|
||||||
|
condition: service_started
|
||||||
volumes:
|
volumes:
|
||||||
- mariadb_run:/var/run/mysqld
|
- mariadb_run:/var/run/mysqld
|
||||||
ports:
|
ports:
|
||||||
|
@ -190,6 +205,8 @@ services:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
cron:
|
||||||
|
condition: service_started
|
||||||
volumes:
|
volumes:
|
||||||
- mariadb_run:/var/run/mysqld
|
- mariadb_run:/var/run/mysqld
|
||||||
ports:
|
ports:
|
||||||
|
|
2
docker/config/aurweb-cron
Normal file
2
docker/config/aurweb-cron
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
*/5 * * * * aurweb-aurblup
|
||||||
|
*/5 * * * * aurweb-mkpkglists
|
16
docker/cron-entrypoint.sh
Executable file
16
docker/cron-entrypoint.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -eou pipefail
|
||||||
|
|
||||||
|
# Prepare AUR_CONFIG.
|
||||||
|
cp -vf conf/config.dev conf/config
|
||||||
|
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
||||||
|
|
||||||
|
# Create directories we need.
|
||||||
|
mkdir -p /aurweb/aurblup
|
||||||
|
|
||||||
|
# Install the cron configuration.
|
||||||
|
cp /docker/config/aurweb-cron /etc/cron.d/aurweb-cron
|
||||||
|
chmod 0644 /etc/cron.d/aurweb-cron
|
||||||
|
crontab /etc/cron.d/aurweb-cron
|
||||||
|
|
||||||
|
exec "$@"
|
|
@ -8,7 +8,7 @@ pacman -Syu --noconfirm --noprogressbar \
|
||||||
--cachedir .pkg-cache git gpgme nginx redis openssh \
|
--cachedir .pkg-cache git gpgme nginx redis openssh \
|
||||||
mariadb mariadb-libs cgit-aurweb uwsgi uwsgi-plugin-cgi \
|
mariadb mariadb-libs cgit-aurweb uwsgi uwsgi-plugin-cgi \
|
||||||
php php-fpm memcached php-memcached python-pip pyalpm \
|
php php-fpm memcached php-memcached python-pip pyalpm \
|
||||||
python-srcinfo curl libeatmydata
|
python-srcinfo curl libeatmydata cronie
|
||||||
|
|
||||||
# https://python-poetry.org/docs/ Installation section.
|
# https://python-poetry.org/docs/ Installation section.
|
||||||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
|
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
|
||||||
|
|
7
docker/scripts/run-cron.sh
Executable file
7
docker/scripts/run-cron.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd /aurweb
|
||||||
|
aurweb-aurblup
|
||||||
|
aurweb-mkpkglists
|
||||||
|
|
||||||
|
exec /usr/bin/crond -n
|
Loading…
Add table
Reference in a new issue