How to create a github mirror in Artifactory.
We need to install node-sass
. We have a remote npm repository which downloads node-sass but at the end it needs some b
I spent all morning fighting this and I finally got it working. The root cause is that, by default, Artifactory tries to do an HTTP HEAD request on an artifact, which does not work on GitHub CDN S3 buckets: see this issue: RTFACT-11923
As of Artifactory 5.5.2, there is now an option in the advanced configuration of "generic" repos to ignore HTTP HEAD requests. If this is checked, a generic repo can mirror GitHub releases.
I've successfully set up a mirror with the following configuration:
Create a custom layout for GitHub releases:
[orgPath]/releases/download/[baseRev]/[module].[ext]
Create a new remote repository with the "generic" type.
https://github.com/
Once you save the repository, try something like:
http://artifactory.local/artifactory/github-releases/sass/node-sass/releases/download/v4.9.0/win32-ia32-11_binding.node
Which should download that artifact and cache it for future use. You can then set SASS_BINARY_SITE to "http://artifactory.local/artifactory/github-releases/sass/node-sass/releases/download" and that should force npm install to use the cached/proxied version in Artifactory.
In theory this will work to cache any releases on GitHub, but I've not tried it for anything else yet.