How to Configure a Bower Repository that Pulls from a Private GitHub Enterprise Repository

How to Configure a Bower Repository that Pulls from a Private GitHub Enterprise Repository

AuthorFullName__c
Vignesh Surendrababu
articleNumber
000002816
ft:sourceType
Salesforce
FirstPublishedDate
2016-11-21T15:16:04Z
lastModifiedDate
2023-02-26T19:26:54Z
VersionNumber
6

Follow these steps:

1. Create and configure a remote bower repository

Create a remote repository that references the GitHub Enterprise. You will want to change the URL to your GitHub Enterprise URL, the Git provider to Custom, the Download URL to {0}/{1}/archive/{2}.{3}, the Registry URL to the GitHub Enterprise URL (to avoid ambiguity). For example, if your GitHub Enterprise was accessible at https://gitent.jfrog.info, your configuration would look like this:
User-added image


Note: If your packages are password protected, set the username/password in the Advanced tab.

2. Register the packages 

Note: This step assumes you’ve already installed and configured your Bower clients to work with Artifactory, as explained HERE.

You’ll only have to register the packages once. Registration tells Artifactory where to get a package from. Instructions for registering Bower packages can be found HERE

Looking at the example above, if you had a package located at:
https://gitent.jfrog.info/soleng1/bower-d3

you could register it with whatever name you wanted. However, for the sake of clarity, it’s better for this name to match what’s in your bower.json.
Thus, in this instance you’d use the name d3, using the naming command as follows:
bower register d3 https://gitent.jfrog.info/soleng1/bower-d3.git

Thereafter, you’d receive the following message:

Registering a package will make it installable via the registry (http://admin:password@192.168.99.100:8081/artifactory/api/bower/bower), continue?

to which you’d answer: Yes.

Thereafter, run bower info d3 to list your available versions.

3. Perform your Bower install

After registering your packages, they should be available to any Bower client that is set up to work with your Artifactory repository. You won’t need to register them again unless the location of any given package changes. Your Bower installation will be performed as follows:

root@38b8ed48cc9c:/data# bower install d3

bower d3#* not-cached art://soleng1/d3#*

bower d3#*  resolve art://soleng1/d3#*

bower d3#* resolved art://soleng1/d3#master

bower d3#~0.0.0 install d3#master