foreplay 0.1.5 → 0.1.6
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/.rubocop.yml +11 -2
- data/Rakefile +1 -1
- data/foreplay.gemspec +6 -6
- data/lib/foreplay/cli.rb +48 -48
- data/lib/foreplay/deploy.rb +361 -344
- data/lib/foreplay/setup.rb +33 -33
- data/lib/foreplay/utility.rb +3 -3
- data/lib/foreplay/version.rb +1 -1
- data/spec/lib/foreplay/deploy_spec.rb +130 -122
- data/spec/lib/foreplay/setup_spec.rb +13 -13
- data/spec/lib/foreplay/utility_spec.rb +28 -28
- data/spec/spec_helper.rb +2 -2
- 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: 9c72088d7decdc5b01df947f9fe9b75126b993ed
|
|
4
|
+
data.tar.gz: 7358aef33e4733116bf6b04370f5eb4dfd33295f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 191b4ffdc61920925219d60de8d0796c40e95cd173cfd9babf3ac0b46445abb0a6cfaecc95d55540819d012f34de749ef5d2686f052b1ded88b1336306fac0af
|
|
7
|
+
data.tar.gz: cf6d311e297d08c9afa308d604ee7f8c2a54598becd82d4b819bd2aeeba09b3482eeee661f7572cc70e687d5675b0801156755aa5df12158d82dae3fec8496ed
|
data/.rubocop.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
LineLength:
|
|
2
|
-
Description: 'Limit lines to
|
|
3
|
-
Max:
|
|
2
|
+
Description: 'Limit lines to 137 characters.'
|
|
3
|
+
Max: 137
|
|
4
4
|
Enabled: true
|
|
5
5
|
|
|
6
6
|
FileName:
|
|
@@ -14,3 +14,12 @@ MethodLength:
|
|
|
14
14
|
Documentation:
|
|
15
15
|
Description: 'Document classes and non-namespace modules.'
|
|
16
16
|
Enabled: false
|
|
17
|
+
|
|
18
|
+
CyclomaticComplexity:
|
|
19
|
+
Description: 'Avoid complex methods.'
|
|
20
|
+
Max: 13
|
|
21
|
+
|
|
22
|
+
ClassLength:
|
|
23
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
|
24
|
+
CountComments: false # count full line comments?
|
|
25
|
+
Max: 269
|
data/Rakefile
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/foreplay.gemspec
CHANGED
|
@@ -7,21 +7,21 @@ Gem::Specification.new do |spec|
|
|
|
7
7
|
spec.version = Foreplay::VERSION
|
|
8
8
|
spec.authors = ['Xenapto']
|
|
9
9
|
spec.email = ['developers@xenapto.com']
|
|
10
|
-
spec.description = %q
|
|
11
|
-
spec.summary = %q
|
|
10
|
+
spec.description = %q(Deploying Rails projects to Ubuntu using Foreman)
|
|
11
|
+
spec.summary = %q(Example: foreplay push to production)
|
|
12
12
|
spec.homepage = 'https://github.com/Xenapto/foreplay'
|
|
13
13
|
spec.license = 'MIT'
|
|
14
14
|
|
|
15
|
-
spec.files = `git ls-files`.split(
|
|
16
|
-
spec.executables = spec.files.grep(
|
|
17
|
-
spec.test_files = spec.files.grep(
|
|
15
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
16
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
|
17
|
+
spec.test_files = spec.files.grep(/^(test|spec|features|coverage)\//)
|
|
18
18
|
spec.require_paths = ['lib']
|
|
19
19
|
|
|
20
20
|
spec.add_runtime_dependency 'activesupport', '> 3.2'
|
|
21
21
|
spec.add_runtime_dependency 'colorize', '~> 0.7'
|
|
22
22
|
spec.add_runtime_dependency 'foreman', '~> 0.67'
|
|
23
23
|
spec.add_runtime_dependency 'net-ssh-shell', '~> 0.2'
|
|
24
|
-
#spec.add_runtime_dependency 'thor', '~> 0.19' # Dependency of foreman anyway
|
|
24
|
+
# spec.add_runtime_dependency 'thor', '~> 0.19' # Dependency of foreman anyway
|
|
25
25
|
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
|
27
27
|
spec.add_development_dependency 'rake', '~> 10.3'
|
data/lib/foreplay/cli.rb
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
require 'thor'
|
|
2
|
-
require 'foreplay'
|
|
3
|
-
|
|
4
|
-
module Foreplay
|
|
5
|
-
class CLI < Thor
|
|
6
|
-
desc 'deploy ENVIRONMENT', 'Deploys to specified environment'
|
|
7
|
-
|
|
8
|
-
method_option :role, :
|
|
9
|
-
method_option :server, :
|
|
10
|
-
|
|
11
|
-
def deploy(environment)
|
|
12
|
-
Foreplay::Deploy.start [:deploy, environment, options]
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
desc 'check ENVIRONMENT', 'Checks if configuration is OK for specified environment'
|
|
16
|
-
|
|
17
|
-
method_option :role, :
|
|
18
|
-
method_option :server, :
|
|
19
|
-
|
|
20
|
-
def check(environment)
|
|
21
|
-
Foreplay::Deploy.start [:check, environment, options]
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
desc 'setup', 'Create the Foreplay config file'
|
|
25
|
-
|
|
26
|
-
method_option :name, :
|
|
27
|
-
method_option :repository, :
|
|
28
|
-
method_option :user, :
|
|
29
|
-
method_option :password
|
|
30
|
-
method_option :keyfile
|
|
31
|
-
method_option :private_key, :
|
|
32
|
-
method_option :path, :
|
|
33
|
-
method_option :port, :
|
|
34
|
-
method_option :servers, :
|
|
35
|
-
method_option :db_adapter, :
|
|
36
|
-
method_option :db_encoding, :
|
|
37
|
-
method_option :db_name, :
|
|
38
|
-
method_option :db_pool , :
|
|
39
|
-
method_option :db_host, :
|
|
40
|
-
method_option :db_user
|
|
41
|
-
method_option :db_password
|
|
42
|
-
method_option :resque_redis
|
|
43
|
-
|
|
44
|
-
def setup
|
|
45
|
-
Foreplay::Setup.start
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
1
|
+
require 'thor'
|
|
2
|
+
require 'foreplay'
|
|
3
|
+
|
|
4
|
+
module Foreplay
|
|
5
|
+
class CLI < Thor
|
|
6
|
+
desc 'deploy ENVIRONMENT', 'Deploys to specified environment'
|
|
7
|
+
|
|
8
|
+
method_option :role, aliases: '-r'
|
|
9
|
+
method_option :server, aliases: '-s'
|
|
10
|
+
|
|
11
|
+
def deploy(environment)
|
|
12
|
+
Foreplay::Deploy.start [:deploy, environment, options]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc 'check ENVIRONMENT', 'Checks if configuration is OK for specified environment'
|
|
16
|
+
|
|
17
|
+
method_option :role, aliases: '-r'
|
|
18
|
+
method_option :server, aliases: '-s'
|
|
19
|
+
|
|
20
|
+
def check(environment)
|
|
21
|
+
Foreplay::Deploy.start [:check, environment, options]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
desc 'setup', 'Create the Foreplay config file'
|
|
25
|
+
|
|
26
|
+
method_option :name, aliases: '-n'
|
|
27
|
+
method_option :repository, aliases: '-r'
|
|
28
|
+
method_option :user, aliases: '-u'
|
|
29
|
+
method_option :password
|
|
30
|
+
method_option :keyfile
|
|
31
|
+
method_option :private_key, aliases: '-k'
|
|
32
|
+
method_option :path, aliases: '-f'
|
|
33
|
+
method_option :port, aliases: '-p', type: :numeric
|
|
34
|
+
method_option :servers, aliases: '-s', type: :array
|
|
35
|
+
method_option :db_adapter, aliases: '-a'
|
|
36
|
+
method_option :db_encoding, aliases: '-e'
|
|
37
|
+
method_option :db_name, aliases: '-d'
|
|
38
|
+
method_option :db_pool , type: :numeric
|
|
39
|
+
method_option :db_host, aliases: '-h'
|
|
40
|
+
method_option :db_user
|
|
41
|
+
method_option :db_password
|
|
42
|
+
method_option :resque_redis
|
|
43
|
+
|
|
44
|
+
def setup
|
|
45
|
+
Foreplay::Setup.start
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|