Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.
Open
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 jobs/containers/spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ properties:
containers.links: Optional array of links to another containers (name:alias)
containers.log_driver: Optional string containing the log driver for the container
containers.log_options: Optional array of log driver options
containers.log_rotate: Optional content of a logrotate file for this container
containers.lxc_options: Optional array of custom lxc options
containers.mac_address: Optional string containing the container MAC address
containers.memory: Optional string containing the memory limit to assign to the container (format: <number><optional unit>, where unit = b, k, m or g)
Expand Down
5 changes: 5 additions & 0 deletions jobs/containers/templates/bin/job_properties.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ export <%= container['name'] %>_log_driver="--log-driver=<%= container['log_driv
export <%= container['name'] %>_log_options="<%= Array(container['log_options']).join(',').split(',').map { |log_option| "--log-opt=#{log_option}" }.join(' ') %>"
<% end %>

<% if container['log_rotate'] %>
# Write log rotate file for the container
echo -e "<%= container['log_rotate'] %>" > /etc/logrotate.d/<%= container['name'] %>
<% end %>

<% unless container['lxc_options'].nil? || container['lxc_options'].empty? %>
# Custom lxc options
export <%= container['name'] %>_lxc_options="<%= Array(container['lxc_options']).join(',').split(',').map { |lxc_option| "--lxc-conf=#{lxc_option}" }.join(' ') %>"
Expand Down