From 5d393cfe41551d3fc0607f8648a40d6702a93a8d Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 19 Nov 2017 13:26:52 +0100 Subject: [PATCH] Replace hard-copded plague-client config with a template --- bin/buildwatcher | 10 +--------- conf/plague-client.template | 7 +++++++ conf/watcher.conf | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 conf/plague-client.template diff --git a/bin/buildwatcher b/bin/buildwatcher index 2bbb46c..c00cb6b 100644 --- a/bin/buildwatcher +++ b/bin/buildwatcher @@ -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 diff --git a/conf/plague-client.template b/conf/plague-client.template new file mode 100644 index 0000000..5a64f11 --- /dev/null +++ b/conf/plague-client.template @@ -0,0 +1,7 @@ +[Server] +use_ssl = no +address = http://localhost:8887 +allow_uploads = yes + +[User] +email = __EMAIL__ diff --git a/conf/watcher.conf b/conf/watcher.conf index b28edd4..1f31d88 100644 --- a/conf/watcher.conf +++ b/conf/watcher.conf @@ -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