Skip to content

Commit

Permalink
Feature/improve startup time (#151)
Browse files Browse the repository at this point in the history
* Improve startup time by using a single invocation of gomplate
  • Loading branch information
Ryan Faircloth authored and GitHub committed Oct 15, 2019
1 parent 2fb4009 commit 9e6bd1e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions package/sbin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
source scl_source enable rh-python36

cd /opt/syslog-ng
for d in $(find /opt/syslog-ng/etc -type d)
do
echo Templating conf for $d
gomplate \
--input-dir=$d \
--template t=etc/go_templates/ \
--exclude=*.conf --exclude=*.csv --exclude=*.t --exclude=.*\
--output-map="$d/{{ .in | strings.ReplaceAll \".conf.tmpl\" \".conf\" }}"
done
#The following is no longer needed but retained as a comment just in case we run into command line length issues
#for d in $(find /opt/syslog-ng/etc -type d)
#do
# echo Templating conf for $d
# gomplate \
# --input-dir=$d \
# --template t=etc/go_templates/ \
# --exclude=*.conf --exclude=*.csv --exclude=*.t --exclude=.*\
# --output-map="$d/{{ .in | strings.ReplaceAll \".conf.tmpl\" \".conf\" }}"
#done
gomplate $(find . -name *.tmpl | sed -E 's/^(\/.*\/)*(.*)\..*$/--file=\2.tmpl --out=\2/') --template t=etc/go_templates/


mkdir -p /opt/syslog-ng/etc/conf.d/local/context/
mkdir -p /opt/syslog-ng/etc/conf.d/local/config/
Expand Down

0 comments on commit 9e6bd1e

Please sign in to comment.