Remotes for GHE endpoints

travis-ci

#1

Is it possible to define Remotes: for a GHE repo so I can use it in my travis build? or is remotes only for public endpoints?


#2

I think you can use Remote field for any remote thta is compatible with devtools. As you can install from private repo, i believe you can use a private remote. However, a GITHUB PAT must be set to access the package.

Have you tried already ? Have you some issues with a private remote in DESCRIPTION Remote filed ?

remotes is currently becoming the reference :package: for installation, replacing devtools old function by remotes ones in dev version of devtool. Curious if it works.


#3

This really depends on how you are authenticating with the GitHub Enterprise repository and what remote type you are using.

If you are using the GitHub remote this will likely only work if the GitHub host of the Remote matches that of the main repository, e.g. I don't think there is a way to have the main package live on normal GitHub, and the remote package live on the GHE instance. If they both live on the same GHE instance than it should work provided you supply the host to devtools::install_github().

An alternative would be to use the Git remote. In this case you would need to provide the necessary credentials to either command line git via ssh or to git2r with the credentials = argument.

A third alternative would be to use the url remote and give the location of the zipball / tarball for the GHE repository. This would only require you to have access to that URL in some way.

Unfortunately when we designed the Remotes field we decided not to provide support for passing additional arguments to the remotes, which makes these types of issues tricky.

For a travis build in this situation I think the best solution would be to not use the Remotes field, and instead call the appropriate install_*() function separately in a before_script step. e.g.

before_script: R -e 'devtools::install_github("foo/bar", host = "github.mycompany.com/api/v3")

#4

Also, this is not a solution but this is related, ghentr :package: is a nice helper to deal with Github Entreprise


#5

i used before_install as a failsafe, but hoped there was a more elegant way via the DESCRIPTION file. Will that get picked up by the package cache in travis to save time on subsequent builds?

Thanks for the thorough response


#6

I have been using remotes exclusively for a while now it works great. I can install from ghe using it effectively. But in travis it’s a challenge.

Thanks for the response!


#7

Ghentr is really nice, but found it’s a wrapper on remotes that I don’t need day to day.