Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for enabling "hipe_compile" at runtime #91

Merged
merged 2 commits into from
Jul 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN echo 'deb http://packages.erlang-solutions.com/debian jessie contrib' > /etc
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
erlang-asn1 \
erlang-base-hipe \
erlang-crypto \
erlang-eldap \
erlang-inets \
Expand Down
24 changes: 21 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ if [ "$1" = 'rabbitmq-server' ]; then
ssl_ca_file
ssl_cert_file
ssl_key_file
hipe_compile
)

haveConfig=
Expand Down Expand Up @@ -80,12 +81,29 @@ if [ "$1" = 'rabbitmq-server' ]; then
fi

for conf in "${configs[@]}"; do
[ "${conf#ssl_}" = "$conf" ] || continue
var="RABBITMQ_${conf^^}"
val="${!var}"
[ "$val" ] || continue

rawVal=
case "$conf" in
# SSL-related options are configured above, so should be ignored here
ssl_*) continue ;;

# convert shell booleans into Erlang booleans
hipe_compile)
[ "$val" ] && rawVal='true' || rawVal='false'
;;

# otherwise, assume string-based (and skip or add appropriate decorations)
*)
[ "$val" ] || continue
rawVal='<<"'"$val"'">>'
;;
esac
[ "$rawVal" ] || continue

cat >> /etc/rabbitmq/rabbitmq.config <<-EOC
{$conf, <<"$val">>},
{$conf, $rawVal},
EOC
done

Expand Down