
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
a capistrano recipe to manage configurations files.
Add this line to your application's Gemfile:
gem 'capistrano-config'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-config
This recipes will try to update application config during Capistrano deploy
tasks.
To enable this recipe, add following in your config/deploy.rb
.
The configuration file config/config.yml
will be generated from template in config/templates
by default.
(The template will be used is either config/templates/config/config.yml.erb
or config/templates/config/config.yml
.)
# config/deploy.rb
require "capistrano-config"
set :config_files, ["config/config.yml"]
You might not want to generate configuration files on everytime of deployment.
There is shared mode to generate configuration files just once during deploy:setup
.
This is the configuration example for shared configuration mode.
# config/deploy.rb
set :config_use_shared, true
set :config_files, ["config/config.yml"]
The generated configuration files will be installed in #{shared_path}/config/config.yml
during deploy:setup
.
After the setup of shared configuration, symlink will be created at #{release_path}/config/config.yml
during deploy
.
If you want to update the shared configuration files, invoke config:setup
will do that.
% cap config:setup
With some build system, you might need to update some of local files during deployment. There is local mode to help you.
This is the configuration example for local configuration mode.
# config/deploy.rb
set :config_update_locally, true
set :config_files, ["config/config.yml"]
The local configuration files will be updated during deploy
.
You can set file parameters for each files with defining :config_files
as a Hash.
The value of Hash will be passed to safe_put
of capistrano-file-transfer-ext.
# config/deploy.rb
set :config_files do
{
"config/secret.yml" => { :owner => "user", :group => "user", :mode => "640" }
}
end
If you want to apply for all configuration files, you can use :config_files_options
.
set :config_files, ["config/secret.yml", "config/credentials.yml"]
set :config_files_options, :owner => "user", :group => "user", :mode => "640"
If the configuration file name starts with "/", it will be treated as absolute path.
# config/deploy.rb
set :config_files do
{
"/etc/init/foo.cnf" => { :configure_except => :local, :owner => "root", :group => "root", :mode => "644", :run_method => :sudo },
}
end
These options are available to manage your configuration files.
:config_files
- the definition of configuration files as in an array or a hash.
if given as hash, the key should be the value should be the file options.:config_update_remotely
- specify whether update config files on remote machines or not. true
by default.:config_update_locally
- specify whether update config files on local machines or not. false
by default.:config_use_shared
- set true
if you want to use shared config. false
by default.:config_path
- specify configuration base directory on remote machines. use release_path
by default.:config_path_local
- specify configuration base directory on local machine. use .
by default.:config_template_path
- specify configuration template directory on local machine. use config/templates
by default.:config_files_options
- the hash to be used as parameters for configuration files.git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)MIT
FAQs
Unknown package
We found that capistrano-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.