capistrano-composer-light 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7d8b04dafd12e8aa327861fa48dfd8e1673dded1
4
+ data.tar.gz: cd4d40f533d8c1e69113b42e3f0cafbafc7e35fc
5
+ SHA512:
6
+ metadata.gz: 4e1dab709430c8648ec165f287ba82e398acefbc903a44e3cdc747ce1dde5701f9c8363eae41e01a5768d2d78c8567d2d357487fddb84fd2da9f1b7e02d12552
7
+ data.tar.gz: c67b045a342c08f27e1baa2d5153b5f31f7c4300a5298bc485681d92753490abc38176c88ce4d0d19fc87e212c525d764876fdba2a56ef6b12b9b85965bda56e
@@ -0,0 +1,2 @@
1
+ Gemfile.lock
2
+ .idea
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Remdan
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,87 @@
1
+ # Capistrano::Composer
2
+
3
+ Provide some Composer task for to use them in your Capistrano project.
4
+ For more flexibility it comes just whit tasks and it's nothing doing automatically on the Capistrano [flow][1].
5
+ If you need something from the Composer, so hook into the Capistrano [flow][1] by your self.
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ # Gemfile
11
+ gem 'capistrano', '~> 3.1'
12
+ gem 'capistrano-composer-light', '~> 0.0.1'
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ Require capistrano-composer-light in your cap file
18
+
19
+ ```
20
+ # Capfile
21
+ require 'capistrano/composer'
22
+ ```
23
+
24
+ ### Settings
25
+
26
+ The following settings (displayed with defaults) are provided:
27
+
28
+ ```ruby
29
+ # If you have a other name for your php, maybe like "php54 or php55" change it.
30
+ set :composer_php, "php"
31
+
32
+ # If you use a diffrent php.ini change it and set the path.
33
+ set :composer_php_ini, ""
34
+
35
+ # If you want to install the composer.phar.
36
+ set :composer_download_url, "https://getcomposer.org/installer"
37
+ set :composer_path, -> { shared_path }
38
+
39
+ # The path to "../composer.phar" or maybe just "composer" for to call all the tasks.
40
+ set :composer_execute, -> { fetch(:composer_path).join('composer.phar') }
41
+
42
+ # Set the path in that is run all the tasks.
43
+ set :composer_working_path, -> { fetch(:release_path) }
44
+
45
+ # Set the roles for all tasks.
46
+ set :composer_roles, :all
47
+ ```
48
+
49
+ ### Integrated common tasks
50
+
51
+ The folowing common tasks are already integrated:
52
+ * ```composer:installer```
53
+ * ```composer:self_update```
54
+ * ```composer:install```
55
+ * ```composer:update```
56
+ * ```composer:run```
57
+
58
+ So you can use them with hooks like this:
59
+ ```ruby
60
+ after 'deploy:updated', 'composer:install'
61
+ after 'deploy:updated', 'composer:update'
62
+ ```
63
+
64
+ Or if you need to pass some options:
65
+ ```ruby
66
+ after :deploy, :updated do
67
+ invoke "composer:installer", "-- --version=1.0.0-alpha9"
68
+ invoke "composer:install", "--optimize-autoloader"
69
+ end
70
+ ```
71
+
72
+ If you need a not already provided task you can use "composer:run"
73
+ ```ruby
74
+ after :deploy, :updated do
75
+ invoke "composer:run", "remove", "--dev"
76
+ end
77
+ ```
78
+
79
+ [1]: http://capistranorb.com/documentation/getting-started/flow/
80
+
81
+ ## Contributing
82
+
83
+ 1. Fork it
84
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
85
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
86
+ 4. Push to the branch (`git push origin my-new-feature`)
87
+ 5. Create new Pull Request
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'capistrano-composer-light'
7
+ spec.version = '0.0.1'
8
+ spec.authors = ['Remdan']
9
+ spec.email = ['info@remdan.co']
10
+ spec.description = %q{Composer support for Capistrano 3.x}
11
+ spec.summary = %q{Provide some Composer task for to use them in your capistrano project.}
12
+ spec.homepage = 'https://github.com/remdan/capistrano-composer-light'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.require_paths = ['lib']
17
+
18
+ # No tests yet.
19
+ # spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+
21
+ spec.add_dependency 'capistrano', '~> 3.1'
22
+ end
File without changes
@@ -0,0 +1,7 @@
1
+ require "capistrano/composer/composer"
2
+
3
+ namespace :load do
4
+ task :defaults do
5
+ load "capistrano/composer/defaults.rb"
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path("../../tasks/composer.rake", __FILE__)
@@ -0,0 +1,18 @@
1
+ # If you have a other name for your php, maybe like "php54 or php55" change it.
2
+ set :composer_php, "php"
3
+
4
+ # If you use a diffrent php.ini change it and set the path.
5
+ set :composer_php_ini, ""
6
+
7
+ # If you want to install the composer.phar.
8
+ set :composer_download_url, "https://getcomposer.org/installer"
9
+ set :composer_path, -> { shared_path }
10
+
11
+ # The path to "../composer.phar" or maybe just "composer" for to call all the tasks.
12
+ set :composer_execute, -> { fetch(:composer_path).join('composer.phar') }
13
+
14
+ # Set the path in that is run all the tasks.
15
+ set :composer_working_path, -> { fetch(:release_path) }
16
+
17
+ # Set the roles for all tasks.
18
+ set :composer_roles, :all
@@ -0,0 +1,40 @@
1
+ namespace :composer do
2
+
3
+ task :installer, :options do |t, args|
4
+ on release_roles(fetch(:composer_roles)) do
5
+ within fetch(:composer_path) do
6
+ php_ini = fetch(:composer_php_ini) || ''
7
+ if php_ini.length > 0
8
+ php_ini = ' -c ' + php_ini
9
+ end
10
+ unless test "[", "-e", "composer.phar", "]"
11
+ execute :curl, "-s", fetch(:composer_download_url), "|", fetch(:composer_php), php_ini, args[:options]
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ task :run, :command, :options do |t, args|
18
+ on release_roles(fetch(:composer_roles)) do
19
+ within fetch(:composer_working_path) do
20
+ php_ini = fetch(:composer_php_ini) || ''
21
+ if php_ini.length > 0
22
+ php_ini = ' -c ' + php_ini
23
+ end
24
+ execute fetch(:composer_php), php_ini, fetch(:composer_execute), args[:command], args[:options]
25
+ end
26
+ end
27
+ end
28
+
29
+ task :install, :options do |t, args|
30
+ invoke "composer:run", :install, args[:options]
31
+ end
32
+
33
+ task :update, :options do |t, args|
34
+ invoke "composer:run", :update, args[:options]
35
+ end
36
+
37
+ task :self_update, :options do |t, args|
38
+ invoke "composer:run", :selfupdate, args[:options]
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-composer-light
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Remdan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ description: Composer support for Capistrano 3.x
28
+ email:
29
+ - info@remdan.co
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - LICENCE.txt
36
+ - README.md
37
+ - capistrano-composer-light.gemspec
38
+ - lib/capistrano-composer-light.rb
39
+ - lib/capistrano/composer.rb
40
+ - lib/capistrano/composer/composer.rb
41
+ - lib/capistrano/composer/defaults.rb
42
+ - lib/capistrano/tasks/composer.rake
43
+ homepage: https://github.com/remdan/capistrano-composer-light
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.4.5
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: Provide some Composer task for to use them in your capistrano project.
67
+ test_files: []