capistrano-composer 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ff7dc8f1d63d91d1a5a3abcead9db092b3d30943
4
- data.tar.gz: ffdaad864f1873810fdf953293d59b0efe1d0faf
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDc0Zjc0NDVmZTc2ZTI1NTNiZTE5NDU0N2FlZjgxZDNkMTRmOWIyNw==
5
+ data.tar.gz: !binary |-
6
+ MGVmMGRjNWQxZTk0ZmU4NDJjMjU1MDJkNTE1YTE2MDczODMxYjc1OA==
5
7
  SHA512:
6
- metadata.gz: e929a2f9bcc1d33a7622efe4b03b5551abc1a0de2282ad8e88c7add378db4a9fa2b2b0f450b2cff440229fa1e02f87e3e277d582e1543347deb2c49bc35df021
7
- data.tar.gz: 22d2621d365adae5876a735b0c2cc9b3d32d2330a4bc68152156fde09008739e13c6e7303a96444664ed779f2e409b323ce6f8fd26c6e7ce55ce3ba4d4645fdb
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` to use the default task:
24
+ Require the module in your `Capfile`:
25
25
 
26
26
  ```ruby
27
27
  require 'capistrano/composer'
28
28
  ```
29
29
 
30
- The task will run before `deploy:updated` as part of Capistrano's default deploy,
31
- or can be run in isolation with `cap production composer:install`
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 :composer_flags, '--production --silent'
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
@@ -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.2'
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'
@@ -1 +1 @@
1
- load File.expand_path('../tasks/composer.cap', __FILE__)
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.2
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-06 00:00:00.000000000 Z
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.cap
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.0.0
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