Template of a custom feed generator service for the Bluesky network in Ruby
1# TODO: migrate to capistrano3 bundler integration
2require 'bundler/capistrano'
3set :bundle_dir, ''
4set :bundle_flags, '--quiet'
5set :bundle_without, []
6
7set :application, "bsky_feeds"
8set :repository, "git@github.com:mackuba/bluesky-feeds-rb.git"
9set :scm, :git
10set :keep_releases, 10
11set :use_sudo, false
12set :deploy_to, "/var/www/bsky_feeds"
13set :deploy_via, :remote_cache
14set :migrate_env, "RACK_ENV=production"
15set :public_children, []
16
17server "feeds.example.com", :app, :web, :db, :primary => true
18
19before 'bundle:install', 'deploy:set_bundler_options'
20after 'deploy:update_code', 'deploy:link_shared'
21
22after 'deploy', 'deploy:cleanup'
23after 'deploy:migrations', 'deploy:cleanup'
24
25namespace :deploy do
26 task :restart, :roles => :web do
27 run "touch #{current_path}/tmp/restart.txt"
28 end
29
30 task :set_bundler_options do
31 run "cd #{release_path} && bundle config set --local deployment 'true'"
32 run "cd #{release_path} && bundle config set --local path '#{shared_path}/bundle'"
33 run "cd #{release_path} && bundle config set --local without 'development test'"
34 end
35
36 task :link_shared do
37 run "ln -s #{shared_path}/bluesky.sqlite3 #{release_path}/db/bluesky.sqlite3"
38 run "ln -s #{shared_path}/bluesky.sqlite3-shm #{release_path}/db/bluesky.sqlite3-shm"
39 run "ln -s #{shared_path}/bluesky.sqlite3-wal #{release_path}/db/bluesky.sqlite3-wal"
40 end
41end