capistrano-monitrc 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c4332f0c9536a77de960eab001a04ff8adf1d747
4
+ data.tar.gz: 658da73e1cf8ff1dabfb89e953d38569538e2c72
5
+ SHA512:
6
+ metadata.gz: 3def8441134212261df7723c84d2be0d91ddb296499a240bfcf387507ebc61fb6c14623d75f4b0b7e692cb2c22e5aaf00791cf9b1020023265d1e85d96293233
7
+ data.tar.gz: 1bf5fbdf4629bec53debb04a3f8b138c6a5f2aace4c5e27ea6edd4f1fbe6780e744d66dfd8f6b4d06e1499afecc5cb3871b4dc46bff277417b7b547dd5db5c1c
@@ -0,0 +1,24 @@
1
+ # Capistrano::Monitrc
2
+
3
+ ## Installation
4
+
5
+ ```ruby
6
+ gem 'capistrano-monitrc'
7
+ ```
8
+
9
+ And then execute:
10
+
11
+ $ bundle
12
+
13
+ Require in `Capfile` to use the tasks.
14
+
15
+ ## Tasks
16
+
17
+ Download `/etc/monitrc` file to local folder as #{hostname}.monitrc file name
18
+
19
+ $ cap production monitrc:download
20
+
21
+ Upload local hostname.monitrc file to `/etc/monitrc`
22
+
23
+ $ cap production monitrc:deploy
24
+
@@ -0,0 +1,20 @@
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-monitrc"
7
+ spec.version = "0.1.0"
8
+ spec.authors = %w(iamdionysus)
9
+ spec.email = %w(iamdionysus@gmail.com)
10
+
11
+ spec.summary = %q{capistrano3 monitrc download upload task}
12
+ spec.homepage = "https://github.com/iamdionysus/capistrano-monitrc"
13
+
14
+ spec.files = Dir["*.gemspec", "*.md", "lib/**/*.rb", "lib/**/*.rake"]
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_dependency "capistrano", "~> 3.1"
18
+ spec.add_development_dependency "bundler", "~> 1.10"
19
+ spec.add_development_dependency "rake", "~> 10.0"
20
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path("../tasks/monitrc.rake", __FILE__)
@@ -0,0 +1,34 @@
1
+ namespace :monitrc do
2
+ desc "Download monitrc from the hosts"
3
+ task :download do
4
+ on roles(:all) do |host|
5
+ hostname = host.hostname
6
+ monitrc = "#{hostname}.monitrc"
7
+ remote_monitrc = current_path.join monitrc
8
+
9
+ # monitrc copied to deploy folder
10
+ sudo :cp, "/etc/monitrc", remote_monitrc
11
+ # change permission to be able to download
12
+ sudo :chmod, "644", remote_monitrc
13
+ # download and save it to local
14
+ download! remote_monitrc, monitrc
15
+ # delete the file
16
+ execute :rm, remote_monitrc
17
+ end
18
+ end
19
+
20
+ desc "copy monitrc to /etc/monitrc and change permission"
21
+ task :deploy do
22
+ on roles(:all) do |host|
23
+ hostname = host.hostname
24
+ monitrc = "#{hostname}.monitrc"
25
+ remote_monitrc = current_path.join monitrc
26
+
27
+ # mointrc copied to /etc/moinrc
28
+ sudo :cp, remote_monitrc, "/etc/monitrc"
29
+ # change permission so that it makes monit service happy
30
+ sudo :chmod, "600", "/etc/monitrc"
31
+ end
32
+ end
33
+ end
34
+
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-monitrc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - iamdionysus
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-25 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
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description:
56
+ email:
57
+ - iamdionysus@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - capistrano-monitrc.gemspec
63
+ - README.md
64
+ - lib/capistrano/monitrc.rb
65
+ - lib/capistrano/tasks/monitrc.rake
66
+ homepage: https://github.com/iamdionysus/capistrano-monitrc
67
+ licenses: []
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.0.14
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: capistrano3 monitrc download upload task
89
+ test_files: []