New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

capistrano-shared_config

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capistrano-shared_config

  • 0.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Capistrano::SharedConfig

This gem provides some capistrano tasks for config files management during deploy. With it you can:

  • Create symlinks to config files in shared directory on each deploy
  • Upload config files to shared directory from local machine on each deploy
  • Use erb and capistrano tasks binding in your config files (it will compile before uploading to server)
  • Make separate config files for each rails environment
  • Automatically create shared_path/config directory on deploy:setup

Installation

Add this line to your application's Gemfile:

gem 'capistrano-shared_config'

And then execute:

$ bundle install

Usage

Configure variables in config/deploy.rb, then require capistrano/shared_config:

set :shared_config_files, %w[settings.local nginx.conf]
set :shared_config_symlinks, %w[database, settings.local newrelic.yml] # default is same as shared_config_files

require 'capistrano/shared_config'

Notice, you may skip .yml extension when configuring configs lists (Known extensions are: .rb, .conf, .pem, .ppk and .yml).

Make sure, you require capistrano/shared_config after desired shared_config_files set

You can also configure, when to run provided tasks:

# set :run_shared_config_symlinks, [:after, 'deploy:update_code']
# set :run_shared_config_sync, [:after, 'deploy:update_code']
# set :run_early_shared_config_check, [:before, 'deploy:update_code']

require 'capistrano/shared_config'

Advanced Usage

You can call particular cap task with FILE env variable specified to upload or check only one file:

$ cap shared_config:sync FILE=newrelic

Or you can inspect content generated in config file with show task like this:

$ cap shared_config:show FILE=settings.local

It will output content of specified file surrounded by ===== lines

Config Files Lookup

For uploading to server, provided task sync use files from config directory. For every file_name in shared_config_files (after adding default .yml if needed) it try to find the following files in order:

  1. config/rails_env.file_name.erb
  2. config/rails_env.file_name
  3. config/file_name.erb
  4. config/file_name

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 02 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc