Skip to content

Commit

Permalink
refactor: enable debug for faucet run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Jul 3, 2024
1 parent ef8c33f commit 760c2ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
17 changes: 14 additions & 3 deletions infrastructure/nomad/playbooks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,8 @@
ansible.builtin.shell: |
RESULT="$(nomad run {{ ansible_env.HOME }}/{{ env }}/{{ job.name }}.nomad 2>&1)"
if [ $? -ne 0 ]; then
echo "Failed to deploy {{ job.name }}:\n${RESULT}."
echo "Failed to deploy {{ job.name }}:"
echo "${RESULT}"
echo "{{ job.name }} stdout logs:"
nomad alloc logs -stdout -job "{{ job.name }}" | tail -n 100
echo "{{ job.name }} error logs:"
Expand All @@ -585,7 +586,12 @@
START_TIME=$(date +%s)
RESULT=$(nomad job status -json "{{ job.name }}")
if [ $? -ne 0 ]; then
echo "Failed to get job status for {{ job.name }}:\n${RESULT}."
echo "Failed to get job status for {{ job.name }}:"
echo "${RESULT}"
echo "{{ job.name }} stdout logs:"
nomad alloc logs -stdout -job "{{ job.name }}" | tail -n 100
echo "{{ job.name }} error logs:"
nomad alloc logs -stderr -job "{{ job.name }}" | tail -n 100
exit 1
fi
JOB_TYPE=$(echo "${RESULT}" | jq -r '.[0].Allocations[0].JobType')
Expand Down Expand Up @@ -624,7 +630,12 @@
sleep 1
RESULT=$(nomad job status -json "{{ job.name }}")
if [ $? -ne 0 ]; then
echo "Failed to get job status for {{ job.name }}: ${RESULT}."
echo "Failed to get job status for {{ job.name }}:"
echo "${RESULT}"
echo "{{ job.name }} stdout logs:"
nomad alloc logs -stdout -job "{{ job.name }}" | tail -n 100
echo "{{ job.name }} error logs:"
nomad alloc logs -stderr -job "{{ job.name }}" | tail -n 100
exit 1
fi
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ job "{{ job.name }}" {
template {
data = <<-EOH
#!/usr/bin/env bash

env
set -x
{% raw %}
{{- range nomadService "datadog-agent-logs-collector" }}
{{ if contains "tcp" .Tags }}
Expand Down

0 comments on commit 760c2ac

Please sign in to comment.