capobvious 0.0.8 → 0.0.9
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/capistrano/ext/capobvious.rb +13 -24
- data/lib/capobvious/version.rb +1 -1
- metadata +10 -5
| @@ -10,28 +10,28 @@ Capistrano::Configuration.instance.load do | |
| 10 10 |  | 
| 11 11 | 
             
              set :rails_env, "production" unless exists?(:rails_env)
         | 
| 12 12 | 
             
              set :branch, "master" unless exists?(:branch)
         | 
| 13 | 
            -
              set :dbconf, "database.yml" unless exists?(:dbconf)
         | 
| 14 13 | 
             
              set :deploy_to, "/home/#{user}/www/#{application}" unless exists?(:deploy_to)
         | 
| 15 14 | 
             
              set :deploy_via, :remote_cache unless exists?(:deploy_via)
         | 
| 16 15 | 
             
              set :keep_releases, 5 unless exists?(:keep_releases)
         | 
| 17 16 | 
             
              set :use_sudo, false unless exists?(:use_sudo)
         | 
| 18 17 | 
             
              set :scm, :git unless exists?(:scm)
         | 
| 19 18 |  | 
| 20 | 
            -
              if `uname -a`.include?("Darwin")
         | 
| 21 | 
            -
                 | 
| 19 | 
            +
              run_local_psql = if `uname -a`.include?("Darwin")
         | 
| 20 | 
            +
                "psql -h localhost -U postgres"
         | 
| 22 21 | 
             
              else
         | 
| 23 | 
            -
                 | 
| 22 | 
            +
                "#{sudo} -u postgres psql"
         | 
| 24 23 | 
             
              end
         | 
| 25 24 |  | 
| 26 | 
            -
               | 
| 25 | 
            +
              database_yml_path = "config/database.yml"
         | 
| 26 | 
            +
              config = YAML::load(capture("cat #{current_path}/#{database_yml_path}"))
         | 
| 27 27 | 
             
              adapter = config[rails_env]["adapter"]
         | 
| 28 28 | 
             
              database = config[rails_env]["database"]
         | 
| 29 29 | 
             
              db_username = config[rails_env]["username"]
         | 
| 30 30 | 
             
              db_password = config[rails_env]["password"]
         | 
| 31 31 |  | 
| 32 32 |  | 
| 33 | 
            +
              config = YAML::load(File.open(database_yml_path))
         | 
| 33 34 | 
             
              local_rails_env = 'development'
         | 
| 34 | 
            -
              config = YAML::load(File.open("config/database.yml"))
         | 
| 35 35 | 
             
              local_adapter = config[local_rails_env]["adapter"]
         | 
| 36 36 | 
             
              local_database = config[local_rails_env]["database"]
         | 
| 37 37 | 
             
              local_db_username = config[local_rails_env]["username"]
         | 
| @@ -74,12 +74,6 @@ Capistrano::Configuration.instance.load do | |
| 74 74 | 
             
              namespace :create do
         | 
| 75 75 | 
             
                task :files do
         | 
| 76 76 | 
             
                  create.rvmrc
         | 
| 77 | 
            -
                  if fetch(:dbconf) != 'database.yml'
         | 
| 78 | 
            -
                    create.database_yml
         | 
| 79 | 
            -
                  end
         | 
| 80 | 
            -
                end
         | 
| 81 | 
            -
                task :database_yml do
         | 
| 82 | 
            -
                  run "ln -sfv #{current_path}/config/#{dbconf} #{current_path}/config/database.yml"
         | 
| 83 77 | 
             
                end
         | 
| 84 78 | 
             
                desc "Create .rvmrc & files"
         | 
| 85 79 | 
             
                task :rvmrc do
         | 
| @@ -217,7 +211,7 @@ Capistrano::Configuration.instance.load do | |
| 217 211 | 
             
              namespace :assets do
         | 
| 218 212 | 
             
                desc "Assets precompile"
         | 
| 219 213 | 
             
                task :precompile do
         | 
| 220 | 
            -
                  system("bundle exec rake  | 
| 214 | 
            +
                  system("bundle exec rake assets:precompile && cd public && tar czf assets.tar.gz assets/")
         | 
| 221 215 | 
             
                  upload("public/assets.tar.gz","#{current_path}/public/assets.tar.gz")
         | 
| 222 216 | 
             
                  system("rm public/assets.tar.gz && rm -rf tmp/assets && mv public/assets tmp/assets")
         | 
| 223 217 | 
             
                  run("cd #{current_path}/public && rm -rf assets/ && tar xzf assets.tar.gz && rm assets.tar.gz")
         | 
| @@ -225,18 +219,13 @@ Capistrano::Configuration.instance.load do | |
| 225 219 | 
             
              end
         | 
| 226 220 |  | 
| 227 221 | 
             
              namespace :nginx do
         | 
| 228 | 
            -
                 | 
| 229 | 
            -
             | 
| 230 | 
            -
                 | 
| 231 | 
            -
             | 
| 232 | 
            -
                  run "#{sudo} /etc/init.d/nginx reload"
         | 
| 233 | 
            -
                end
         | 
| 234 | 
            -
                task :start do
         | 
| 235 | 
            -
                  run "#{sudo} /etc/init.d/nginx start"
         | 
| 236 | 
            -
                end
         | 
| 237 | 
            -
                task :stop do
         | 
| 238 | 
            -
                  run "#{sudo} /etc/init.d/nginx stop"
         | 
| 222 | 
            +
                [:stop, :start, :restart, :reload].each do |action|
         | 
| 223 | 
            +
                desc "#{action.to_s} nginx"
         | 
| 224 | 
            +
                task action, :roles => :web do
         | 
| 225 | 
            +
                  run "#{sudo} /etc/init.d/nginx #{action.to_s}"
         | 
| 239 226 | 
             
                end
         | 
| 227 | 
            +
              end
         | 
| 228 | 
            +
             | 
| 240 229 | 
             
                desc "Add app nginx conf to server"
         | 
| 241 230 | 
             
                task :conf do
         | 
| 242 231 | 
             
              default_nginx_template = <<-EOF
         | 
    
        data/lib/capobvious/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: capobvious
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.9
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,11 +9,11 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2012-03- | 
| 12 | 
            +
            date: 2012-03-29 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: capistrano
         | 
| 16 | 
            -
              requirement:  | 
| 16 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                none: false
         | 
| 18 18 | 
             
                requirements:
         | 
| 19 19 | 
             
                - - ! '>='
         | 
| @@ -21,7 +21,12 @@ dependencies: | |
| 21 21 | 
             
                    version: '0'
         | 
| 22 22 | 
             
              type: :runtime
         | 
| 23 23 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements:  | 
| 24 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 25 | 
            +
                none: false
         | 
| 26 | 
            +
                requirements:
         | 
| 27 | 
            +
                - - ! '>='
         | 
| 28 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 29 | 
            +
                    version: '0'
         | 
| 25 30 | 
             
            description: Capfile that we use every day
         | 
| 26 31 | 
             
            email:
         | 
| 27 32 | 
             
            - donotsendhere@gmail.com
         | 
| @@ -58,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 58 63 | 
             
                  version: '0'
         | 
| 59 64 | 
             
            requirements: []
         | 
| 60 65 | 
             
            rubyforge_project: capobvious
         | 
| 61 | 
            -
            rubygems_version: 1.8. | 
| 66 | 
            +
            rubygems_version: 1.8.19
         | 
| 62 67 | 
             
            signing_key: 
         | 
| 63 68 | 
             
            specification_version: 3
         | 
| 64 69 | 
             
            summary: Cap recipes
         |