capistrano-composer 0.0.2 → 0.0.3
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.
- checksums.yaml +13 -5
- data/README.md +56 -4
- data/capistrano-composer.gemspec +3 -3
- data/lib/capistrano/composer.rb +1 -1
- data/lib/capistrano/tasks/composer.rake +62 -0
- metadata +12 -10
- data/lib/capistrano/tasks/composer.cap +0 -27
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
             | 
| 2 | 
            +
            !binary "U0hBMQ==":
         | 
| 3 | 
            +
              metadata.gz: !binary |-
         | 
| 4 | 
            +
                NDc0Zjc0NDVmZTc2ZTI1NTNiZTE5NDU0N2FlZjgxZDNkMTRmOWIyNw==
         | 
| 5 | 
            +
              data.tar.gz: !binary |-
         | 
| 6 | 
            +
                MGVmMGRjNWQxZTk0ZmU4NDJjMjU1MDJkNTE1YTE2MDczODMxYjc1OA==
         | 
| 5 7 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
             | 
| 8 | 
            +
              metadata.gz: !binary |-
         | 
| 9 | 
            +
                ODgxMDBhYTA3NzNhMTNmMDNiMjk3YjFkNmIwY2Y2YjQzNjdiOTA3ZWNkMjEx
         | 
| 10 | 
            +
                YjkyYjExNDJkOWJmOTBhN2MyYzFjM2YxYTU5MzU3NmFmZDYwYjdhNzUxNTZl
         | 
| 11 | 
            +
                ZDNkNGJlNmZlNTY2N2E0ZjdiMDE2N2QwYjRmY2ExYTRiMDMyMzg=
         | 
| 12 | 
            +
              data.tar.gz: !binary |-
         | 
| 13 | 
            +
                YjVhODkzMjVhNWNmODFmYTQ0MGMzN2ZkNjA3MTY2NjA2ZmU3N2ZmNjhhOTY0
         | 
| 14 | 
            +
                NDExZmIyZGQ1NmMxNWE0OTA3MmYwODMxOWU5YzU1NzYxMDNjNjEwZTg1MTFj
         | 
| 15 | 
            +
                MjczZGFkY2U4NWFhM2RlZGZmNDc5ZjY3N2EzMjI4MzhlYWEzNTg=
         | 
    
        data/README.md
    CHANGED
    
    | @@ -21,22 +21,74 @@ Or install it yourself as: | |
| 21 21 |  | 
| 22 22 | 
             
            ## Usage
         | 
| 23 23 |  | 
| 24 | 
            -
            Require in `Capfile | 
| 24 | 
            +
            Require the module in your `Capfile`:
         | 
| 25 25 |  | 
| 26 26 | 
             
            ```ruby
         | 
| 27 27 | 
             
            require 'capistrano/composer'
         | 
| 28 28 | 
             
            ```
         | 
| 29 29 |  | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 30 | 
            +
            `capistrano/composer` comes with 5 tasks:
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            * composer:install
         | 
| 33 | 
            +
            * composer:install_executable
         | 
| 34 | 
            +
            * composer:dump_autoload
         | 
| 35 | 
            +
            * composer:self_update
         | 
| 36 | 
            +
            * composer:run
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            The `composer:install` task will run before deploy:updated as part of
         | 
| 39 | 
            +
            Capistrano's default deploy, or can be run in isolation with:
         | 
| 40 | 
            +
             | 
| 41 | 
            +
            ```bash
         | 
| 42 | 
            +
            $ cap production composer:install
         | 
| 43 | 
            +
            ```
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            By default it is assumed that you have the composer executable installed and in your
         | 
| 46 | 
            +
            `$PATH` on all target hosts.
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            ### Configuration
         | 
| 32 49 |  | 
| 33 50 | 
             
            Configurable options, shown here with defaults:
         | 
| 34 51 |  | 
| 35 52 | 
             
            ```ruby
         | 
| 36 | 
            -
            set : | 
| 53 | 
            +
            set :composer_install_flags, '--no-dev --no-scripts --quiet --optimize-autoloader'
         | 
| 37 54 | 
             
            set :composer_roles, :all
         | 
| 55 | 
            +
            set :composer_dump_autoload_flags, '--optimize'
         | 
| 56 | 
            +
            set :composer_download_url, "https://getcomposer.org/installer"
         | 
| 57 | 
            +
            ```
         | 
| 58 | 
            +
             | 
| 59 | 
            +
            ### Installing composer as part of a deployment
         | 
| 60 | 
            +
             | 
| 61 | 
            +
            Add the following to `deploy.rb` to manage the installation of composer during
         | 
| 62 | 
            +
            deployment (composer.phar is install in the shared path).
         | 
| 63 | 
            +
             | 
| 64 | 
            +
            ```ruby
         | 
| 65 | 
            +
            SSHKit.config.command_map[:composer] = "#{shared_path.join("composer.phar")}"
         | 
| 66 | 
            +
             | 
| 67 | 
            +
            namespace :deploy do
         | 
| 68 | 
            +
              before :starting, 'composer:install_executable'
         | 
| 69 | 
            +
            end
         | 
| 70 | 
            +
            ```
         | 
| 71 | 
            +
             | 
| 72 | 
            +
            ### Accessing composer commands directly
         | 
| 73 | 
            +
             | 
| 74 | 
            +
            This library also provides a `composer:run` task which allows access to any
         | 
| 75 | 
            +
            composer command.
         | 
| 76 | 
            +
             | 
| 77 | 
            +
            From the command line you can run
         | 
| 78 | 
            +
             | 
| 79 | 
            +
            ```bash
         | 
| 80 | 
            +
            $ cap production composer:run['status','--profile']
         | 
| 38 81 | 
             
            ```
         | 
| 39 82 |  | 
| 83 | 
            +
            Or from within a rake task using capistrano's `invoke`
         | 
| 84 | 
            +
             | 
| 85 | 
            +
            ```ruby
         | 
| 86 | 
            +
            task :my_custom_composer_task do
         | 
| 87 | 
            +
              invoke "composer:run", :update, "--dev --prefer-dist"
         | 
| 88 | 
            +
            end
         | 
| 89 | 
            +
            ```
         | 
| 90 | 
            +
             | 
| 91 | 
            +
             | 
| 40 92 | 
             
            ## Contributing
         | 
| 41 93 |  | 
| 42 94 | 
             
            1. Fork it
         | 
    
        data/capistrano-composer.gemspec
    CHANGED
    
    | @@ -4,9 +4,9 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | |
| 4 4 |  | 
| 5 5 | 
             
            Gem::Specification.new do |spec|
         | 
| 6 6 | 
             
              spec.name          = 'capistrano-composer'
         | 
| 7 | 
            -
              spec.version       = '0.0. | 
| 8 | 
            -
              spec.authors       = ['Scott Walkinshaw']
         | 
| 9 | 
            -
              spec.email         = ['scott.walkinshaw@gmail.com']
         | 
| 7 | 
            +
              spec.version       = '0.0.3'
         | 
| 8 | 
            +
              spec.authors       = ['Scott Walkinshaw', 'Peter Mitchell']
         | 
| 9 | 
            +
              spec.email         = ['scott.walkinshaw@gmail.com', 'peterjmit@gmail.com']
         | 
| 10 10 | 
             
              spec.description   = %q{Composer support for Capistrano 3.x}
         | 
| 11 11 | 
             
              spec.summary       = %q{Composer support for Capistrano 3.x}
         | 
| 12 12 | 
             
              spec.homepage      = 'https://github.com/capistrano/composer'
         | 
    
        data/lib/capistrano/composer.rb
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            load File.expand_path('../tasks/composer. | 
| 1 | 
            +
            load File.expand_path('../tasks/composer.rake', __FILE__)
         | 
| @@ -0,0 +1,62 @@ | |
| 1 | 
            +
            namespace :composer do
         | 
| 2 | 
            +
              desc <<-DESC
         | 
| 3 | 
            +
                Installs composer.phar to the shared directory
         | 
| 4 | 
            +
                In order to use the .phar file, the composer command needs to be mapped:
         | 
| 5 | 
            +
                  SSHKit.config.command_map[:composer] = "\#{shared_path.join("composer.phar")}"
         | 
| 6 | 
            +
                This is best used before deploy:starting:
         | 
| 7 | 
            +
                  namespace :deploy do
         | 
| 8 | 
            +
                    before :starting, 'composer:install_executable'
         | 
| 9 | 
            +
                  end
         | 
| 10 | 
            +
              DESC
         | 
| 11 | 
            +
              task :install_executable do
         | 
| 12 | 
            +
                on roles fetch(:composer_roles) do
         | 
| 13 | 
            +
                  within shared_path do
         | 
| 14 | 
            +
                    unless test "[", "-e", "composer.phar", "]"
         | 
| 15 | 
            +
                      execute :curl, "-s", fetch(:composer_download_url), "|", :php
         | 
| 16 | 
            +
                    end
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              task :run, :command do |t, args|
         | 
| 22 | 
            +
                args.with_defaults(:command => :list)
         | 
| 23 | 
            +
                on roles fetch(:composer_roles) do
         | 
| 24 | 
            +
                  within release_path do
         | 
| 25 | 
            +
                    execute :composer, args[:command], *args.extras
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
              desc <<-DESC
         | 
| 31 | 
            +
                    Install the project dependencies via Composer. By default, require-dev \
         | 
| 32 | 
            +
                    dependencies will not be installed.
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                    You can override any of the defaults by setting the variables shown below.
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                      set :composer_flags, '--no-dev --no-scripts --quiet --optimize-autoloader'
         | 
| 37 | 
            +
                      set :composer_roles, :all
         | 
| 38 | 
            +
                DESC
         | 
| 39 | 
            +
              task :install do
         | 
| 40 | 
            +
                invoke "composer:run", :install, fetch(:composer_install_flags)
         | 
| 41 | 
            +
              end
         | 
| 42 | 
            +
             | 
| 43 | 
            +
              task :dump_autoload do
         | 
| 44 | 
            +
                invoke "composer:run", :dumpautoload, fetch(:composer_dump_autoload_flags)
         | 
| 45 | 
            +
              end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
              desc "Run the self-update command for composer.phar"
         | 
| 48 | 
            +
              task :self_update do
         | 
| 49 | 
            +
                invoke "composer:run", :selfupdate
         | 
| 50 | 
            +
              end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
              before 'deploy:updated', 'composer:install'
         | 
| 53 | 
            +
            end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            namespace :load do
         | 
| 56 | 
            +
              task :defaults do
         | 
| 57 | 
            +
                set :composer_install_flags, '--no-dev --no-scripts --quiet --optimize-autoloader'
         | 
| 58 | 
            +
                set :composer_roles, :all
         | 
| 59 | 
            +
                set :composer_dump_autoload_flags, '--optimize'
         | 
| 60 | 
            +
                set :composer_download_url, "https://getcomposer.org/installer"
         | 
| 61 | 
            +
              end
         | 
| 62 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,27 +1,28 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: capistrano-composer
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Scott Walkinshaw
         | 
| 8 | 
            +
            - Peter Mitchell
         | 
| 8 9 | 
             
            autorequire: 
         | 
| 9 10 | 
             
            bindir: bin
         | 
| 10 11 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2013-11- | 
| 12 | 
            +
            date: 2013-11-09 00:00:00.000000000 Z
         | 
| 12 13 | 
             
            dependencies:
         | 
| 13 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 15 | 
             
              name: capistrano
         | 
| 15 16 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 17 | 
             
                requirements:
         | 
| 17 | 
            -
                - - '>='
         | 
| 18 | 
            +
                - - ! '>='
         | 
| 18 19 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 20 | 
             
                    version: 3.0.0.pre
         | 
| 20 21 | 
             
              type: :runtime
         | 
| 21 22 | 
             
              prerelease: false
         | 
| 22 23 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 24 | 
             
                requirements:
         | 
| 24 | 
            -
                - - '>='
         | 
| 25 | 
            +
                - - ! '>='
         | 
| 25 26 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 27 | 
             
                    version: 3.0.0.pre
         | 
| 27 28 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -42,19 +43,20 @@ dependencies: | |
| 42 43 | 
             
              name: rake
         | 
| 43 44 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 45 | 
             
                requirements:
         | 
| 45 | 
            -
                - - '>='
         | 
| 46 | 
            +
                - - ! '>='
         | 
| 46 47 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 48 | 
             
                    version: '0'
         | 
| 48 49 | 
             
              type: :development
         | 
| 49 50 | 
             
              prerelease: false
         | 
| 50 51 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 52 | 
             
                requirements:
         | 
| 52 | 
            -
                - - '>='
         | 
| 53 | 
            +
                - - ! '>='
         | 
| 53 54 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 55 | 
             
                    version: '0'
         | 
| 55 56 | 
             
            description: Composer support for Capistrano 3.x
         | 
| 56 57 | 
             
            email:
         | 
| 57 58 | 
             
            - scott.walkinshaw@gmail.com
         | 
| 59 | 
            +
            - peterjmit@gmail.com
         | 
| 58 60 | 
             
            executables: []
         | 
| 59 61 | 
             
            extensions: []
         | 
| 60 62 | 
             
            extra_rdoc_files: []
         | 
| @@ -68,7 +70,7 @@ files: | |
| 68 70 | 
             
            - capistrano-composer.gemspec
         | 
| 69 71 | 
             
            - lib/capistrano-composer.rb
         | 
| 70 72 | 
             
            - lib/capistrano/composer.rb
         | 
| 71 | 
            -
            - lib/capistrano/tasks/composer. | 
| 73 | 
            +
            - lib/capistrano/tasks/composer.rake
         | 
| 72 74 | 
             
            homepage: https://github.com/capistrano/composer
         | 
| 73 75 | 
             
            licenses:
         | 
| 74 76 | 
             
            - MIT
         | 
| @@ -79,17 +81,17 @@ require_paths: | |
| 79 81 | 
             
            - lib
         | 
| 80 82 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 81 83 | 
             
              requirements:
         | 
| 82 | 
            -
              - - '>='
         | 
| 84 | 
            +
              - - ! '>='
         | 
| 83 85 | 
             
                - !ruby/object:Gem::Version
         | 
| 84 86 | 
             
                  version: '0'
         | 
| 85 87 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 86 88 | 
             
              requirements:
         | 
| 87 | 
            -
              - - '>='
         | 
| 89 | 
            +
              - - ! '>='
         | 
| 88 90 | 
             
                - !ruby/object:Gem::Version
         | 
| 89 91 | 
             
                  version: '0'
         | 
| 90 92 | 
             
            requirements: []
         | 
| 91 93 | 
             
            rubyforge_project: 
         | 
| 92 | 
            -
            rubygems_version: 2. | 
| 94 | 
            +
            rubygems_version: 2.1.10
         | 
| 93 95 | 
             
            signing_key: 
         | 
| 94 96 | 
             
            specification_version: 4
         | 
| 95 97 | 
             
            summary: Composer support for Capistrano 3.x
         | 
| @@ -1,27 +0,0 @@ | |
| 1 | 
            -
            namespace :composer do
         | 
| 2 | 
            -
              desc <<-DESC
         | 
| 3 | 
            -
                    Install the project dependencies via Composer. By default, require-dev \
         | 
| 4 | 
            -
                    dependencies will not be installed.
         | 
| 5 | 
            -
             | 
| 6 | 
            -
                    You can override any of the defaults by setting the variables shown below.
         | 
| 7 | 
            -
             | 
| 8 | 
            -
                      set :composer_flags, '--no-dev --no-scripts --quiet --optimize-autoloader'
         | 
| 9 | 
            -
                      set :composer_roles, :all
         | 
| 10 | 
            -
                DESC
         | 
| 11 | 
            -
              task :install do
         | 
| 12 | 
            -
                on roles fetch(:composer_roles) do
         | 
| 13 | 
            -
                  within release_path do
         | 
| 14 | 
            -
                    execute :composer, fetch(:composer_flags)
         | 
| 15 | 
            -
                  end
         | 
| 16 | 
            -
                end
         | 
| 17 | 
            -
              end
         | 
| 18 | 
            -
             | 
| 19 | 
            -
              before 'deploy:updated', 'composer:install'
         | 
| 20 | 
            -
            end
         | 
| 21 | 
            -
             | 
| 22 | 
            -
            namespace :load do
         | 
| 23 | 
            -
              task :defaults do
         | 
| 24 | 
            -
                set :composer_flags, '--no-dev --no-scripts --quiet --optimize-autoloader'
         | 
| 25 | 
            -
                set :composer_roles, :all
         | 
| 26 | 
            -
              end
         | 
| 27 | 
            -
            end
         |