bedrock-capistrano-mysql 0.0.1

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: 39d7193472b5304f1d39c09d61c3cf9153b3aca6
4
+ data.tar.gz: 1b4b058fd3809b1957e5a9e0704bcbd806c11bdb
5
+ SHA512:
6
+ metadata.gz: 689e9445004dd470c356605c5cf49a0c2b2f720a6d02bd31c5b1d2e14b3f56cad79d350064198c7ed344c75e39010d6a68102027ae43c7e8338fa44d8514bcf9
7
+ data.tar.gz: 4e0d43765f0f657aed1ffa4430d87e3a15b6803b973c094534af1cfab2b94049781fe9ed988dd809918e013c9626ab99ac82b09e3be828d28d120518e815f1ce
@@ -0,0 +1,2 @@
1
+ # Mac OS X
2
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,31 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bedrock-capistrano-mysql (0.0.2)
5
+ capistrano (>= 3.0.0.pre)
6
+ dotenv (>= 2.0.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ capistrano (3.4.0)
12
+ i18n
13
+ rake (>= 10.0.0)
14
+ sshkit (~> 1.3)
15
+ colorize (0.7.7)
16
+ dotenv (2.0.1)
17
+ i18n (0.7.0)
18
+ net-scp (1.2.1)
19
+ net-ssh (>= 2.6.5)
20
+ net-ssh (2.9.2)
21
+ rake (10.4.2)
22
+ sshkit (1.7.1)
23
+ colorize (>= 0.7.0)
24
+ net-scp (>= 1.1.2)
25
+ net-ssh (>= 2.8.0)
26
+
27
+ PLATFORMS
28
+ ruby
29
+
30
+ DEPENDENCIES
31
+ bedrock-capistrano-mysql!
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Norkay AB – Step by step, to the top.
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.
@@ -0,0 +1,39 @@
1
+ # Capistrano MySQL-tasks for Bedrock (https://github.com/roots/bedrock)
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'bedrock-capistrano-mysql', '~> 0.0.1'
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install bedrock-capistrano-mysql
18
+
19
+ ## Usage
20
+
21
+ Require the module in your `Capfile`:
22
+
23
+ ```ruby
24
+ require 'bedrock-capistrano-mysql'
25
+ ```
26
+
27
+ `bedrock-capistrano-mysql` comes with one task:
28
+
29
+ * mysql:backup
30
+
31
+ The `mysql:backup` task will backup your database to your shared-folder. It will keep the five latest backups.
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create new Pull Request
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = 'bedrock-capistrano-mysql'
6
+ spec.version = '0.0.1'
7
+ spec.authors = ['Fredrik Sundström']
8
+ spec.email = ['fredrik.sundstrom@norkay.se']
9
+ spec.description = %q{MySQL tasks for roots/bedrock, using Capistrano 3.x}
10
+ spec.summary = %q{MySQL tasks for roots/bedrock, using Capistrano 3.x}
11
+ spec.homepage = 'https://github.com/norkay/bedrock-capistrano-mysql'
12
+ spec.license = 'MIT'
13
+
14
+ spec.files = `git ls-files`.split($/)
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ['lib']
18
+
19
+ spec.add_dependency 'capistrano', '>= 3.0.0.pre'
20
+ spec.add_dependency 'dotenv', '>= 2.0.1'
21
+ end
@@ -0,0 +1 @@
1
+ require File.expand_path("#{File.dirname(__FILE__)}/capistrano/mysql")
@@ -0,0 +1,15 @@
1
+ require 'dotenv'
2
+
3
+ namespace(:mysql) do
4
+ desc "Backup MySQL Database"
5
+ task :backup do
6
+ on roles(:all) do
7
+ timestamp = Time.now.strftime('%Y%m%d%H%M%S')
8
+ text = capture "cat #{shared_path}/.env"
9
+ ENV2 = Dotenv::Parser.call(text)
10
+ execute "mkdir -p #{shared_path}/db_backups"
11
+ execute "mysqldump -h #{ENV2['DB_HOST']} -u#{ENV2['DB_USER']} -p#{ENV2['DB_PASSWORD']} #{ENV2['DB_NAME']} > #{shared_path}/db_backups/#{timestamp}.sql"
12
+ execute "(cd #{shared_path}/db_backups; ls -1tr | head -n -5 | xargs -d '\\n' rm)" # Keep only five latest
13
+ end
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bedrock-capistrano-mysql
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Fredrik Sundström
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-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.0.0.pre
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.0.pre
27
+ - !ruby/object:Gem::Dependency
28
+ name: dotenv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.1
41
+ description: MySQL tasks for roots/bedrock, using Capistrano 3.x
42
+ email:
43
+ - fredrik.sundstrom@norkay.se
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - LICENSE
52
+ - README.md
53
+ - bedrock-capistrano-mysql.gemspec
54
+ - lib/bedrock-capistrano-mysql.rb
55
+ - lib/capistrano/mysql.rb
56
+ homepage: https://github.com/norkay/bedrock-capistrano-mysql
57
+ licenses:
58
+ - MIT
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.4.5
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: MySQL tasks for roots/bedrock, using Capistrano 3.x
80
+ test_files: []