Add koschei refresh-group script and cronjob

This commit is contained in:
Michael Simacek 2016-05-20 12:38:19 +02:00
parent 7b2a5482bf
commit d7d6862217
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,11 @@
#!/bin/bash
if [ "$#" -lt 2 ]; then
echo "Usage: refresh-group <group-name> <repoquery-args>..."
exit 1
fi
set -e
repodata=`find /var/cache/koschei/repodata/ -maxdepth 1 -type d -name 'primary-f*' | sort -nr | head -n1`
repoid=`basename repodata`
group=$1
shift
dnf repoquery --repofrompath "$repoid,$repodata/x86_64" --repoid "$repoid" --qf '%{sourcerpm}' "$@" | sed 's|-[^-]*-[^-]*$||' | koschei-admin edit-group "$group" --content-from-file - --append

View file

@ -123,6 +123,22 @@
- koschei
- config
- name: Copy refresh-group script
copy: >
src=koschei-refresh-group
dest=/usr/local/bin/koschei-refresh-group
mode=755
when: env == 'staging'
tags:
- koschei
- name: Copy the group refresh cronjob
template: src=cron-refresh-groups.j2 dest=/etc/cron.d/cron-refresh-groups
when: env == 'staging'
tags:
- koschei
- config
- name: access to postgres for scripts
template: src=pgpass.j2 dest=/var/cache/koschei/.pgpass
owner=koschei group=koschei mode=0600

View file

@ -0,0 +1,3 @@
SHELL=/bin/bash
MAILTO=sysadmin-koschei-members@fedoraproject.org
0 0-23/3 * * * koschei koschei-refresh-group php 'php*'