Does FluxGlow work with GitLab CI, CircleCI, Buildkite or Azure Pipelines?
Yes. FluxGlow has no integrations, so there are none to wait for. Any CI system that can run a shell command at the end of a pipeline can write a board file and upload it.
The pattern
- Add a last step that runs even when an earlier one has failed.
- In it, write a board file that says how each step ended.
- Copy the file to somewhere a browser can read it.
Running a step after a failure
Every CI tool stops at the first failure unless told otherwise, and every one has a way to say otherwise:
| Tool | How to make a step always run |
|---|---|
| GitHub Actions | if: always() on the job or step. See the complete GitHub Actions example. |
| Jenkins | A post { always { } } block. See the complete Jenkinsfile. |
| GitLab CI | when: always on a job in the last stage. |
| CircleCI | when: always on a step. |
| Buildkite | A step with depends_on and allow_dependency_failure: true. |
| Azure Pipelines | condition: always() on the step or job. |
Knowing how each step ended
This is the part that differs most between tools, because each has its own way of passing results from one job to the next. One way works everywhere: run the steps from a single script, and let the script keep score.
#!/bin/sh
# Runs three steps in order, then writes a board that says how far they got.
build=idle test=idle deploy=idle
if make build; then
build=ok
if make test; then
test=ok
if make deploy; then deploy=ok; else deploy=bad; fi
else
test=bad
fi
else
build=bad
fi
cat > board.json <<EOF
{
"title": "Checkout pipeline",
"tag": "Build # ${BUILD_NUMBER:-0}",
"nodes": [
{ "id": "build", "label": "Build", "state": "$build" },
{ "id": "test", "label": "Test", "state": "$test", "after": ["build"] },
{ "id": "deploy", "label": "Deploy", "state": "$deploy", "after": ["test"] }
]
}
EOF
# Upload board.json here. Then pass the pipeline's own result back to the CI tool.
[ "$deploy" = ok ]The script runs as one job in any CI tool. It writes the board whichever step fails, and its last line hands the true result back, so the CI tool still marks the run as passed or failed.
Showing a run in progress
To turn an orb blue while its step runs, write the file before the step as well as after, with that node's state set to run. The board reads the file every 15 seconds, so steps that take less time than that will go by unseen.
One file, one writer
A board file is replaced whole each time, so whatever writes it has to know the state of every node. That is why the board is written at the end of the pipeline, where everything is known, rather than by each job separately.
The API planned at fluxglow.io is meant to lift that limit, letting each job change its own orb with one request. It is not open yet.
Related questions
-
How do I show GitHub Actions status on a wall monitor?
Add one job to the end of your workflow. It turns the result of each job into a board file and pushes it to a branch of the same repository, and FluxGlow reads the file from there. There are no secrets to set up and nothing else to host.
-
How do I make a Jenkins build monitor for a wall screen?
Have each stage of the pipeline record whether it passed, then write a board file in a post step that always runs, and copy it somewhere a browser can read. No Jenkins plugin is involved.
-
How do I write a board file from Python, JavaScript, Go, Ruby, PHP or a shell script?
Build the board as an ordinary dictionary, object or struct, turn it into JSON with the language's own JSON library, and write it to a file. There is no SDK to install, because there is nothing to call.