Skip to content

Conversation

@Milo123459
Copy link
Collaborator

@Milo123459 Milo123459 commented Nov 26, 2025

This allows changing service source in railway environment new to either a Docker image or a GitHub repo.

If a GitHub repo is provided, a branch must also be provided. No validation is performed on Docker images due to the many forms they can come in (e.g ghcr.io/...., ubuntu, _/node:latest etc.

Examples

railway environment new foo --duplicate bar --service-sources baz github nodejs/node/master - change the source of the service baz to the GitHub repo nodejs/node/master. Note that a branch is required

railway environment new foo --duplicate bar -s baz docker ubuntu:latest - change the source to a docker image of ubuntu:latest

It also works fully interactively:

Screen.Recording.2025-11-26.at.13.48.07.mov

(note that the query for making a new environment seems to be slowing it down so much due to a change introduced waiting for the environment to be actually duplicated).

Validation is also provided for GitHub repos:

image

@Milo123459 Milo123459 added the release/minor Author minor release label Nov 26, 2025
Copy link
Contributor

@coffee-cup coffee-cup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand the usecase for this functionality. And having it tied to the railway environment new behaviour does not make sense imo. I think this would make more sense as a new command all together. This would keep the commands have a single responsibility instead of a "god" command that can do multiple unrelated things

@Milo123459
Copy link
Collaborator Author

The use case here is so that users can create pseudo PR environments that have services that actually deploy from there PR branch

@hosmelq
Copy link

hosmelq commented Dec 2, 2025

I would like to see this merged. My use case involves deploying pull requests from GitHub Actions by copying the production environment. If the source action is added as its own command, the duplicated one will deploy first with the copied environment branch, and all start-up scripts will run for that branch. I want to deploy the current pull request branch instead.

@coffee-cup
Copy link
Contributor

coffee-cup commented Dec 2, 2025

Thoughts on passing the config as JSON or something? The command railway environment new foo --duplicate bar --service-sources baz github nodejs/node/master is very unclear to me. Like I guess it is okay, but I worry about the complexity that this is adding to the CLI commands. The use case makes sense, but can we solve it in a clearer and more understandable way?

@Milo123459
Copy link
Collaborator Author

What is unclear about the usage that is currently specified? I'm not sure if parsing the config as JSON would be much better though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants