cli icon indicating copy to clipboard operation
cli copied to clipboard

Add git metadata to deployments with `railway up`

Open aleksrutins opened this issue 3 years ago • 6 comments

Closes #178 (at least, it should)

This PR will add git metadata to deployments with railway up when deploying a directory with a git repository.

aleksrutins avatar Feb 18 '22 18:02 aleksrutins

Note: probably doesn't work on Windows (yet).

aleksrutins avatar Feb 18 '22 19:02 aleksrutins

@aleksrutins at least for a very basic repo it gets the correct information on windows :)

image

image

maxs-rose avatar Feb 18 '22 21:02 maxs-rose

Cool! If the repo has an origin remote on GitHub, though, Repository name is supposed to print out as user/repo instead of just the directory name, so I'm not sure if that quite works correctly. The logic for that is the most likely to be non-Windows-compatible.

aleksrutins avatar Feb 18 '22 22:02 aleksrutins

What would the API for this be? That's the only thing blocking me at this point.

aleksrutins avatar Mar 26 '22 17:03 aleksrutins

Hey @aleksrutins,

Apologies for the late reply.

After thinking about this for a while I am not sure we want this in the CLI. The problem I see is if there are unstaged changes and we incorrectly attribute the deploy with the latest commit. This could show a failing build because of some local changes but when deployed from git from the actual commit the deploy would succeed. I guess we could only add the git information if there are no local changes? Thoughts?

coffee-cup avatar Jun 07 '22 15:06 coffee-cup

Yeah, good point - I didn't think of that. I should make it only run if there are no local changes if this is going to get into the main code. I was kind of waiting until the public API docs were released at this point to continue working on this, since that's really the only thing (other than the local changes bit) left.

aleksrutins avatar Jun 07 '22 21:06 aleksrutins