Replace hard-copded plague-client config with a template

master
Daniel Berteaud 5 years ago
parent 899a7d35df
commit 5d393cfe41
  1. 10
      bin/buildwatcher
  2. 7
      conf/plague-client.template
  3. 1
      conf/watcher.conf

@ -23,15 +23,7 @@ inotifywait -e moved_to -r -m --format %w%f $WATCHED_DIR | while read SRPM; do
[ -z $EMAIL ] && EMAIL=$ADMIN_EMAIL
PLAGUE_CONF=$(mktemp)
# TODO: make the plague client config file templated
cat <<_EOF > $PLAGUE_CONF
[Server]
use_ssl = no
address = $PLAGUE_SERVER
allow_uploads = yes
[User]
email = $EMAIL
_EOF
cat /etc/buildwatcher/plague-client.template | sed -e "s/__EMAIL__/$EMAIL/g" > $PLAGUE_CONF
PLAGUE_CLIENT_CONFIG=$PLAGUE_CONF plague-client build $NAME $SRPM $DIST
rm -f $SRPM $PLAGUE_CONF

@ -0,0 +1,7 @@
[Server]
use_ssl = no
address = http://localhost:8887
allow_uploads = yes
[User]
email = __EMAIL__

@ -2,4 +2,3 @@ TOP_DIR=/var/lib/build
LDAP_URI=ldap://directory.domain.com/
LDAP_USER_BASE=ou=Users,dc=domain,dc=com
ADMIN_EMAIL=admin@domain.com
PLAGUE_SERVER=http://localhost:8887

Loading…
Cancel
Save