Gemfury

This add-on is operated by Cloudfury LLC

Private Package Repo for your app's dependencies

Gemfury

Last Updated: 07 May 2015

Table of Contents

Gemfury is an add-on for hosting and installing your private and custom code packages into your Heroku app. Dividing your application into separate packages is a good practice that allows reuse and DRY‘ing of your code across teams, projects, and applications. Gemfury supports RubyGems, Python packages, and NPM modules with more in the works.

Installing the add-on

Gemfury can be attached to a Heroku application via the CLI:

$ heroku addons:create gemfury:hello
-----> Adding gemfury to sharp-mountain-4005... done, v18 (free)

Once Gemfury has been added, a GEMFURY_URL setting will be available in the app configuration. It will contain the URL to your private package server, which can be retrieved using the heroku config command.

$ heroku config:get GEMFURY_URL
https://repo.fury.io/SeCrEt-ToKeN/me/

Upload your packages

Once Gemfury is provisioned you will need to upload your package files. One way is to hit the Upload button on your Gemfury dashboard:

$ heroku addons:open gemfury
Opening gemfury for sharp-mountain-4005…

Or by using curl from the command line:

$ curl -F p1=@your-1.x.gem `heroku config:get GEMFURY_URL`
~~> Processing package upload
    your-1.x.gem ... ok

Using with Ruby, Rails, and Sinatra

Having your application pull gems from your private repository is easy. Just prepend your Gem server URL as a source in your application’s Gemfile (in addition to the original rubygems.org source).

 source 'https://repo.fury.io/SeCrEt-ToKeN/me/'
 source "https://rubygems.org"

If you're seeing problems installing packages from Gemfury, please make sure your Source URL is correct. It's important to include the trailing slash in the URL.

Using with npm and Node.js

To use Gemfury for private modules in your Node.js application, get your secret Repo-URL from the dashboard or by running:

$ echo `heroku config:get GEMFURY_URL`
https://repo.fury.io/SeCrEt-ToKeN/me/

You have two options to link your private Gemfury registry to your app – one is good for exclusively using your Gemfury account, and the other is a blend with the public index.

Use Gemfury as your only registry

If you’ve decided to stop depending on the public registry and move all your package dependencies to Gemfury, you can do a full registry switch by adding an npm configuration file to the root directory of your Heroku app.

Create the following file {app-dir}/.npmrc

registry=https://repo.fury.io/SeCrEt-ToKeN/me/
ca=

Use a blended private/public registry proxy

The above-mentioned repo.fury.io registry only offers access to packages in your Gemfury account. However, we also offer a blended-index proxy to allow you to install packages from both your account and from the public index.

Just replace the Repo-URL hostname with npm-proxy.fury.io in your {app-dir}/.npmrc

registry=https://npm-proxy.fury.io/SeCrEt-ToKeN/me/
ca=

This will prioritize your private packages and fall-back to the public registry for named packages that are not found in your Gemfury account.

Using with PHP

To use Gemfury with your PHP application, you’ll need to use your secret Repo-URL to access private packages in your repository. You can find this URL on the Gemfury dashboard or by running:

$ echo `heroku config:get GEMFURY_URL`
https://repo.fury.io/SeCrEt-ToKeN/me/

To install private packages from your app, please add the following "repositories" section to your composer.json. You will still be able to use public packages from Packagist along with the ones from your Gemfury account.

 "repositories": [{
    "type": "composer",
    "url":  "https://repo.fury.io/SeCrEt-ToKeN/me/"
 }]

Using with Python

To use Gemfury with your Python application, you’ll need to add your secret Repo-URL as an extra index. You can find this URL on the Gemfury dashboard or by running:

$ echo `heroku config:get GEMFURY_URL`
https://repo.fury.io/SeCrEt-ToKeN/me/

Deploying private packages from Gemfury is as easy as adding one line to the top of your requirements.txt You will still be able to use public packages from PyPI in addition to ones from your Gemfury account.

 --extra-index-url https://repo.fury.io/SeCrEt-ToKeN/me/
 my-package=0.0.1

Migrating between plans

Plan migrations are easy and instant. Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade gemfury:solo
-----> Upgrading gemfury:solo to sharp-mountain-4005... done, v18 ($9/mo)
       Your plan has been updated to: gemfury:solo

Removing the add-on

Gemfury can be removed via the CLI.

This will destroy all associated data and cannot be undone!

$ heroku addons:destroy gemfury
-----> Removing gemfury from sharp-mountain-4005... done, v20 (free)

Support

All Gemfury support and runtime issues should be submitted via on of the Heroku Support channels. Any non-support related issues or product feedback is welcome at support@gemfury.com or via Twitter @Gemfury.