Code Monkey home page Code Monkey logo

eycap's Introduction

eycap Build Status

Description

The Engine Yard capistrano tasks are for use specifically with Engine Yard Managed services. But can be used as examples for building other tasks as well.

Requirements

  • Capistrano >= 2.2.0

  • NOTE: When using a git repository use Capistrano >= 2.5.3.

Install

Use your Gemfile and bundler to both document and install the eycap gem to your application. We also recommend the following gems to be configured along side eycap. Add these to your Gemfile:

group :development, :test do
  gem 'eycap', :require => false
  gem 'capistrano', '~> 2.15'
  gem 'net-ssh', '~> 2.7.0'
end

Then run bundle install to install the eycap and other gem(s).

$ bundle install

Then in your deploy.rb file you'll need to add the following require statement to the begininng of the file:

require "eycap/recipes"

Usage

Configuration

Your initial deploy.rb will be provided for you when your servers are provisioned on Engine Yard Managed. In order to deploy your application, you can go to the RAILS_ROOT folder and run:

$ capify .

This generates the Capfile and the config/deploy.rb file for you. You'll replace the config/deploy.rb file with the deploy.rb given to you by Engine Yard.

For deploying Rails 3.1 or greater apps using the asset pipeline read more on the linked page.

Setup restart server

Mongrel is the default server, to override this default you'll need to define the following in your deploy.rb file:

namespace :deploy do

  task :restart, :roles => :app do
    # mongrel.restart
  end


  task :spinner, :roles => :app do
    # mongrel.start
  end


  task :start, :roles => :app do
    # mongrel.start
  end    
  

  task :stop, :roles => :app do
    # mongrel.stop
  end
  
end

Replace the commented out with your server (passenger, unicorn, thin, puma, etc.) and then it will override the default of mongrel.

Deploying to Environment

To ensure your environments are ready to deploy, check on staging.

$ cap staging deploy:check

This will determine if all requirements are met to deploy. Sometimes if the default folders are not setup you may be able to repair by running:

$ cap staging deploy:setup

If you cannot get deploy:check to pass, please open a new support ticket and let us know.

Now you're ready to do a test deploy.

Optionally, cap deploy:cold will run your migrations and start (instead of restart) your app server.

$ cap staging deploy:cold

Or if you have already dumped a copy of your data to staging or do not want to run migrations you can simply do a deploy.

$ cap staging deploy

And to do all this on production, just change the environment name and you'll be all set.

$ cap production deploy

Eycap Commands

For a list of all available commands, run:

$ cap -T

This will show you not only the default capistrano commands but also the ones you get by including the eycap gem.

Custom binaries path

In rare cases (unicorn / sphinx) it is required to set custom path for binaries when using development versions of scripts. It is as easy as:

set :engineyard_bin, "/engineyard/custom"

The default is /engineyard/bin and is just fine in normal deployment.

Pull Requests

If you'd like to contribute to the eycap gem please create a fork, then send a pull request and a member of the eycap team will review it.

Issues

When you run into a problem please check the issues to see if one has been reported. If not, please report the issue and we'll get to work on fixing it.

License

Copyright (c) Engine Yard

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

eycap's People

Contributors

7hunderbird avatar atmos avatar banzaiman avatar cee-dub avatar danp avatar dholdren avatar halorgium avatar hornbeck avatar ivey avatar jhsu avatar kiere avatar kjg avatar krutten avatar lightcap avatar mage2k avatar mdolian avatar mpapis avatar mutle avatar shaiguitar avatar shillerey avatar square-build-bot avatar svanzoest avatar ydnar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eycap's Issues

eycap is using old syntax for bundler

The /lib/eycap/recipes/bundler.rb file still uses the "gem bundle" command, which breaks under bundler > 0.9. I think it needs to be changed to "bundle install" now.

Here's what happens with a deploy today (eycap 0.5.3 and bundler 0.9.11):

executing "if [ -f /.../Gemfile ]; then cd /... && gem bundle --cached; fi"
    servers: ["65.74.186.4"]
    [65.74.186.4:8184] executing command
 ** [out :: 65.74.186.4:8184] ERROR:  While executing gem ... (RuntimeError)
 ** [out :: 65.74.186.4:8184] Unknown command bundle

is bundler.rb missing in eycap-0.4.14?

Hi,

I have an app that uses this gem(I reinstalled eycap-0.4.14). But now my deploy no works anymore, it said:

cap staging deploy
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- eycap/recipes/bundler (LoadError)
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/engineyard-eycap-0.4.14/lib/eycap/recipes.rb:18
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.9/lib/capistrano/configuration/loading.rb:152:in `require'
    from ./config/deploy.rb:4:in `load'
    from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.9/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
    from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.9/lib/capistrano/configuration/loading.rb:89:in `load'
     ... 13 levels...
    from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.9/lib/capistrano/cli/execute.rb:14:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.9/bin/cap:4
    from /usr/bin/cap:19:in `load'
    from /usr/bin/cap:19

I was searching this file in /usr/lib/ruby/gems/1.8/gems/engineyard-eycap-0.4.14/lib/eycap/recipes/ and it don't exists.

Is missing that file in the gem?

Thanks

hoe runtime dependency means I can't run bundle update

  1. The eycap gemspec has a runtime dependency on hoe with ">= 1.5.1".
  2. hoe 2.9.0 depends on RubyGems >= 1.4
  3. Engine Yard's AppCloud still runs RubyGems 1.3.6

When I run bundle update, I get the newest hoe which will fail to install on the next time I deploy my application. If eycap is going to use hoe, it needs to be a development dependency.

Misleading comments and use of sudo method in mongrel.rb recipes

The tasks in the mongrel namespace are using the sudo method to interact with monit, but the comments allude to the fact that they can be run without sudo access by toggling :use_sudo. This is not true, however, because the sudo command always runs using sudo. The commands should most likely use the try_sudo command instead, which looks at the :use_sudo flag or if :run_method is :sudo.

This was reported by jonah_ in IRC.

undefined method `enable' for #<Capistrano::Configuration::Namespaces::Namespace:0x007f947588a8b8> (NoMethodError)

ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/configuration/namespaces.rb:193:in `method_missing': undefined method `enable' for #<Capistrano::Configuration::Namespaces::Namespace:0x007f947588a8b8> (NoMethodError)
    from ruby-1.9.3-p194/gems/eycap-0.6.6/lib/eycap/recipes/deploy.rb:70:in `block (3 levels) in <top (required)>'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:45:in `each'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:34:in `execute!'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:14:in `execute'
    from ruby-1.9.3-p194/gems/capistrano-2.14.2/bin/cap:4:in `<top (required)>'
    from ruby-1.9.3-p194/bin/cap:19:in `load'
    from ruby-1.9.3-p194/bin/cap:19:in `<main>'
    from ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
    from ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

regression: hoe runtime dependency means I can't run bundle update

This was fixed in 0.5.9 but came back in 0.5.10-0.5.11

  1. The eycap gemspec has a runtime dependency on hoe with ">= 1.5.1".
  2. hoe 2.9.0 depends on RubyGems >= 1.4
  3. Engine Yard's AppCloud still runs RubyGems 1.3.6

When I run bundle update, I get the newest hoe which will fail to install on the next time I deploy my application. If eycap is going to use hoe, it needs to be a development dependency.

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.