Skip to content

ci: add an final step that upload build logs

Administrator requested to merge devx/ci-logs-in-loki into main

Created by: jhchabran

See #25562 (closed)

This works by adding a final step that depends on every other step and allowing failures, which will ensure that this step is always run, independently of any "wait" step. I tried other approaches, such as using a wait step that allows for failures but it will be circumvented by any normal wait step, a job exit hook but that is run on every job so that won't work either.

Another viable approach would be to individually upload at the end of every job (step) but that would make things a bit noisier than this and would require adding this feature to sg ci logs, to be able to send just a given step logs.

The LOKI_URL variable is not set and I used a locally deployed Loki during all my tests.

An example build is here (ignore the missing LOKI_URL, I had tested it earlier and it works as intended): https://buildkite.com/sourcegraph/sourcegraph/builds/112549#050a8398-3057-466b-995f-3230f0040f9f

Merge request reports

Loading