railwayapp / cli

Railway CLI
https://railway.app
MIT License
314 stars 80 forks source link

Fix CI mode immediate exit #536

Closed maddsua closed 3 weeks ago

maddsua commented 1 month ago

Fixes premature "up" command exit in non-interactive environemnts

Cause:

An if statement at: https://github.com/railwayapp/cli/blob/f2d2b07238d2814fa2f85807bbfb6ee61bb2d64a/src/commands/up.rs#L323 doesn't take into account that CI environments would be detected as "not terminal" which in turn short circuits the CI mode.

Changes

  1. Check for CI mode as well before exiting if "not in terminal".
  2. Detect CI=true env variable that is set by every major CI provider/runner.
  3. Log "CI mode enabled" message to clearly indicate current command behavior.
  4. CLI in CI mode will exit with error if it can't stream build logs
  5. Updated readme and help strings to reflect changes to CI mode
brody192 commented 3 weeks ago

Closing in favor of #537