Either use a hosted private gem repository such as Gemfury, or follow this procedure:
First you will need to get an OAuth Token from GitHub using your own username and "note"
curl -u 'masonforest' -d '{"scopes":["repo"], "note":"Semaphore CI private gem"}' https://api.github.com/authorizations
Add this line to your Gemfile replacing "your_token" with the token you got from first step. In this example we are installing the 'ventana' gem:
gem 'ventana', git: "https://your_token:x-oauth-basic@github.com/renderedtext/ventana.git"
For additional security you can store your OAuth token in an environment variable. This way your token is not included in your codebase which is insecure. However this technique require form you to export OAuth token in your development environment too (Best way is to export it in ~/.zshrc or ~/.bashrc).
Change the line in your Gemfile to
gem 'ventana', git: "https://#{ENV['GITHUB_TOKEN']}:x-oauth-basic@github.com/thoughtbot/ventana.git"
Then export token on Semaphore using the token you got from above:
export GITHUB_TOKEN=your_token
Now bundle localy and you are ready to build on Semaphore!
As of November 2013 Semaphore supports saving and using configuration files, including SSH keys. Follow this guide to set up an additional SSH key which can give your build or deploy permissions to pull private dependencies.
Since the Git client uses only the first key from the ssh-agent we'd like to suggest using one of the methods listed above.
If project's dependencies are hosted on the Github, you can enable Semaphore environment to fetch repositories with these steps:
Semaphore Docs are open source — Edit on GitHub
2009-2019 © Rendered Text. All rights reserved. Terms of Service, Privacy policy, Security.