capistrano-release 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +36 -0
- data/Rakefile +1 -0
- data/capistrano-release.gemspec +20 -0
- data/lib/capistrano-release.rb +0 -0
- data/lib/capistrano/release.rb +1 -0
- data/lib/capistrano/release/cat.rb +1 -0
- data/lib/capistrano/tasks/cat.rake +36 -0
- metadata +67 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a0da61c15360b730133bb4bbb08dc8c816a20078
|
4
|
+
data.tar.gz: 9272472a74ca7ebe2c00daea3dcfe33a793280b0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 81dd228e22051089d866ecb800c8836c76fe36f9ddb307d92cb2d39b545a533dca35edbf6ae661c8bee33dd5f2f5c4401ca255bc8badca0fa55a07e07a2d2830
|
7
|
+
data.tar.gz: 54ec6e022cd2ba9c48bb610f16cc7ec28d36b22f44173d251d8ee4a365edcfe344988a917be2400f83a52f98542e6a3ce4bfc76b2c445ab0145a07e9bde0fbd3
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Rustam Zagirov
|
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,36 @@
|
|
1
|
+
# Capistrano::Release
|
2
|
+
|
3
|
+
Really help not to forget do a one time stuff after/before deploy.
|
4
|
+
|
5
|
+
You put a needing text in file doc/do_on_release.txt (or you particular sets in variable release_file), like: «Reindex index» or «Run rake stat:count»
|
6
|
+
|
7
|
+
On deploy cats this file if context is change
|
8
|
+
|
9
|
+
Options.
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
set :release_file, fetch(:release_file, 'doc/do_on_release.txt') // What file compare
|
13
|
+
set :release_ask, fetch(:release_ask, true) // Pause deploy after cat changes release
|
14
|
+
```
|
15
|
+
|
16
|
+
Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
gem 'capistrano', '~> 3.4'
|
19
|
+
gem 'capistrano-release', '~> 0.1'
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Require
|
24
|
+
|
25
|
+
# Capfile
|
26
|
+
require 'capistrano/release'
|
27
|
+
|
28
|
+
Please note that any `require` should be placed in `Capfile`, not `config/deploy.rb`.
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
1. Fork it
|
33
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
34
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
35
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
36
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "capistrano-release"
|
6
|
+
gem.version = '0.1'
|
7
|
+
gem.authors = "Rustam Zagirov"
|
8
|
+
gem.email = "stammru@gmail.com"
|
9
|
+
gem.description = %q{Cat release file if it changes}
|
10
|
+
gem.summary = %q{Cat release file if it changes}
|
11
|
+
gem.homepage = "https://github.com/stamm/capistrano-release"
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($/)
|
14
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
|
17
|
+
gem.add_dependency 'capistrano', '~> 3.1'
|
18
|
+
|
19
|
+
gem.required_ruby_version = '>= 2.0.0'
|
20
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'capistrano/release/cat'
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../../tasks/cat.rake", __FILE__)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
|
3
|
+
desc 'cat release file if file changes'
|
4
|
+
task :cat_release do
|
5
|
+
on primary fetch(:release_role) do
|
6
|
+
filename = fetch(:release_file)
|
7
|
+
changes = capture("diff -q #{release_path}/#{filename} #{current_path}/#{filename} | wc -l").to_i
|
8
|
+
if changes > 0
|
9
|
+
message = capture(:cat, "#{release_path}/#{filename}")
|
10
|
+
puts <<-EOF
|
11
|
+
************************** WARNING ***************************
|
12
|
+
You need do it on release:
|
13
|
+
#{message}
|
14
|
+
|
15
|
+
Next you just press enter to continue deploy.
|
16
|
+
Or CTRL+C to stop deploy.
|
17
|
+
**************************************************************
|
18
|
+
EOF
|
19
|
+
if fetch(:release_ask)
|
20
|
+
ask(:nothing, '')
|
21
|
+
fetch(:nothing)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
after 'deploy:updating', 'deploy:cat_release'
|
28
|
+
end
|
29
|
+
|
30
|
+
namespace :load do
|
31
|
+
task :defaults do
|
32
|
+
set :release_file, fetch(:release_file, 'doc/do_on_release.txt')
|
33
|
+
set :release_ask, fetch(:release_ask, true)
|
34
|
+
set :release_role, fetch(:release_role, :app)
|
35
|
+
end
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-release
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rustam Zagirov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-18 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: Cat release file if it changes
|
28
|
+
email: stammru@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- ".gitignore"
|
34
|
+
- CHANGELOG.md
|
35
|
+
- Gemfile
|
36
|
+
- LICENSE.txt
|
37
|
+
- README.md
|
38
|
+
- Rakefile
|
39
|
+
- capistrano-release.gemspec
|
40
|
+
- lib/capistrano-release.rb
|
41
|
+
- lib/capistrano/release.rb
|
42
|
+
- lib/capistrano/release/cat.rb
|
43
|
+
- lib/capistrano/tasks/cat.rake
|
44
|
+
homepage: https://github.com/stamm/capistrano-release
|
45
|
+
licenses: []
|
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: 2.0.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.6
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: Cat release file if it changes
|
67
|
+
test_files: []
|