ruby - How can I use private gems(GemFury) in a docker container? -
i'm trying run ruby scripts automating exports. since these run remotely build them in docker container , push them iron worker.
we use gemfury hosting essential private gems these scripts. keep credentials gemfury out of git use global bundle config bundle config gem.fury.io my_secret_token
.
how can set config bundle pull in gems gemfury without having them show in source control?
set global bundle config property application specific property. push changes public repository. update secret_token
value in bundle-config file ($app_dir/.bundle/config
) , run $ git update-index --assume-unchanged <file>
command remove file git tracking , prevent updating actual secret_token value in public repository.
$ bundle config --local gem.fury.io secret_token $ git commit -a -m "adding application bundle config properties" $ git push origin master $ bundle config --local gem.fury.io d1320f07ac50d1033e8ef5fbd56adf360ec103b2 $ git update-index --assume-unchanged $app_dir/.bundle/config
this creates template file on public repository. provide instructions repository contributors add secret token , execute same --assume-unchanged command.
example files
$app_dir/.bundle/config file on public github repo:
--- bundle_gem__fury__io: my_secret_token
$app_dir/.bundle/config file local machine
--- bundle_gem__fury__io: d1320f07ac50d1033e8ef5fbd56adf360ec103b2
see bundle-cofig documentation clarification , more detail
note: disadvantage approach 2 fold:
- developers clone repository , need
secret_token
value have obtain external manual process (good security practices, pain set up) - if need add more bundle-config properties, have run
git update-index --no-assume-unchanged <file>
enable tracking, , revert of private values pseudo values. template method, risks contributors forget disable tracking on file , push private values public repo (but @ least won't secret values)
the advantage of template approach giving developers as possible able start contributing repository.
Comments
Post a Comment