capistrano-compose 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/LICENSE.txt +22 -0
- data/README.md +99 -0
- data/Rakefile +1 -0
- data/capistrano-composer.gemspec +24 -0
- data/lib/capistrano/composer.rb +1 -0
- data/lib/capistrano/tasks/composer.rake +60 -0
- data/lib/capistrano-composer.rb +4 -0
- metadata +100 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5b3914ac12bac563b91189ebbdd3c994ee5b43d5
|
4
|
+
data.tar.gz: b2bc955e0c3e04875f732ae6dad6f8ce6615c80c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 080d14760fb2eb70da68ce27c2fc98bb3fd88a46c0512ebe531087310b61c6a081e714787aef47355673278f72f4c6530fd5035ae883e65288ed69510d95eea4
|
7
|
+
data.tar.gz: c0fcb821583d600dea1cadb7e1fae1fd06846d1a719304818f7bf1678c0a493c7f174707ae4187bfc5ee2653bbf0c11a2b9b1e63882fdfe288386d33abe1f541
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Capistrano, your one stop deployment shop.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 swalkinshaw
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# Capistrano::Composer
|
2
|
+
|
3
|
+
Composer support for Capistrano 3.x
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'capistrano', '~> 3.0.0'
|
11
|
+
gem 'capistrano-composer'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install capistrano-composer
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Require the module in your `Capfile`:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
require 'capistrano/composer'
|
28
|
+
```
|
29
|
+
|
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
|
49
|
+
|
50
|
+
Configurable options, shown here with defaults:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
set :composer_install_flags, '--no-dev --no-scripts --quiet --optimize-autoloader'
|
54
|
+
set :composer_roles, :all
|
55
|
+
set :composer_dump_autoload_flags, '--optimize'
|
56
|
+
set :composer_download_url, "https://getcomposer.org/installer"
|
57
|
+
set :composer_version, '1.0.0-alpha8' #(default: not set)
|
58
|
+
```
|
59
|
+
|
60
|
+
### Installing composer as part of a deployment
|
61
|
+
|
62
|
+
Add the following to `deploy.rb` to manage the installation of composer during
|
63
|
+
deployment (composer.phar is install in the shared path).
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
SSHKit.config.command_map[:composer] = "#{shared_path.join("composer.phar")}"
|
67
|
+
|
68
|
+
namespace :deploy do
|
69
|
+
before :starting, 'composer:install_executable'
|
70
|
+
end
|
71
|
+
```
|
72
|
+
|
73
|
+
### Accessing composer commands directly
|
74
|
+
|
75
|
+
This library also provides a `composer:run` task which allows access to any
|
76
|
+
composer command.
|
77
|
+
|
78
|
+
From the command line you can run
|
79
|
+
|
80
|
+
```bash
|
81
|
+
$ cap production composer:run['status','--profile']
|
82
|
+
```
|
83
|
+
|
84
|
+
Or from within a rake task using capistrano's `invoke`
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
task :my_custom_composer_task do
|
88
|
+
invoke "composer:run", :update, "--dev --prefer-dist"
|
89
|
+
end
|
90
|
+
```
|
91
|
+
|
92
|
+
|
93
|
+
## Contributing
|
94
|
+
|
95
|
+
1. Fork it
|
96
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
97
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
98
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
99
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,24 @@
|
|
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-compose'
|
7
|
+
spec.version = '0.0.5'
|
8
|
+
spec.authors = ['Scott Walkinshaw', 'Peter Mitchell', "Ross Riley"]
|
9
|
+
spec.email = ['scott.walkinshaw@gmail.com', 'peterjmit@gmail.com', "riley.ross@gmail.com"]
|
10
|
+
spec.description = %q{Composer support for Capistrano 3.x}
|
11
|
+
spec.summary = %q{Composer support for Capistrano 3.x}
|
12
|
+
spec.homepage = 'https://github.com/rossriley/capistrano-composer'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_dependency 'capistrano', '>= 3.1'
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
23
|
+
spec.add_development_dependency 'rake'
|
24
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/composer.rake', __FILE__)
|
@@ -0,0 +1,60 @@
|
|
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
|
+
composer_version = fetch(:composer_version, nil)
|
16
|
+
composer_version_option = composer_version ? "-- --version=#{composer_version}" : ""
|
17
|
+
execute :curl, "-s", fetch(:composer_download_url), "|", :php, composer_version_option
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
task :run, :command do |t, args|
|
24
|
+
args.with_defaults(:command => :list)
|
25
|
+
on roles fetch(:composer_roles) do
|
26
|
+
within release_path do
|
27
|
+
execute :composer, args[:command], *args.extras
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
desc <<-DESC
|
33
|
+
Install the project dependencies via Composer. By default, require-dev \
|
34
|
+
dependencies will not be installed.
|
35
|
+
|
36
|
+
You can override any of the defaults by setting the variables shown below.
|
37
|
+
|
38
|
+
set :composer_install_flags, '--no-dev --no-scripts --quiet --optimize-autoloader'
|
39
|
+
set :composer_roles, :all
|
40
|
+
DESC
|
41
|
+
task :install do
|
42
|
+
invoke "composer:run", :install, fetch(:composer_install_flags)
|
43
|
+
end
|
44
|
+
|
45
|
+
task :dump_autoload do
|
46
|
+
invoke "composer:run", :dumpautoload, fetch(:composer_dump_autoload_flags)
|
47
|
+
end
|
48
|
+
|
49
|
+
desc <<-DESC
|
50
|
+
Run the self-update command for composer.phar
|
51
|
+
|
52
|
+
You can update to a specific release by setting the variables shown below.
|
53
|
+
|
54
|
+
set :composer_version, '1.0.0-alpha8'
|
55
|
+
DESC
|
56
|
+
task :self_update do
|
57
|
+
invoke "composer:run", :selfupdate, fetch(:composer_version, '')
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-compose
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Scott Walkinshaw
|
8
|
+
- Peter Mitchell
|
9
|
+
- Ross Riley
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2014-03-01 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: capistrano
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.1'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - '>='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '3.1'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: bundler
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ~>
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '1.3'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '1.3'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: rake
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
description: Composer support for Capistrano 3.x
|
58
|
+
email:
|
59
|
+
- scott.walkinshaw@gmail.com
|
60
|
+
- peterjmit@gmail.com
|
61
|
+
- riley.ross@gmail.com
|
62
|
+
executables: []
|
63
|
+
extensions: []
|
64
|
+
extra_rdoc_files: []
|
65
|
+
files:
|
66
|
+
- .gitignore
|
67
|
+
- Gemfile
|
68
|
+
- LICENSE
|
69
|
+
- LICENSE.txt
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- capistrano-composer.gemspec
|
73
|
+
- lib/capistrano-composer.rb
|
74
|
+
- lib/capistrano/composer.rb
|
75
|
+
- lib/capistrano/tasks/composer.rake
|
76
|
+
homepage: https://github.com/rossriley/capistrano-composer
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata: {}
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 2.1.10
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: Composer support for Capistrano 3.x
|
100
|
+
test_files: []
|