scatter_deploy 0.1.3 → 0.1.4
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 +7 -0
- data/README.md +5 -5
- data/lib/scatter/cli.rb +46 -37
- data/lib/scatter.rb +1 -1
- metadata +7 -16
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6af75dd747591b2a9d664067d433790713a76ebe
|
4
|
+
data.tar.gz: 5efbd7958b3e24468a613ab01fe2ea50ecc8407c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 34b265d0a713f0f0be7efdfa051be30435412126905caa3a158b7557cb401e1b062f905bc0aa102a3630fe0ca066161649e420376c38fc20ddb220e22150d7a0
|
7
|
+
data.tar.gz: eb12b87e636831e94d303ad6cbcf4d1b6678d3a50b217f5bb55b2b53df6a050176b077a5105b6d25570916372369802967d88a0f5dd0fdd5c82f453f2f13c0da
|
data/README.md
CHANGED
@@ -14,11 +14,11 @@ You interact with Scatter through the `scatter` command. You can see a basic ov
|
|
14
14
|
|
15
15
|
```
|
16
16
|
Tasks:
|
17
|
-
scatter cap COMMAND
|
18
|
-
scatter deploy
|
19
|
-
scatter
|
20
|
-
scatter help [TASK]
|
21
|
-
scatter version
|
17
|
+
scatter cap COMMAND # Run arbitrary Capistrano commands.
|
18
|
+
scatter deploy # Run a deploy routine. This is the default task.
|
19
|
+
scatter exec COMMAND # Run arbitrary commands.
|
20
|
+
scatter help [TASK] # Describe available tasks or one specific task
|
21
|
+
scatter version # Show version.
|
22
22
|
|
23
23
|
Options:
|
24
24
|
-d, [--directory=DIRECTORY] # Specify a deploys directory.
|
data/lib/scatter/cli.rb
CHANGED
@@ -41,55 +41,64 @@ module Scatter
|
|
41
41
|
say Scatter::VERSION
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
no_tasks do
|
45
|
+
def git?
|
46
|
+
unless system "which git >/dev/null 2>&1"
|
47
|
+
abort "Scatter requires Git if you want it to find projects automatically"
|
48
|
+
end
|
48
49
|
|
49
|
-
|
50
|
-
if options.project
|
51
|
-
File.expand_path options.project
|
52
|
-
elsif git?
|
53
|
-
`git rev-parse --show-toplevel`.chomp
|
50
|
+
`git rev-parse --is-inside-work-tree 2>/dev/null`.match "^true"
|
54
51
|
end
|
55
|
-
end
|
56
52
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
53
|
+
def project_path
|
54
|
+
if options.project
|
55
|
+
File.expand_path options.project
|
56
|
+
elsif git?
|
57
|
+
`git rev-parse --show-toplevel`.chomp
|
58
|
+
end
|
62
59
|
end
|
63
|
-
end
|
64
60
|
|
65
|
-
|
66
|
-
|
67
|
-
|
61
|
+
def project_deploy_dir
|
62
|
+
if options.shared
|
63
|
+
"#{options.directory}/__shared"
|
64
|
+
elsif project_path
|
65
|
+
"#{options.directory}/#{File.basename project_path}"
|
66
|
+
end
|
67
|
+
end
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
69
|
+
def capfile?
|
70
|
+
File.exists? "#{project_deploy_dir}/Capfile"
|
71
|
+
end
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
return "cap deploy" if capfile?
|
78
|
-
end
|
73
|
+
def executable?
|
74
|
+
deploy = "#{project_deploy_dir}/deploy"
|
75
|
+
return false unless File.exists? deploy
|
79
76
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
77
|
+
if File.executable? deploy
|
78
|
+
return true
|
79
|
+
else
|
80
|
+
abort "It looks like you have a deploy file, but it's not executable. Try something like: chmod +x #{deploy}"
|
81
|
+
end
|
84
82
|
end
|
85
83
|
|
86
|
-
|
87
|
-
|
88
|
-
return
|
84
|
+
def generate_command
|
85
|
+
return "./#{options.shared} #{project_path}" if options.shared
|
86
|
+
return "./deploy #{project_path}" if executable?
|
87
|
+
return "cap deploy" if capfile?
|
89
88
|
end
|
90
89
|
|
91
|
-
|
92
|
-
|
90
|
+
def run(command=nil)
|
91
|
+
unless project_deploy_dir
|
92
|
+
abort "No deploy directory found"
|
93
|
+
end
|
94
|
+
|
95
|
+
unless command ||= generate_command
|
96
|
+
abort "No deploy command found"
|
97
|
+
end
|
93
98
|
|
99
|
+
system "cd #{project_deploy_dir} && #{command}"
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
94
103
|
end
|
95
104
|
end
|
data/lib/scatter.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scatter_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Evan Solomon
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-21 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: thor
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -59,30 +54,26 @@ files:
|
|
59
54
|
homepage: http://evansolomon.me/
|
60
55
|
licenses:
|
61
56
|
- MIT
|
57
|
+
metadata: {}
|
62
58
|
post_install_message:
|
63
59
|
rdoc_options: []
|
64
60
|
require_paths:
|
65
61
|
- lib
|
66
62
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
63
|
requirements:
|
69
|
-
- -
|
64
|
+
- - '>='
|
70
65
|
- !ruby/object:Gem::Version
|
71
66
|
version: '0'
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
hash: 1486605952724511090
|
75
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
68
|
requirements:
|
78
|
-
- -
|
69
|
+
- - '>='
|
79
70
|
- !ruby/object:Gem::Version
|
80
71
|
version: 1.3.6
|
81
72
|
requirements: []
|
82
73
|
rubyforge_project:
|
83
|
-
rubygems_version:
|
74
|
+
rubygems_version: 2.0.0
|
84
75
|
signing_key:
|
85
|
-
specification_version:
|
76
|
+
specification_version: 4
|
86
77
|
summary: Scatter separates deploy scripts from project code, but keeps the convenience
|
87
78
|
of running deploys from project directories.
|
88
79
|
test_files: []
|