capistrano-cachetool 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +91 -0
- data/Rakefile +6 -0
- data/capistrano-cachetool.gemspec +25 -0
- data/lib/capistrano/cachetool/version.rb +5 -0
- data/lib/capistrano/cachetool.rb +1 -0
- data/lib/capistrano/tasks/cachetool.rake +42 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cbee95d3248c61d1250fb770f6be480099ed4125
|
4
|
+
data.tar.gz: 2bbf08c7b04b64936088acaf75eb5692c940ba20
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 21db05dd2c090ee9347a2c95716012c9af666e4bcbfcb1a57bf0c9045d32723ac85fd2fbcc84110f93720fd5b457e3726bbaf4a22b98f9c956837d26e730db33
|
7
|
+
data.tar.gz: e29df4384f78b3418ba35fa025f914f72aa945529feaf6e9ef40dd5ad8a70d44a85643fc927ae04309061899d29495dbbd7732c9d65b6e8f153ee019ad955d10
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Tijs Verkoyen
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all 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,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
# Capistrano::Cachetool
|
2
|
+
|
3
|
+
Exposes the [Cachetool by Goralina](http://gordalina.github.io/cachetool/) in Capistrano 3.x
|
4
|
+
|
5
|
+
This plugin is heavily inspired on [capistrano/composer](https://github.com/capistrano/composer).
|
6
|
+
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'capistrano-cachetool'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install capistrano-cachetool
|
23
|
+
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Require the module in your Capfile:
|
28
|
+
|
29
|
+
require 'capistrano/cachetool'
|
30
|
+
capistrano/cachetool comes with 2 tasks:
|
31
|
+
|
32
|
+
* `cachetool:install_executable`
|
33
|
+
* `cachetool:run`
|
34
|
+
|
35
|
+
By default it is assumed that you have the cachetool executable installed and in your $PATH on all target hosts.
|
36
|
+
|
37
|
+
### Configuration
|
38
|
+
|
39
|
+
Configurable options, shown here with defaults:
|
40
|
+
|
41
|
+
```
|
42
|
+
set :cachetool_roles, :all
|
43
|
+
set :cachetool_download_url, "https://gordalina.github.io/cachetool/downloads/cachetool.phar"
|
44
|
+
set :cachetool_working_dir, -> { fetch(:release_path) }
|
45
|
+
```
|
46
|
+
|
47
|
+
### Installing cachetool as part of a deployment
|
48
|
+
|
49
|
+
Add the following to deploy.rb to manage the installation of cachetool during deployment (cachetool.phar is install in the shared path).
|
50
|
+
|
51
|
+
```
|
52
|
+
SSHKit.config.command_map[:cachetool] = "php #{shared_path.join("cachetool.phar")}"
|
53
|
+
|
54
|
+
namespace :deploy do
|
55
|
+
after :starting, 'cachetool:install_executable'
|
56
|
+
end
|
57
|
+
```
|
58
|
+
|
59
|
+
### Accessing cachetool commands directly
|
60
|
+
|
61
|
+
This library also provides a `cachetool:run` task which allows access to any `cachetool` command.
|
62
|
+
|
63
|
+
From the command line you can run
|
64
|
+
|
65
|
+
```
|
66
|
+
cap production cachetool:run['opcache:status', '--cli']
|
67
|
+
```
|
68
|
+
|
69
|
+
If you use zsh you will need to wrap the command in quotes:
|
70
|
+
|
71
|
+
```
|
72
|
+
cap production "cachetool:run['opcache:status', '--cli']"
|
73
|
+
```
|
74
|
+
|
75
|
+
Or from within a rake task using capistrano's invoke
|
76
|
+
|
77
|
+
```
|
78
|
+
task :my_custom_cachetool_task do
|
79
|
+
invoke "cachetool:run", :update, "--dev --prefer-dist"
|
80
|
+
end
|
81
|
+
```
|
82
|
+
|
83
|
+
|
84
|
+
## Contributing
|
85
|
+
|
86
|
+
Bug reports and pull requests are welcome on GitHub at [https://github.com/tijsverkoyen/capistrano-cachetool/issues](https://github.com/tijsverkoyen/capistrano-cachetool/issues).
|
87
|
+
|
88
|
+
|
89
|
+
## License
|
90
|
+
|
91
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'capistrano/cachetool/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "capistrano-cachetool"
|
8
|
+
spec.version = Capistrano::Cachetool::VERSION
|
9
|
+
spec.authors = ["Tijs Verkoyen"]
|
10
|
+
spec.email = ["capistrano-cachetool@verkoyen.eu"]
|
11
|
+
|
12
|
+
spec.summary = %q{Cachetool support for Capistrano 3.x}
|
13
|
+
spec.description = %q{Exposes the [Cachetool by Goralina](http://gordalina.github.io/cachetool/) in Capistrano 3.x}
|
14
|
+
spec.homepage = "https://github.com/tijsverkoyen/capistrano-cachetool"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/cachetool.rake', __FILE__)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
namespace :cachetool do
|
2
|
+
desc <<-DESC
|
3
|
+
Installs cachetool.phar to the shared directory
|
4
|
+
In order to use the .phar file, the cachetool command needs to be mapped:
|
5
|
+
SSHKit.config.command_map[:cachetool] = "\#{shared_path.join("cachetool.phar")}"
|
6
|
+
This is best used after deploy:starting:
|
7
|
+
namespace :deploy do
|
8
|
+
after :starting, 'cachetool:install_executable'
|
9
|
+
end
|
10
|
+
DESC
|
11
|
+
task :install_executable do
|
12
|
+
on release_roles(fetch(:cachetool_roles)) do
|
13
|
+
within shared_path do
|
14
|
+
if test "[", "!", "-e", "cachetool.phar", "]"
|
15
|
+
execute :curl, "-sO", fetch(:cachetool_download_url)
|
16
|
+
execute :chmod, "+x", "cachetool.phar"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc <<-DESC
|
23
|
+
Access a cachetool command directly
|
24
|
+
This tasks allows access to any cachetool command.
|
25
|
+
DESC
|
26
|
+
task :run, :command do |t, args|
|
27
|
+
args.with_defaults(:command => :list)
|
28
|
+
on release_roles(fetch(:cachetool_roles)) do
|
29
|
+
within fetch(:cachetool_working_dir) do
|
30
|
+
execute :cachetool, args[:command], *args.extras
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
namespace :load do
|
37
|
+
task :defaults do
|
38
|
+
set :cachetool_roles, :all
|
39
|
+
set :cachetool_download_url, "https://gordalina.github.io/cachetool/downloads/cachetool.phar"
|
40
|
+
set :cachetool_working_dir, -> { fetch(:release_path) }
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-cachetool
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tijs Verkoyen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Exposes the [Cachetool by Goralina](http://gordalina.github.io/cachetool/)
|
56
|
+
in Capistrano 3.x
|
57
|
+
email:
|
58
|
+
- capistrano-cachetool@verkoyen.eu
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".travis.yml"
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- capistrano-cachetool.gemspec
|
71
|
+
- lib/capistrano/cachetool.rb
|
72
|
+
- lib/capistrano/cachetool/version.rb
|
73
|
+
- lib/capistrano/tasks/cachetool.rake
|
74
|
+
homepage: https://github.com/tijsverkoyen/capistrano-cachetool
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata: {}
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 2.6.11
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Cachetool support for Capistrano 3.x
|
98
|
+
test_files: []
|