Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update railway add #570

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Update railway add #570

merged 3 commits into from
Nov 5, 2024

Conversation

Milo123459
Copy link
Collaborator

@Milo123459 Milo123459 commented Oct 24, 2024

This allows users to create services and databases in the linked project and environment, with similar options to the + Create menu found within the project canvas.

Changes and improvements are outlined below.

image

image image

@Milo123459 Milo123459 added the release/minor Author minor release label Oct 24, 2024
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.

Could we reuse the railway add command to cut down on the number of commands a user has to remember.

We could add options for empty service, docker image, and github repo. Right now railway create just makes an empty service and it would be nice if you could do something like railway add --name my-service --repo {pasted github link}. Or if you just do railway add you are prompted all the way through the process.

@brody192
Copy link
Contributor

brody192 commented Oct 24, 2024

I agree having add as a single way of adding any kind of service(s) -- eventually bringing feature parity with the + Create modal in the project canvas.

For now, I think the format of railway add --service hello-world would fit best with how railway add currently works.

railway add --service -> Creates an empty service with a random name.
railway add --service hello-world -> Creates an empty service with the specified name.

And you can provide either a --repo or an --image flag to set the source, omitting them creates an empty service.

railway add --service hello-world --repo "brody192/hello-world" -> Creates a service that deploys from the given repo with the specified name.
railway add --service hello-world --image ubuntu -> Creates a service that deploys from the given image with the specified name.

Additionally, you would also be able to pass --variables to the --service flag in k=v format.

railway add --service hello-world --variables "VARIABLE=VALUE" -> Creates an empty service with the specified name and the specified variable(s).

For the interactive flow when running just railway add it should prompt similarly to how the + Create button does.

GitHub Repo
Database
Docker Image
Empty Service

With all the same flag-based functionality but fully interactive.

We can worry about deploying templates via railway add at a later time.

Why though?

This brings us a few steps closer to parity with the dashboard, meaning if you love the terminal you now can stay in it a little longer!

But for a real world scenario, this allows users to add variables to a service prior to deployment, this means less unnecessary redeployments due to having to add variables via the dashboard and then redeploy.

@brody192 brody192 changed the title Add railway service create command [WIP] Add railway service create command Oct 29, 2024
@brody192 brody192 changed the title [WIP] Add railway service create command [WIP] Update railway add Nov 1, 2024
@brody192 brody192 changed the title [WIP] Update railway add [WIP] Update railway add Nov 1, 2024
@brody192 brody192 changed the title [WIP] Update railway add Update railway add Nov 5, 2024
add a progress bar for creating the service

specifies branch to make sure that github repos automatically get a deployment started

cleans up some macros
@Milo123459 Milo123459 merged commit ec4b76f into master Nov 5, 2024
6 checks passed
@Milo123459 Milo123459 deleted the milo/create-service branch November 5, 2024 16:52
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.

4 participants