So we have started setting up quite a few engines and normal rails gems that are private repos. Because these are private repositories, I knew it was going to be a different setup
It's pretty easy to setup.
Gemfile stays the same, reference the git repo as usual.
gem 'frefnet', git: "https://github.com/Webbernet/frefnet"
If you run bundle install with this, you will receive an error because its a private repo.
To fix this we need to add an oauth key to the bundler config.
Generate a personal outh key from your github account, with private repo access
Add it to your config with, and thats it!
bundle config github.com <GITHUB-USERNAME>:93921321939MYAUTHTOKEN2131231
I needed to also set this up on our CI for our production boxes.
I had to change
These are the changes I made:
ARG github_tokeninside the Dockerfile. This allows me to pass in a github token when building the dockerfile
bundle installline in the Dockerfile to:
ruby RUN bundle config github.com deploywebbernet:$github_token && (bundle install --without test development) && bundle config --delete github.comThis does a bundle install with the token, and then removes the token so it doesn't sit in the Container.
--build-argflag to the
ruby docker build -f ci-Dockerfile-Chromium --build-arg github_token=$PRIVATE_GEM_GITHUB_TOKEN -t tester .