openteam-capistrano 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/openteam/capistrano/hooks.rb +5 -3
 - data/lib/openteam/capistrano/setup.rb +42 -27
 - data/openteam-capistrano.gemspec +1 -1
 - metadata +3 -3
 
| 
         @@ -1,8 +1,10 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # set up hooks
         
     | 
| 
       2 
2 
     | 
    
         
             
            Capistrano::Configuration.instance.load do
         
     | 
| 
       3 
     | 
    
         
            -
              after 
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
               
     | 
| 
      
 3 
     | 
    
         
            +
              after 'multistage:ensure',  'openteam:setup'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              #after('multistage:ensure') do
         
     | 
| 
      
 6 
     | 
    
         
            +
                #server domain, :app, :web, :db, :primary => true
         
     | 
| 
      
 7 
     | 
    
         
            +
              #end
         
     | 
| 
       6 
8 
     | 
    
         | 
| 
       7 
9 
     | 
    
         
             
              after 'deploy:update_code', 'deploy:migrate'
         
     | 
| 
       8 
10 
     | 
    
         | 
| 
         @@ -1,38 +1,53 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Capistrano::Configuration.instance.load do
         
     | 
| 
       2 
     | 
    
         
            -
               
     | 
| 
       3 
     | 
    
         
            -
                 
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
      
 2 
     | 
    
         
            +
              namespace :openteam do
         
     | 
| 
      
 3 
     | 
    
         
            +
                task :setup do
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def deploy_config
         
     | 
| 
      
 5 
     | 
    
         
            +
                    @deploy_config ||= YAML::load(File.open('config/deploy.yml'))[stage.to_s]
         
     | 
| 
      
 6 
     | 
    
         
            +
                  end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                  def ssh_git_repository_url
         
     | 
| 
      
 9 
     | 
    
         
            +
                    `git config --get remote.origin.url`.chomp
         
     | 
| 
      
 10 
     | 
    
         
            +
                  end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                  def git_repository_url
         
     | 
| 
      
 13 
     | 
    
         
            +
                    @git_repository_url ||=  ssh_git_repository_url.gsub(/^git@(.+?):(.+)$/, 'git://\1/\2')
         
     | 
| 
      
 14 
     | 
    
         
            +
                  end
         
     | 
| 
       5 
15 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
      
 16 
     | 
    
         
            +
                  set :application,       deploy_config['application']
         
     | 
| 
      
 17 
     | 
    
         
            +
                  set :domain,            deploy_config['domain']
         
     | 
| 
      
 18 
     | 
    
         
            +
                  set :gateway,           deploy_config['gateway'] if deploy_config.has_key? 'gateway'
         
     | 
| 
       9 
19 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
      
 20 
     | 
    
         
            +
                  set :deploy_to,         "/srv/#{application}"
         
     | 
| 
       11 
21 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 22 
     | 
    
         
            +
                  # source repostitory settings
         
     | 
| 
      
 23 
     | 
    
         
            +
                  set :scm,               :git
         
     | 
| 
      
 24 
     | 
    
         
            +
                  set :repository,        git_repository_url
         
     | 
| 
      
 25 
     | 
    
         
            +
                  set :branch,            :master
         
     | 
| 
      
 26 
     | 
    
         
            +
                  set :deploy_via,        :remote_cache
         
     | 
| 
      
 27 
     | 
    
         
            +
                  set :ssh_options,       {:forward_agent => true}
         
     | 
| 
       18 
28 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
      
 29 
     | 
    
         
            +
                  # this files will be symlinked from shared to current path on deploy
         
     | 
| 
      
 30 
     | 
    
         
            +
                  set :shared_children,   %w[config/settings.yml config/database.yml log tmp/sockets tmp/pids]
         
     | 
| 
       21 
31 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
      
 32 
     | 
    
         
            +
                  # for assets compilation on host with nodejs
         
     | 
| 
      
 33 
     | 
    
         
            +
                  set :default_shell,     'bash -l'
         
     | 
| 
       24 
34 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
      
 35 
     | 
    
         
            +
                  # make bin stubs for candy console rails runs
         
     | 
| 
      
 36 
     | 
    
         
            +
                  set :bundle_flags,      '--binstubs --deployment --quiet'
         
     | 
| 
       27 
37 
     | 
    
         | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
      
 38 
     | 
    
         
            +
                  # gem capistrano-db-tasks
         
     | 
| 
      
 39 
     | 
    
         
            +
                  # we do not need dump file after db:pull
         
     | 
| 
      
 40 
     | 
    
         
            +
                  set :db_local_clean,    true
         
     | 
| 
       31 
41 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
      
 42 
     | 
    
         
            +
                  # gem whenever
         
     | 
| 
      
 43 
     | 
    
         
            +
                  # point to bundled version of whenever command
         
     | 
| 
      
 44 
     | 
    
         
            +
                  set :whenever_command,  'bundle exec whenever'
         
     | 
| 
       35 
45 
     | 
    
         | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
      
 46 
     | 
    
         
            +
                  # tagging needs this
         
     | 
| 
      
 47 
     | 
    
         
            +
                  set :local_user,        ENV['USER'] || ENV['USERNAME']
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                  # setup server
         
     | 
| 
      
 50 
     | 
    
         
            +
                  server domain, :app, :web, :db, :primary => true
         
     | 
| 
      
 51 
     | 
    
         
            +
                end
         
     | 
| 
      
 52 
     | 
    
         
            +
              end
         
     | 
| 
       38 
53 
     | 
    
         
             
            end
         
     | 
    
        data/openteam-capistrano.gemspec
    CHANGED
    
    | 
         @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 
     | 
|
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            Gem::Specification.new do |gem|
         
     | 
| 
       6 
6 
     | 
    
         
             
              gem.name          = 'openteam-capistrano'
         
     | 
| 
       7 
     | 
    
         
            -
              gem.version       = '0.0. 
     | 
| 
      
 7 
     | 
    
         
            +
              gem.version       = '0.0.2'
         
     | 
| 
       8 
8 
     | 
    
         
             
              gem.authors       = ["OpenTeam developers"]
         
     | 
| 
       9 
9 
     | 
    
         
             
              gem.email         = ["developers@openteam.ru"]
         
     | 
| 
       10 
10 
     | 
    
         
             
              gem.description   = %q{OpenTeam common capistrano recipe}
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: openteam-capistrano
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.2
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -123,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       123 
123 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       124 
124 
     | 
    
         
             
                  segments:
         
     | 
| 
       125 
125 
     | 
    
         
             
                  - 0
         
     | 
| 
       126 
     | 
    
         
            -
                  hash:  
     | 
| 
      
 126 
     | 
    
         
            +
                  hash: 3229573802702059234
         
     | 
| 
       127 
127 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       128 
128 
     | 
    
         
             
              none: false
         
     | 
| 
       129 
129 
     | 
    
         
             
              requirements:
         
     | 
| 
         @@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       132 
132 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       133 
133 
     | 
    
         
             
                  segments:
         
     | 
| 
       134 
134 
     | 
    
         
             
                  - 0
         
     | 
| 
       135 
     | 
    
         
            -
                  hash:  
     | 
| 
      
 135 
     | 
    
         
            +
                  hash: 3229573802702059234
         
     | 
| 
       136 
136 
     | 
    
         
             
            requirements: []
         
     | 
| 
       137 
137 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       138 
138 
     | 
    
         
             
            rubygems_version: 1.8.24
         
     |