Skip to content

Make s/build-prod-images.sh runnable unattended (CI) - #749

Open
IvanTheGeek wants to merge 1 commit into
debiki:mainfrom
IvanTheGeek:fix-build-script-unattended
Open

Make s/build-prod-images.sh runnable unattended (CI)#749
IvanTheGeek wants to merge 1 commit into
debiki:mainfrom
IvanTheGeek:fix-build-script-unattended

Conversation

@IvanTheGeek

Copy link
Copy Markdown

Three small fixes so make prod-images variants can run with no human at the keyboard:

  1. The Continue [y/n]? prompt is skipped when TY_NONINTERACTIVE is set or stdin isn't a tty — in CI the read just fails or hangs.
  2. The wait-for-Selenium loop (until curl :4444) is skipped when --skip-e2e-tests is passed — it blocked forever waiting for a browser that run would never use.
  3. The exit-code line: build_exit_code was only assigned in a commented-out line, so Build result: ..., exit code: always printed empty. Now both files are read (and a missing status file doesn't crash the script).

Interactive behavior is unchanged (tty + no env var ⇒ same prompt, same Selenium wait when e2e runs).

Tested: make prod-images-skip-build-and-e2e-test runs end-to-end unattended to Build result: BUILD_OK, exit code: 0 inside a tty-less container.

Part of the same Docker-only-build/CI work as #747 and #748.

🤖 Generated with Claude Code

Three small fixes so the prod build can run without a human at the
keyboard:

- Skip the 'Continue [y/n]?' confirmation when TY_NONINTERACTIVE is set
  or stdin isn't a tty — in CI the read would just fail or hang.
- Skip the wait-for-Selenium-on-:4444 loop when --skip-e2e-tests is
  passed: the build blocked forever waiting for a browser that the run
  would never use.
- Actually read target/build-exit-code — the assignment was commented
  out, so the 'Build result: ..., exit code:' line always printed an
  empty exit code; also tolerate a missing status file instead of
  crashing on cat.

No behavior change for interactive use: with a tty and no
TY_NONINTERACTIVE, the y/n prompt and (when e2e will run) the Selenium
wait behave as before.

Tested: 'make prod-images-skip-build-and-e2e-test' now runs end-to-end
unattended to 'Build result: BUILD_OK, exit code: 0' (inside a container
with no tty).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

I, Ivan Rainbolt <talkyard@github-commits.ivanthegeek.com>, agree to the Contributor License Agreement, docs/CLA-v2.txt.
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