1

Concourse Fly CLI had the build command which only lists the status and ID from the last N builds.

Is there a way to get the task that made the job fail for a particular build? And maybe also the output for failure details?

Or do you know another trick or workaround how to extract this from a job?

(I would avoid having to scrape fly hijack command output or the Concourse UI build HTML page).

Maybe a solution with a job "side car" resource that somehow gathers logs?

(I am using job hooks and I would also try to avoid spamming the job plans with task on_success hooks. But would such task hooks have access to the current succeeded task? This could enable one to generate a log of tasks using a put step inside the task hook.)

Gabriel Petrovay
  • 20,476
  • 22
  • 97
  • 168
  • It will require little more context what you are trying to do. But to sum up i can say, one way is to generate log by your own, example if your task is running any command put into in script file and redirect log of your command in some text file and on_failure hook of task put log file in some s3 resource if your task will fail so that by seeing that log file you can debug and second way you already mentioned by running fly intercept command to jump into fail task container and debug. And yes on_success/on_failure hooks would have access to the current task. – Anshita Singh Apr 10 '20 at 16:22
  • I have a current working solution where all tasks are called via a wrapper script that does some output redirecting magic if some task environment variables are available. The same script also writes a file with the task name (if this was provided as an environment variable). Like this I can get the log AND the task name. But this assumes I have to hardcode the task name in each task definition (i.e. duplicate) – Gabriel Petrovay Apr 12 '20 at 16:07

0 Answers0