Socket
Book a DemoInstallSign in
Socket

capistrano-linked-files

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capistrano-linked-files

1.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

capistrano-linked-files

Gem Version Build Status Code Climate Coverage Status Dependency Status

This gem provides Capistrano 3.1 reciepes to upload your linked files and directories. It's quite useful for files such as config/database.yml and config/secrets.yml, which are usually ignored (at least they should be) from version control systems.

Linked files and directories are placed in the shared directory on your remote servers and kept between deployments. After a new deployment, a symlink is created from the shared directory to the current directory.

Inspiration was found in damselem's capistrano-shared-files, but capistrano-linked-files uses the "built in" Capistrano configuration variables linked_files and linked_dirs instead of custom ones. This way it's not necessary to specify your linked files twice.

Installation

Add the gem to your Gemfile:

gem 'capistrano-linked-files'

Or install it to your system:

$ gem install capistrano-linked-files

Usage

Add the gem to your Capfile:

require 'capistrano/linked_files'

In deploy.rb, list the files and directories you'd like to keep between deployments:

set :linked_files, %w(config/database.yml config/secrets.yml)
set :linked_dirs, %w(bin log tmp)

Then run the task:

$ bundle exec cap <STAGE> linked_files:upload

By default, the listed files and directories are uploaded to all server roles. You may change this by doing the following:

# Set upload roles using symbols
set :upload_roles, :all

# Set upload roles using arrays
set :upload_roles, %w(web app)

If you only want to upload files or dirs, then run the tasks accordingly:

$ bundle exec cap <STAGE> linked_files:upload_files
$ bundle exec cap <STAGE> linked_files:upload_dirs

To automatically upload linked files and directories after a new deployment, add the following to your deploy.rb:

# Uploading both linked_files and dirs
before :finishing, 'linked_files:upload'

# Uploading only linked_files
before :finishing, 'linked_files:upload_files'

# Uploading only dirs
before :finishing, 'linked_files:upload_dirs'

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

License

The capistrano-linked-files plugin is free software released under the MIT License. See LICENSE for details.

FAQs

Package last updated on 26 Jun 2016

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.