Code Monkey home page Code Monkey logo

capistrano-ash's Introduction

Installation

gem install capistrano-ash

Overview

Run the following commands in the command line from the project’s root directory

  
    capify .
    rm -Rf config/deploy.rb; mkdir -p config/deploy
    touch config/deploy/staging.rb config/deploy/production.rb
  

After you have edited your Capfile and staging.rb and production.rb files, you will need to run the following command only once per environment:

  
    cap staging deploy:setup
    cap production deploy:setup
  

Deploying Magento

Check the Wiki for detailed installation instructions.

Deploying WordPress

Check the Wiki for detailed installation instructions.

WordPress on shared hosting
WordPress on virtual or dedicated servers

Deploying Drupal example

The capistrano/ash/drupal library takes a hash of Drupal multisites in the following format.

set :multisites, {"default" => "mysite.com", "another" => "another.mysite.com"}

where each key is a folder in your sites directory and each value is the URL of the multisite. If you are not using multisites, just exclude the :multisites variable definition.

Check the Wiki for detailed configuration instructions.
Drupal on virtual or dedicated servers
Drupal on shared hosting

Deploying Zend or Zend/Doctrine example

Capfile

  
    # Capfile
    load 'deploy' if respond_to?(:namespace) # cap2 differentiator

    # --------------------------------------------
    # :application HAS TO BE DEFINED BEFORE
    # REQUIRING 'ash/zend_doctrine' LIBRARY
    # --------------------------------------------
    set :application, "BEST_APP_EVER"

    # --------------------------------------------
    # Define required Gems/libraries
    # --------------------------------------------
    require 'ash/zend_doctrine'

    # --------------------------------------------
    # Setting defaults
    # --------------------------------------------
    # IP-address or host's servername
    role :app, "bestappever.com"
    role :web, "bestappever.com"
    role :db,  "bestappever.com", :primary => true

    # VCS information.
    set :repository, "https://svn.example.com/REPO/trunk"
    set :scm_username, "SVN_USER"
    set :scm_password, proc{Capistrano::CLI.password_prompt("Subversion password for '#{scm_username}':")}

    # SSH login credentials
    set :user, "SSH_USER"
    set :password, proc{Capistrano::CLI.password_prompt("SSH password for '#{user}':")}
    
    # Deploy to file path
    set(:deploy_to)  { "/var/www/#{application}/#{stage}" }

    # Database credentials
    set :dbuser, "DB_USER_NAME"

    # Define which files or directories you want to exclude from being backed up
    set(:backup_exclude) { [ "var/" ] }
    

    # --------------------------------------------
    # Calling our Methods
    # --------------------------------------------
    before "deploy:update_code", "deploy:setup_backup"
    after "deploy:setup_backup", "backup"
    after "deploy:setup_shared", "app:setup_shared"
    after "zend:symlink", "app:symlink"

    # --------------------------------------------
    # Application Specific Custom Methods
    # --------------------------------------------
    namespace :app do
      desc "Setup shared directories and permissions specific to the application"
      task :setup_shared, :roles => :web, :except => { :no_release => true } do
        run "mkdir -p #{shared_path}/media"
        sudo "chmod -R 777 #{shared_path}/*"
      end

      desc "Symlink shared directories specific to the application"
      task :symlink, :except => { :no_release => true } do
        run "ln -nfs #{shared_path}/media #{current_release}/public/media"
      end
    end
  

config/deploy/staging.rb

  
    # config/deploy/staging.rb

    # Deploy site using Capistrano
    #
    # Usage:
    # cap staging deploy:setup
    # cap staging deploy

    # Database Name
    set :dbname, "DB_NAME"

    # Backups Path (/var/www/#{application}/staging/backups)
    set :backups_path,  "#{deploy_to}/backups"
  

config/deploy/production.rb

  
    # config/deploy/production.rb
    
    # Deploy site using Capistrano
    #
    # Usage:
    # cap production deploy:setup
    # cap production deploy

    # Database Name
    set :dbname, "DB_NAME"

    # Backups Path (/var/www/#{application}/production/backups)
    set :backups_path,  "#{deploy_to}/backups"
  

capistrano-ash's People

Contributors

jjohnson-xx avatar petemcw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.