Files like database.yml
, secrets.yml
and Rails Rails.application.config_for(:somefile)
yaml files can be provided by this role.
rails_provisioned_files:
- file: config/database.yml
yaml:
production:
adapter: postgresql
database: '{{rails_database_name}}'
encoding: UTF8
pool: 30
- file: config/database.yml
yaml:
production:
secret_key_base: '...'
twitter_api_key: '...'
Those file will be placed relativ to the shared folders and symlinked into the release/current folders.
Just set this variable in your provisioning/deployment:
rails_webpacker: yes
This will:
- (this role) Export these files from git in addition to the defaults: yarn.lock package.json .babelrc .postcssrc.yml
- (this role) Keep/Symlink public/packs and node_modules between deployments
- (asset precompilation)
rake yarn:install
is run byrails assets:precompile
(from +5.1), if a bin/yarn binstub is provided. NOTE without that binstub no node_modules are installed! Make sure to add it withrails app:update:bin
and commit to your app repo.
You might also want to include the yarn Installs nodejs + yarn (default nodejs-6.x) role in your provisioning before, to install required nodejs + yarn.