capistrano-magerun 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: c773bcee2100123335f973f954494dc1123f1dfe
4
+ data.tar.gz: 0adce665f4399acea75d4b2596508a64abbd3379
5
+ SHA512:
6
+ metadata.gz: 781af49c590fd486cd5a9e84d77b66ac187307242e82fbdfb461da8a16576ca9a14f2fb201637be67fefd096f8c1f1f53457207d0ed38a9033cb16784743e246
7
+ data.tar.gz: 7f65995aa8133dac54907b9dca654c85c6f8e94700ab9f0fc368cd76eccbf943766c1135e9b7861a224f5b99688a5967255b0b3e40e7192a5d3606c83c92144d
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-bundler.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Robert Coleman
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,94 @@
1
+ # Capistrano::Magerun
2
+
3
+ n98-magerun 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.1.0'
11
+ gem 'capistrano-magerun'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install capistrano-magerun
21
+
22
+ ## Usage
23
+
24
+ Require the module in your `Capfile`:
25
+
26
+ ```ruby
27
+ require 'capistrano-magerun'
28
+ ```
29
+
30
+ `capistrano-magerun` comes with 3 tasks:
31
+
32
+ * magerun:install
33
+ * magerun:self_update
34
+ * magerun:run
35
+
36
+
37
+ By default it is assumed that you have the n98-magerun.phar executable installed and in your
38
+ `$PATH` on all target hosts.
39
+
40
+ ### Configuration
41
+
42
+ Configurable options, shown here with defaults:
43
+
44
+ ```ruby
45
+ set :magerun_roles, :all
46
+ set :magerun_download_url, 'https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'
47
+ ```
48
+
49
+ ### Installing magerun as part of a deployment
50
+
51
+ Add the following to `deploy.rb` to manage the installation of magerun during
52
+ deployment (n98-magerun.phar is install in the shared path).
53
+
54
+ ```ruby
55
+ SSHKit.config.command_map[:magerun] = "#{shared_path.join('n98-magerun.phar')}"
56
+
57
+ namespace :deploy do
58
+ before :starting, 'magerun:install'
59
+ end
60
+ ```
61
+
62
+ ### Accessing magerun commands directly
63
+
64
+ This library also provides a `magerun:run` task which allows access to any
65
+ magerun command.
66
+
67
+ From the command line you can run
68
+
69
+ ```bash
70
+ $ cap production magerun:run['sys:maintenance', '--off']
71
+ ```
72
+
73
+ Or from within a rake task using capistrano's `invoke`
74
+
75
+ ```ruby
76
+ task :my_custom_magerun_task do
77
+ # invoke 'magerun:run', 'sys:maintenance', '--on' # https://github.com/capistrano/capistrano/pull/928
78
+ Rake::Task['magerun:run'].invoke('sys:maintenance --off')
79
+ end
80
+ ```
81
+
82
+
83
+ ## Contributing
84
+
85
+ 1. Fork it
86
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
87
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
88
+ 4. Push to the branch (`git push origin my-new-feature`)
89
+ 5. Create new Pull Request
90
+
91
+
92
+ ## Thanks
93
+
94
+ This code is heavily inspired by [https://github.com/capistrano/composer](https://github.com/capistrano/composer)
@@ -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-magerun'
7
+ spec.version = '0.0.1'
8
+ spec.authors = 'Robert Coleman'
9
+ spec.email = 'github@robert.net.nz'
10
+ spec.description = %q{n98-magerun support for Capistrano 3.x}
11
+ spec.summary = %q{n98-magerun support for Capistrano 3.x}
12
+ spec.homepage = 'https://github.com/rjocoleman/capistrano-magerun'
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.0'
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('../magerun/tasks/magerun.rake', __FILE__)
@@ -0,0 +1,45 @@
1
+ namespace :magerun do
2
+ desc <<-DESC
3
+ Installs n98-magerun.phar to the shared directory
4
+ In order to use the .phar file, the magerun command needs to be mapped:
5
+ SSHKit.config.command_map[:magerun] = "\#{shared_path.join('n98-magerun.phar')}"
6
+ This is best used before deploy:starting:
7
+ namespace :deploy do
8
+ before :starting, 'magerun:install'
9
+ end
10
+ DESC
11
+ task :install do
12
+ on roles fetch(:magerun_roles) do
13
+ within shared_path do
14
+ unless test '[', '-e', 'n98-magerun.phar', ']'
15
+ execute :curl, '-s', '-o', 'n98-magerun.phar', fetch(:magerun_download_url)
16
+ execute :chmod, '+x', 'n98-magerun.phar'
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+ task :run, :command do |t, args|
23
+ args.with_defaults(:command => :list)
24
+ on roles fetch(:magerun_roles) do
25
+ within release_path do
26
+ execute :'n98-magerun.phar', args[:command], *args.extras
27
+ end
28
+ end
29
+ end
30
+
31
+ desc 'Run the self-update command for n98-magerun.phar'
32
+ task :self_update do
33
+ invoke 'magerun:run', :selfupdate
34
+ end
35
+
36
+ end
37
+
38
+ namespace :load do
39
+ task :defaults do
40
+
41
+ set :magerun_roles, :all
42
+ set :magerun_download_url, 'https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'
43
+
44
+ end
45
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-magerun
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Robert Coleman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-17 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.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: n98-magerun support for Capistrano 3.x
56
+ email: github@robert.net.nz
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - ".gitignore"
62
+ - Gemfile
63
+ - LICENSE
64
+ - README.md
65
+ - Rakefile
66
+ - capistrano-magerun.gemspec
67
+ - lib/capistrano-magerun.rb
68
+ - lib/magerun/tasks/magerun.rake
69
+ homepage: https://github.com/rjocoleman/capistrano-magerun
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.2.0
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: n98-magerun support for Capistrano 3.x
93
+ test_files: []
94
+ has_rdoc: