deploy_mate 0.11 → 0.12
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.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/deploy-mate.gemspec +2 -2
- data/lib/deploy_mate/tasks.rake +28 -7
- data/lib/deploy_mate/templates/deploy.rb.erb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df92af3b0b6a83b873bfee7b3b530e587c36c25a
|
4
|
+
data.tar.gz: d22321dbdc778da42189d9675d2bb9d6dc021311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdd8f006ea0e5438a65cee27a31a142126341476ff7674b1c25f40ba7b0a6da796b3e4db9bf825b9b2a03715d96ff0ccfb0609afe17d7af998f375898669bb80
|
7
|
+
data.tar.gz: 932117d4c5e14a6961569ce72f3e3deaf8cdfe0fe08a902b9d100d72532fb2e13d769eedc4da37968d562c0f0fa10a187c1175d3a56e2f430285f511365275cf
|
data/README.md
CHANGED
@@ -20,6 +20,7 @@ You can choose Database:
|
|
20
20
|
- Postgres
|
21
21
|
|
22
22
|
## Changelog
|
23
|
+
* **2015-06-22**: Support for choosing your Ruby-version when creating the `Capfile`. Suggestions come from `.ruby-version` and `Gemfile`.
|
23
24
|
* **2015-04-29**: Load custom rake tasks from lib/capistrano/tasks directory.
|
24
25
|
You need to run the generator ```rake deploy_mate:install``` again or add ```Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }``` to your Capfile.
|
25
26
|
|
data/deploy-mate.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "deploy_mate"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.12"
|
4
4
|
|
5
5
|
s.authors = ["Tim Adler"]
|
6
|
-
s.date = %q{2015-
|
6
|
+
s.date = %q{2015-06-22}
|
7
7
|
s.description = %q{This is how we deploy around here.}
|
8
8
|
s.summary = s.description
|
9
9
|
s.email = %q{tim.adler (at) hanseventures (dot) com}
|
data/lib/deploy_mate/tasks.rake
CHANGED
@@ -7,15 +7,16 @@ namespace :deploy_mate do
|
|
7
7
|
puts "I'm your DEPLOY_MATE."
|
8
8
|
puts "We will setting up your deployment now."
|
9
9
|
|
10
|
-
@
|
11
|
-
@
|
10
|
+
@ruby_version = ask("Ruby-Version (the RVM-way, e.g. ruby-2.2.0)", guess_ruby_version)
|
11
|
+
@app_name = ask("App-Name (for nginx, servers, etc.)", guess_app_name)
|
12
|
+
@repo_url = ask("Url-Location of git-repo", "git@github.com:hanseventures/#{@app_name}.git")
|
12
13
|
@is_rails = yes_or_no?("Is this a RAILS project ?", (rails_present? ? "yes" : "no"))
|
13
14
|
|
14
|
-
@stage_name = ask("Give the first stage a name
|
15
|
-
@ssh_name = ask("SSH-Hostname for the server
|
16
|
-
@branch_name = ask("Branch to deploy '#{@stage_name}' from
|
17
|
-
@host_name = ask("Web-URL for '#{@stage_name}'
|
18
|
-
@environment = ask("#{@stage_name}'s environment (RACK_ENV/RAILS_ENV)
|
15
|
+
@stage_name = ask("Give the first stage a name", "prestage")
|
16
|
+
@ssh_name = ask("SSH-Hostname for the server", "#{@app_name}-#{@stage_name}")
|
17
|
+
@branch_name = ask("Branch to deploy '#{@stage_name}' from", "dev")
|
18
|
+
@host_name = ask("Web-URL for '#{@stage_name}'", "#{@stage_name}.#{@app_name}")
|
19
|
+
@environment = ask("#{@stage_name}'s environment (RACK_ENV/RAILS_ENV)", "#{@stage_name}")
|
19
20
|
@db_engine = ask_until("What db are you using?", %w( postgresql mysql ), "mysql")
|
20
21
|
|
21
22
|
puts "Aye!"
|
@@ -49,6 +50,22 @@ def guess_app_name
|
|
49
50
|
Dir.pwd.split(File::SEPARATOR).last
|
50
51
|
end
|
51
52
|
|
53
|
+
def guess_ruby_version
|
54
|
+
ruby_version = nil
|
55
|
+
ruby_version = cat_file(".ruby-version")
|
56
|
+
ruby_version.strip! if ruby_version
|
57
|
+
unless ruby_version
|
58
|
+
gem_file_content = cat_file("Gemfile")
|
59
|
+
if gem_file_content
|
60
|
+
match = gem_file_content.match("^ruby '(?<version>[0-9.]*)'")
|
61
|
+
if match
|
62
|
+
ruby_version = "ruby-" + match["version"]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
ruby_version
|
67
|
+
end
|
68
|
+
|
52
69
|
def yes_or_no?(prompt, default = nil)
|
53
70
|
answer = "undefined"
|
54
71
|
while(!["yes", "no"].include?(answer))
|
@@ -74,3 +91,7 @@ def ask(prompt, default = nil)
|
|
74
91
|
data = Readline.readline("#{prompt}: ")
|
75
92
|
return data.chomp
|
76
93
|
end
|
94
|
+
|
95
|
+
def cat_file(filename)
|
96
|
+
File.open(filename, 'rb') { |f| f.read } if File.exist?(filename)
|
97
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy_mate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.12'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Adler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|