2016-08-04 39 views
0

每當我向:linked_files添加一個文件到deploy.rb,它都會上傳到共享目錄並鏈接到當前鏈接。我想繼續使用linked-files gem,但是可以選擇某些文件只是爲了鏈接而不上傳。我打算將它用於sqlite數據庫,例如 像鏈接文件沒有在capistrano上傳

set :link_only_files, fetch(:link_only_files, []).push('db/production.sqlite3') 

(我知道我應該使用PostgreSQL或MySQL在生產中,這只是一個臨時的解決方法)。

回答

0

我結束了patching the linked-files gem,並在deploy.rb

set :link_only_files, [ 
    'db/production.sqlite3' 
] 
set :linked_files, fetch(:linked_files, []).push(
    'config/database.yml', 
    [...] 
    'db/production.sqlite3' 
) 

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

誠然,這是相當damp,但我需要一個快速的解決方案。