Skip to content

Commit

Permalink
Switch to mkdir -p
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Franks <Geoff.Franks@allstate.com>
  • Loading branch information
KeenanHoffman authored and geofffranks committed May 16, 2019
1 parent 23b1221 commit 08c12ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 9 additions & 0 deletions ci/release_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# New Features

- Custom HTTP responses can be configured using `ha_proxy.custom_http_error_files`. It takes
a map of status codes to raw http responses to send. This allows operators to customize things
like the 502/503 errors returned by HA Proxy.

# Acknowledgements

Many thanks to @rodolf2488 and @barakyo for implementing this!
6 changes: 2 additions & 4 deletions jobs/haproxy/templates/pre-start.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash -e

if ! [ -e "/var/vcap/jobs/haproxy/errorfiles" ]; then
mkdir /var/vcap/jobs/haproxy/errorfiles
fi
mkdir -p /var/vcap/jobs/haproxy/errorfiles

<% p('ha_proxy.custom_http_error_files', {}).each do |status_code, http_content| -%>

cat > <%= "/var/vcap/jobs/haproxy/errorfiles/custom#{status_code}.http" %> << EOF
<%= http_content %>
EOF
<% end -%>
<% end -%>

0 comments on commit 08c12ce

Please sign in to comment.