Feed

A consolidated stream of my writing and activity, powered by RSS/Atom.

RSS

Latest Items

  • Capistrano: Managing an uploads folder
    Blogger·
    I just found a useful Capistrano recipe for keeping user generated content (a.k.a. uploads) persistent between deployments:

    http://www.simonecarletti.com/blog/2009/02/capistrano-uploads-folder/

    EDIT: I would like to extend the script to many folders. Any idea?
  • File: benoror@macmini:~/simpleapp/config/deploy.rb
    Gists·
    default_run_options[:pty] = true
    set :user, 'benoror'
    set :domain, 'simpleapp.com'
    set :application, 'simpleapp'
    # the rest should be good
    set :repository, "#{user}@#{domain}:#{application}.git"
    set :deploy_to, "/home/#{user}/#{domain}"
    set :deploy_via, :remote_cache
    set :scm, 'git'
    set :branch, 'master'
    #set :git_shallow_clone, 1
    set :scm_verbose, true
    set :use_sudo, false
    server domain, :app, :web, :db, :primary => true
    after "deploy:restart", "deploy:search_index"
    ...
    Continue reading...
  • Capistrano as my default deployment tool
    Blogger·
    In the last post (a whiiile ago) I described my Git workflow to deploy my production server. One of the drawbacks was that everytime I pushed changes to the main repo I had to manually log in my Dreamhost shared host via SSH and then: 1) pull changes, 2) migrate database schema, 3) rebuild sphinx index, 4) restart passenger server. I wrote a bash script to get the job done, but it was prone to errors and not elegant, so I decided to give Capistrano a try.
    After reading the Getting Started and From the Beginning guides I got a good idea of what to do next. Basically my setup is as follows:
    File: benoror@macmini:~/simpleapp/Capfile
    File: benoror@macmini:~/simpleapp/config/deploy.rb
    So now when I make changes to the code I simply follow this workflow in my local machine:
    git add . && git commit -a -m "Commit Msg" && git push
    cap deploy
    cap deploy:migrate
    That's it!
    The next step is to setup a staging server, until then see you soon ...
  • Using Git in Rails production server workflow
    Blogger·

    In my projects I use Git as part of the deployment process. When I'm developing a new app and it's ready for production first I setup a non-bare repo in the Rails project itself: benoror@macmini:~/simpleapp $ git init benoror@macmini:~/simpleapp $ git add . benoror@macmini:~/simpleapp $ git commit -a -m "First commit"Then I just zip and copy the project to the production server. After extract it I clone it as a bare repo: benoror@dreamhost:~ $ git clone --bare simpleapp simpleapp.gitThis bare repo will act as the main repo (who said central?). Then I just add a remote origin in my computer:benoror@macmini:~/simpleapp $ git remote add origin ssh://benoror@production.com/~/simpleapp.gitI assume you already copied your SSH keys and credentials. The workflow is as follows: 1. When I make changes in my computer just commit and push:benoror@macmini:~/simpleapp $ git push origin master2. Then I log into my production server and pull changes in the non-bare repo:<span class="Apple-style-span" style="...

    Continue reading...

Generated at Mar 29, 2026, 6:07 AM