paulirish / git-open

Type `git open` to open the GitHub page or website for a repository in your browser.
MIT License
3.31k stars 247 forks source link

[Feature Request] Open CI URL #146

Open arunvelsriram opened 5 years ago

arunvelsriram commented 5 years ago

Add a flag to open CI/CD tool URL:

git open --cx

Based on the contents of the repo we could identify the CI URLs. However, there are a lot of limitations. For travis, circleci etc. we could identify the URL easily but for self-hosted CI/CD tools like GoCD, Jenkins it will be difficult.

Adding this idea here so that someone could come up with a better way to do it. Let me know if this feature makes sense.

ffes commented 5 years ago

Since GitLab has CI/CD build in adding /pipelines to the base url of the repo gets the job done.

For travis, circleci etc. we could identify the URL easily...

How?

jormaechea commented 4 years ago

This would be really nice. Now Github has Github Actions (adding /actions to the base url) And Bitbucket has Bitbucket Pipelines (adding /addon/pipelines/home to the base url).

Would you consider a PR for this? :smile:

Edit: If .travis.yml file is present, ir could open https://travis-ci.org/{username}/{repo} I guess that CircleCI and other SaaS CI providers have similar behaviours.

ffes commented 4 years ago

If .travis.yml file is present, ir could open https://travis-ci.org/{username}/{repo}

Not sure is there is an easy way for the batch script to check if the file exists in the root of the project. You can be a couple of subdirectories deep. As far as I know git ls-files doesn't help you with that either.

jormaechea commented 4 years ago

I made some googling and git rev-parse --show-toplevel should do the trick to get the root dir of the repo.

Edit: typo