Browse Source

Added 'silence_compiler' option which will cause all stdout from source build/install to be suppressed (logged to a file, in case you want to see it later). stderr is also logged to file, but if there is an error then stderr is copied to Salt so it comes back with the highstate payload.

susefix
Ross Perkins 10 years ago
parent
commit
b48f6cf98f
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      nginx/source.sls

+ 13
- 1
nginx/source.sls View File

cmd.wait: cmd.wait:
- cwd: {{ nginx_source }} - cwd: {{ nginx_source }}
- names: - names:
- ./configure --conf-path={{ conf_dir }}/nginx.conf
- (
./configure --conf-path={{ conf_dir }}/nginx.conf
--sbin-path={{ sbin_dir }}/nginx --sbin-path={{ sbin_dir }}/nginx
--user={{ nginx_map.default_user }} --user={{ nginx_map.default_user }}
--group={{ nginx_map.default_group }} --group={{ nginx_map.default_group }}
{%- endfor %} {%- endfor %}
&& make {{ make_flags }} && make {{ make_flags }}
&& make install && make install
)
{#- If they want to silence the compiler output, then save it to file so we can reference it later if needed #}
{%- if nginx.get('silence_compiler', true) %}
> {{ nginx_source }}/build.out 2> {{ nginx_source }}/build.err;
{#- If the build process failed, write stderr to stderr and exit with the error code #}
r=$?;
if [ x$r != x0 ]; then
cat {{ nginx_source }}/build.err 1>&2; {#- copy err output to stderr #}
exit $r;
fi;
{% endif %}
- watch: - watch:
- cmd: get-nginx - cmd: get-nginx
{% for name, module in nginx.get('modules', {}).items() -%} {% for name, module in nginx.get('modules', {}).items() -%}

Loading…
Cancel
Save