How to Set Up private-bower with GitLab-Based Source Code

How to Set Up private-bower with GitLab-Based Source Code

AuthorFullName__c
JFrog Support
articleNumber
000001365
ft:sourceType
Salesforce
FirstPublishedDate
2016-10-06T13:38:18Z
lastModifiedDate
2021-02-12
VersionNumber
5
  1. Install private-bower
    • Click HERE 
    • Your installation will look like this:​​​​​​

    • Using the UI, add your packages to private-bower
  2. Configure Artifactory
    • Login as admin
    • Create three repositories 
      • Remote public bower repo (see #3 below)
      • Remote private bower repo (see #4 below)
      • Virtual bower repo (see #5 below)
  3. Create a public bower repo
    • In Artifactory 7.x, navigate to Administration > Repositories tab > Repositories > Add Repositories -> Remote Repository (in Artifactory versions 6.x and under, navigate to the Admin tab > Remote > New > Bower)
    • Use the settings shown in the following screenshot:

    • Click Save & Finish
  4. Create a private bower repo
    • In Artifactory 7.x, navigate to Administration > Repositories tab > Repositories > Add Repositories -> Remote Repository (in Artifactory versions 6.x and under, navigate to the Admin tab > Remote > New > Bower)
    • Use the settings shown in the following screenshot, but make the modifications specified in the next four bullet points: 
    • Change the URL from https://github.com/ to your GitLab URL
    • Change the Git Provider from GitHub to Custom
    • Change the Download URL to {0}/{1}/repository/archive.{3}?ref={2}
    • Change the Registry URL from https://bower.herokuapp.com to your private-bower URL (e.g., http://10.60.1.94:5678)
    • Click Save & Finish
  5. Create a virtual bower repo
    • In Artifactory 7.x, navigate to Administration > Repositories tab > Repositories > Add Repositories -> Remote Repository (in Artifactory versions 6.x and under, navigate to the Admin tab > Remote > New > Bower)
    • As shown on the bottom righthand side of the screenshot below, under Available Repositories, select bower-remote-public and bower-remote-private, and move them to the Selected Repositories field. 
    • Click Save & Finish
  6. Configure private-bower to Use Your virtual-remote-bower repository
    • Navigate to Artifacts > virtual-remote-bower (which will be found in your Artifactory Repository browser)
    • Click on Set Me Up and follow the instructions provided there
    • In your .bowerrc file, replace the default private-bower registry with the following:

      { "registry" : "http://10.60.1.94:8081/artifactory/api/bower/virtual-remote-bower", "resolvers" : [ "bower-art-resolver" ] }
  7. Take your setup for a test drive

  • Run the following command:

    bower install bower-gitlab-demo

    Thereafter, you should see something similar to the following screenshot:

  • Now run this command:

    bower install angular 
    
  • Thereafter, you should see something similar to the following screenshot: