Closed olwenya closed 1 year ago
Hello, I don't know how Enterprise Github works. The check at line 378 is there because this resource uses the GitHub API, so the repo must be hosted on GitHub. Is there a way to know if a repo is hosted on enterprise Github?
@marco-m-pix4d Github Enterprise is just github hosted on enterprise servers (onprem or private cloud), for companies etc. So the host in some cases might not be github.com eg. github.mycompany.org.
All the features of github are available.
In other words, what I would like is the option to override the default host from github.com to something else, so that the api call points to our own domain.
Looking into this, there are two parts involved:
https://{hostname}/api/v3
according to Getting started with the REST API.https://{hostname}/{owner}/{repo}.git
(but also support the git ssh scheme).@olwenya could you please confirm that the only difference is the {hostname}
, both to access the API and to refer to the git remote ? See https://github.com/Pix4D/cogito/issues/51#issuecomment-1012300930
@olwenya could you please confirm that the only difference is the {hostname}, both to access the API and to refer to the git remote ? See https://github.com/Pix4D/cogito/issues/51#issuecomment-1012300930
@marco-m-pix4d , this is correct.
@marco-m-pix4d , FYI
I cloned this repo, replaced all the github.com
references with our enterprise GitHub domain, built an image and tested it. It worked! I haven't pushed the changes to my fork because the tests are broken, and I need to parameterize the GH host instead of hard coding it in.
Do you think the host should become another config option on the resource's source
(defaulting to github.com
)?
Does this line mean that for Enterprise Github (not github.com) will now work?
https://github.com/Pix4D/cogito/blob/50a9d9656fed99e13f7c83fc3487e3c3500ef687/resource/resource.go#L378