Skip to content

docker-smoke: add smoke-command and fail-on-log-pattern, dump logs on any failure - #34

Merged
lucas-d-ramos merged 4 commits into
mainfrom
docker-smoke-smoke-command
Sep 25, 2026
Merged

lucas-d-ramos merged 4 commits into
mainfrom
docker-smoke-smoke-command

Conversation

@lucas-d-ramos

@lucas-d-ramos lucas-d-ramos commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds two optional inputs to the docker-smoke action, for the Strapi sites' frontend gate (same change wemove.eu made inline in WeMoveEU/wemove.eu#109):

  • smoke-command: shell command run after the Host-header probe succeeds, from the workspace root, with SMOKE_BASE_URL=http://localhost:<port> set. A non-zero exit fails the action. It goes through env and runs under an inner bash -eo pipefail -c, so the caller's text is never spliced into the script body.
  • fail-on-log-pattern: extended regex. After the probe and smoke-command, the action fails if docker logs ci-smoke matches it. A grep error (bad regex) also fails, rather than passing silently.

The last 200 lines of the container log are now printed whenever any step fails. That replaces the full docker logs the probe printed on its own failure.

Both inputs default to empty and their steps are skipped, so current callers (toolbox etc.) run the same steps as before.

Release after merge: v14.8.0, with v14 moved to it. README has the inputs, a sample, and the v14.8 entry.

Tested on this PR with a throwaway workflow (added in one commit, removed in the last; run 36155902199), five cases against a python:3-alpine http.server image:

  • defaults only: passes, same steps as before
  • passing smoke-command and log check: passes; the command runs from the workspace root with SMOKE_BASE_URL=http://localhost:8080
  • failing smoke-command: the action fails, the log tail is printed, the container is removed
  • log pattern that matches: the action fails and prints the matching line
  • invalid regex (unclosed: the action fails with grep failed on fail-on-log-pattern

🤖 Generated with Claude Code

lucas-d-ramos and others added 4 commits September 25, 2026 17:39
… any failure

smoke-command runs after the Host-header probe with SMOKE_BASE_URL set; a
non-zero exit fails the action. It is passed through env and run by an inner
bash, not interpolated into the script. fail-on-log-pattern fails the action
when the container log matches an extended regex. The last 200 lines of the
container log are printed when any step fails, replacing the full dump the
probe printed on its own failure.

Both inputs default to empty, so existing callers are unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…no match

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@lucas-d-ramos
lucas-d-ramos merged commit dc14041 into main Sep 25, 2026
2 checks passed
@lucas-d-ramos
lucas-d-ramos deleted the docker-smoke-smoke-command branch September 25, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant