Geminabox: Simple private RubyGems server on your own host
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 gemsmyuser- usernamemypassword- 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:
- copy your
GemfileandGemfile.lockto a temorary folder - resolve dependencies on your machine (with your ruby version and your environment)
- download proper gems versions from sources in your
Gemfile(typically from rubygems.org) - upload gems to your geminabox repository
- delete temporary folder
Written with StackEdit.
Comments
Post a Comment