Geminabox: Simple private RubyGems server on your own host

enter image description here

Deploy private RubyGems repository

You can easily setup private RubyGems repository with authentication from geminabox Docker image:

docker run -d -v /path_where_to_store_gems:/webapps/geminabox/data --name geminabox -p 9292:9292 -P -h geminabox -e PRIVATE=true -e USERNAME=myuser -e PASSWORD=mypassword spoonest/geminabox:latest

don’t forget to change:

  • /path_where_to_store_gems - path on your local machine where you want to store your gems
  • myuser - username
  • mypassword - password

Read more about geminabox repository on GitHub.

That’s all. Your repository is accessible by url http://YOUR_HOST:9292.
Now you can use it to store you own gems you don’t want to share.

Don’t forget to visit geminabox page for more information about this Docker image!

Installing gems form your private repository

Add following line at the top of your Gemfile:

source 'http://myuser:mypassword@YOUR_HOST:9292'

… and use bundle install as usual.

Backup your project gems to your local repository

Let me share with your gemtoabox gem. This gem provides the ability to backup your project gems (with all dependencies) to the private RubyGem hosting on remote or local machine. Just run executable:

bin/gemtoabox --gemfile /your_project/Gemfile --host http://<USER>:<PASSWORD>@<HOST>:<PORT>

After that gemtoabox do the following:

  1. copy your Gemfile and Gemfile.lock to a temorary folder
  2. resolve dependencies on your machine (with your ruby version and your environment)
  3. download proper gems versions from sources in your Gemfile (typically from rubygems.org)
  4. upload gems to your geminabox repository
  5. delete temporary folder

Written with StackEdit.

Comments

Popular posts from this blog

Gedit: make links clickable (with Ruby script)

Using Jenkins as HTTP server for your custom HTML