#Deployment
Rapid Rails Themes is easily deployable. It works out of the box on Heroku (as long as you remember to set your credentials as described on the Installation page).
#Capistrano
There is some slight tweaking you'll have to do to your
deploy.rb
to have Capistrano tell bundler how to set your credentials on the machine you're deploying to. This step takes the form of calling bundler config gems.kiso.io <your_credentials>
before Capistrano executes the bundler:install
hook.In your
deploy.rb
you'll want to create a task
for setting up the execution:namespace :deploy do task :prepare_bundle_config do # Potentially change the role here to whatever is suitable for you on roles(:app) do # This command is using an rbenv Cap variable which was set like this: # set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec" # But your circumstance may be different, so configure accordingly execute "#{fetch :rbenv_prefix} bundle config gems.kiso.io <YOUR_CREDENTIALS_GO_HERE>" end end end
!warning Don't leak your credentials! Be careful not to just paste your credentials into your deploy.rb - use some engineering and pull that from an environment varaible.
Next, you want to hook onto the
bundler:install
Capistrano hook:namespace :deploy do before 'bundler:install', 'deploy:prepare_bundle_config' end
When you attempt a deploy, you should see in the deploy logs that Capistrano executes the
prepare_bundler_config
task before running bunlder:install
- thus setting your credentials on your deploy machine.#Heroku
If you're using Heroku, you need to set a special Environment variable as well, by running this on the command line:
heroku config:set BUNDLE_GEMS__KISO__IO=<SUBSTITUTE_YOUR_CREDENTIALS_HERE>
If you're using Review Apps, make sure to read the Heroku documentation on inheriting config vars and
ensure that you setup the
BUNDLE_GEMS__KISO__IO
environment
variable is required.