diff --git a/lib/run.bash b/lib/run.bash index bd057ab7..e7307e44 100644 --- a/lib/run.bash +++ b/lib/run.bash @@ -41,6 +41,13 @@ check_linked_containers_and_save_logs() { [[ -d "$logdir" ]] && rm -rf "$logdir" mkdir -p "$logdir" + always_upload=() + while read -r name ; do + if [[ -n "$name" ]] ; then + always_upload+=("$name") + fi + done <<< "$(plugin_read_list ALWAYS_UPLOAD)" + # Get list of container if to service labels containers=() while IFS=$'\n' read -r container ; do @@ -65,6 +72,8 @@ check_linked_containers_and_save_logs() { echo "+++ :warning: Linked service $service_name exited with $service_exit_code" plugin_prompt_and_run docker logs --timestamps --tail 5 "$service_container_id" docker logs -t "$service_container_id" &>"${logdir}/${service_name}.log" + elif in_array "$service_name" "${always_upload[@]}"; then + docker logs -t "$service_container_id" &>"${logdir}/${service_name}.log" elif $uploadall; then docker logs -t "$service_container_id" &>"${logdir}/${service_name}.log" fi diff --git a/plugin.yml b/plugin.yml index 7578be75..71f71db2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -70,6 +70,9 @@ configuration: type: boolean upload-container-logs: type: string + always-upload: + type: [ string, array ] + minimum: 1 propagate-uid-gid: type: boolean mount-buildkite-agent: