Project

california

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
See https://github.com/halo/california
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 3.11
~> 0.20
 Project Readme

Opinionated Capistrano deployment for dummies

Version Build Status

When using Capistrano to deploy an application to a server, it runs all this stuff creating a new symlink for every release, cleans up old ones, etc..

California is an opinionated out-of-the-box, best-practice configuration that aims to make things a little bit simpler for both beginners and advanced users.

Design Goals

Requirements

  • Ruby >= 2.0
  • Bundler

Installation

Create a new repository with a Gemfile like this and run bundle install to get the california gem.

# Content of Gemfile
source 'https://rubygems.org'

gem 'california'

Then run the generator for creating your first app you may want to deploy. Let's say the name of the app is "hello_world".

# Inside the directory of your newly created repository
bundle exec california generate hello_world

Follow the instructions in hello_world/deploy/production.rb (or whichever stages you have) and define which servers you want to deploy to.

Server preparation

When deploying your hello_world app, it is assumed that you can ssh into the server with the username hello_world and that the repository has been cloned to /mnt/apps/hello_world/repository.

The reason for this directory is that if you are on AWS, /mnt is the default path for permanent storage. If you're not on AWS, you may just ride along and follow the convention.

If you configure your application via environment variables, you can add them in a file called /mnt/envs/hello_world.

# Example of content of /mnt/envs/hello_world
DATABASE_URL="postgres://db.example.com"

Deployment

Essentially you just run vanilla capistrano 3 commands from inside the respective application directory.

cd hello_world

# Examples:
bundle exec cap staging deploy
bundle exec cap production deploy migrate=true

Copyright

MIT 2018 halo. See LICENSE.md.