Skip to content

Add --ci Flag to redeploy Command for Restart-Only with Health Check Wait #616

@yigitkonur

Description

@yigitkonur

Problem

Currently, the redeploy command redeploys the latest deployment of a service, but it lacks a --ci flag (or similar) to optimize it for CI/CD workflows where only a container restart is needed without pulling a new image. In my use case, I update an S3 file in a GitHub Actions workflow and want to restart the container to pick up the new file, then wait until health checks complete to verify if the updated S3 file works correctly or fails. The existing redeploy command pulls the image again, which is unnecessary overhead, and there’s no way to ensure it waits for health checks in a CI-friendly way.

Proposed Solution

Add a --ci flag (or similar, e.g., --restart-only) to the redeploy command that:

  1. Restarts the existing container without pulling a new image (similar to the web UI’s "Restart" action).
  2. Waits until health checks complete before returning, ensuring the CI pipeline can verify the deployment’s success or failure based on the updated S3 file.

Example Usage

railway redeploy --service=my-service --ci
  • Restarts the container.
  • Waits for health checks to pass/fail.
  • Exits with a success/failure code for CI/CD integration.

Why This Matters

This would streamline CI/CD workflows where external resources (like S3 files) are updated, avoiding unnecessary image redeploys and ensuring health check validation, which is critical for confirming functionality without relying on fixed sleep commands.

Current Workaround

Using railway redeploy works but pulls the image again, adding overhead. There’s no CLI equivalent to a simple restart, and no built-in way to wait for health checks explicitly in CI.

Additional Context

Thanks for considering this enhancement!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions