Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/westonganger/capistrano-precompile-chooser
Capistrano plugin to precompile your Rails assets locally, remotely, or not at all provided with a very convenient default terminal prompt.
https://github.com/westonganger/capistrano-precompile-chooser
capistrano capistrano-deployment capistrano-plugin rails rails-assets rails-deployment rails-precompile
Last synced: 2 months ago
JSON representation
Capistrano plugin to precompile your Rails assets locally, remotely, or not at all provided with a very convenient default terminal prompt.
- Host: GitHub
- URL: https://github.com/westonganger/capistrano-precompile-chooser
- Owner: westonganger
- License: mit
- Created: 2020-08-20T05:20:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-01T00:01:10.000Z (about 1 year ago)
- Last Synced: 2024-10-04T19:17:49.811Z (3 months ago)
- Topics: capistrano, capistrano-deployment, capistrano-plugin, rails, rails-assets, rails-deployment, rails-precompile
- Language: Ruby
- Homepage:
- Size: 15.6 KB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Capistrano Precompile Chooser
Capistrano plugin to precompile your Rails assets locally, remotely, or not at all provided with a very convenient default terminal prompt.
By Default, on every deploy this plugin will prompt you on whether you want to precompile your assets locally, remotely, or not at all. Alternatively you can set some variable for fully automated deploys.
```
$ cap production deployHow do you want to compile assets? (local/remote/skip)
skip
```## Precompile Modes
- `local` - Local Precompilation Mode (Improves Memory/Load Spikes on Server during Deploys)
- `remote` - Remote Precompilation Mode (Rails Default)
- `skip` - No Precompilation (Speeds up deployments with unchanged assets)## Installation
```ruby
# Gemfilegroup :development do
gem "capistrano-precompile-chooser"
end
``````ruby
# Capfile# require 'capistrano/rails' ### Comment Out or Remove this line
require 'capistrano/precompile_chooser'
```If you want to be able to safely use the `skip` option you must add `public/assets` to your capistrano `:shared_dirs` variable
```ruby
# config/deploy.rbset :linked_dirs, %w{ public/assets }
```## Usage
Now when running a deployment:
```
$ cap production deployHow do you want to compile assets? (local/remote/skip)
skip
```You can also use the `$PRECOMPILE` environment variable
```bash
$ PRECOMPILE_MODE="local" cap production deploy
```Or for fully automated deploys
```ruby
# CapfileENV['PRECOMPILE_MODE'] = 'local'
require 'capistrano/precompile_chooser'
```## Configuration Options,
```ruby
### For Local Precompile Only
set :assets_dir, "public/assets"
set :packs_dir, "public/packs"
set :rsync_cmd, "rsync -av --delete"
set :assets_role, "web"
```# Credits
Created & Maintained by [Weston Ganger](https://westonganger.com) - [@westonganger](https://github.com/westonganger)