Installation
Uchi can be installed as a gem directly from our private gem server.
Installing Uchi requires a license with a gem server token for that project. Licenses can be purchased at uchiadmin.com and the gem server token can be found on uchiadmin.com/projects.
Authenticate with the gem server
You have a few options for authentication with the gem server. We recommend using an ENV variable configured for each project.
Using an ENV variable
The benefit of using an environment variable is that it’s the same process across your deployments - both development, CI, and production are likely to have support for ENV variables.
export BUNDLE_GEMS__UCHIADMIN__COM=<your_token_goes_here>
You cannot store the variable in .env or similar and expect dotenv to load it for you. dotenv isn’t loaded by bundler thus the ENV variable isn’t available when installing.
Using Bundler config
Alternatively, you can store the gem server token in your bundler config:
bundle config set gems.uchiadmin.com <your_token_goes_here>
With this in place, bundler should be able to install the gem.
Install the gem
Add the gem to your application’s Gemfile:
gem "uchi", source: "https://gems.uchiadmin.com"
And then execute:
$ bundle install
Authenticate on servers
All servers that install gems need to be granted access to Uchi’s gem server. That usually means your CI server and your production servers. Obviously the process is quite dependent on the exact setup you’re running.
Circle CI
Circle CI stores environment variables for each project and makes them available to all pipelines in the project.
Go to your "Project settings" (They are linked to from the projects Overview page).
Go to "Environment Variables"
Click the "Add" button to add a new environment variable
| Name | Value |
|---|---|
BUNDLE_GEMS__UCHIADMIN__COM |
Your gem server token |
Click "Add environment variable"
The environment variable is now available in your pipelines without having to do anything extra and everything should just work.
GitHub Actions
On GitHub Actions you can add environment variables to your workflows fairly easily. However, you should treat your private gem server token as a secret, and therefore not expose it publicly. So for this we want to use GitHub Secrets.
Under your project's "Settings" in GitHub, go to "Secrets and variables" > "Actions" in the menu.
Add a "New repository secret"
Enter your credentials
| Name | Secret |
|---|---|
BUNDLE_GEMS__UCHIADMIN__COM |
Your gem server token |
Click "Add secret"
Now you can use that secret in your workflows:
name: "Build"
env:
BUNDLE_GEMS__UCHIADMIN__COM: ${{ secrets.BUNDLE_GEMS__UCHIADMIN__COM }}
jobs:
# ...
Read more about using secrets in workflows.
Heroku
The simplest way to grant your app on Heroku access to Uchi gems is using the CLI:
heroku config:set BUNDLE_GEMS__UCHIADMIN__COM=<your gem server token>
Alternatively you can use the UI for it:
Go to your project overview.
Open the "Settings" tab.
Under "Config Vars" click "Reveal Config Vars"
At the bottom of the list of config variables, add the following:
| Key | Value |
|---|---|
BUNDLE_GEMS__UCHIADMIN__COM |
Your gem server token |
Click "Add"
Heroku should now rerelease your application with the new environment variable made available to your processes.