Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8966181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:58:14+00:00 2026-06-15T16:58:14+00:00

I am using Capistrano to deploy my Rails application to a VPS (as shown

  • 0

I am using Capistrano to deploy my Rails application to a VPS (as shown in episode 335 on railscasts.com). I have some custom fonts I’m using for the application and don’t want to check them into source-control for licensing reasons (See clarification at bottom).

What’s the best way to go about this? Should I edit the deploy.rb file to sftp the assets/webfonts directory from my local computer? Maybe I just need to copy them manually to the my_app/shared/assets directory on the VPS, but I’d rather it be automated as part of the deploy task.

Here’s my current deploy.rb file:

require "rvm/capistrano"
require "bundler/capistrano"

server "ip_address", :web, :app, :db, primary: true

set :application, "armory"
set :user, "username"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false

set :scm, "git"
set :github_user, "gorrillamcd"
set :repository, "git@github.com:#{github_user}/Armory.git"
set :branch, "master"

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

after "deploy", "deploy:cleanup" # keep only the last 5 releases

namespace :deploy do
  %w[start stop restart].each do |command|
    desc "#{command} unicorn server"
    task command, roles: :app, except: {no_release: true} do
      run "/etc/init.d/unicorn_#{application} #{command}"
    end
  end

  task :setup_config, roles: :app do
    sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}"
    sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}"
    run "mkdir -p #{shared_path}/config"
    put File.read("config/database.base.yml"), "#{shared_path}/config/database.yml"
    puts "Now edit the config files in #{shared_path}."
  end
  after "deploy:setup", "deploy:setup_config"

  task :symlink_config, roles: :app do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
    run "ln -nfs #{shared_path}/config/initializers/stripe.rb #{release_path}/config/initializers/stripe.rb"
  end
  after "deploy:finalize_update", "deploy:symlink_config"

  desc "Make sure local git is in sync with remote."
  task :check_revision, roles: :web do
    unless `git rev-parse HEAD` == `git rev-parse origin/master`
      puts "WARNING: HEAD is not the same as origin/master"
      puts "Run `git push` to sync changes."
      exit
    end
  end
  before "deploy", "deploy:check_revision"
end

Edit: Sorry for being so vague beforehand. I’m using Museo Slab from myfonts.com and a public repo on github (check my user profile if you want to see it). I read through the license and found this:

3. The Licensed Webfont(s) may be used on any Website owned or controlled by the Licensee

4. Agencies responsible for multiple clients’ Websites, for example web design agencies or hosting providers, may not share a single Webfont license across multiple clients’ Websites.

Those two lines of the license make me believe that checking the font into a public repository would be against the license, since it could be used on sites that are not mine without obtaining a new license for the font (even though they were free to begin with). I imagine that other people have had this problem before. So my question is, What’s the normal/best way to handle deploy, with Capistrano, fonts (or any file for that matter) that can’t be checked into source control?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:58:15+00:00Added an answer on June 15, 2026 at 4:58 pm

    I would pack the web fonts in an archive and put that archive somewhere separate from the repository. (Amazon S3 is a prime candidate.) Then, I’d have the release process retrieve and unpack this archive at deploy time.

    This lets you put your entire app in your public repository — the Capistrano scripts, the Rake tasks, etc. — but leaves the actual font binaries out, with their location specified as a matter of configuration. This is consistent with 12-factor app principles, treating these webfonts as an external resource needed by but not contained within your application.

    You could, for example, specify a WEBFONTS_URL environment variable, and add a fetch_webfonts Rake task. This task would automatically pull these resources into your application, and would do nothing in the case that WEBFONTS_URL is unspecified — e.g. if someone else did a checkout of your repo without having these fonts. (You could even make the task do appropriate things with stylesheets, ensuring that the fresh-checkout users get a working app without 404ing on font files.) Rake allows you to add dependencies to existing tasks, so you can ensure this happens automatically as part of assets:precompile, which Capistrano very likely already invokes.

    Additionally, this approach works equally well on development and production: you can take a fresh checkout of your own repo, specify the appropriate WEBFONTS_URL, and end up with a working set of fonts on your local machine. (The dotenv gem makes it easy to get development configuration into environment variables, keeping all your environments consistent.) Just be sure that you .gitignore the results so you don’t accidentally make them public after all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently deploying a Rails application using Capistrano. Cap deploy:update_code usually works just
I am trying to deploy my rails application to a server using capistrano and
I'm trying to deploy my rails application by using Passenger and Capistrano on Dreamhost.
I'm attempting to deploy my rails application w/ puma using Capistrano. Towards the end
I'm trying to deploy a Rails app on a VPS using the capistrano gem.
I am using capistrano to deploy my rails application. I want to override the
I am using Capistrano to deploy my Rails application. whenever I deploy, changes would
I'm using Capistrano to deploy a Rails application on a staging environment. cap deploy:update
So I am using Capistrano to deploy a rails application to my production server
I'm trying to deploy my Rails application using Capistrano. My deploy.rb file looks like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.