coreos-deploy 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/bin/coreos +16 -2
- data/lib/coreos/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1e85fd5cbbf3539fe6957601df0a8d5f83b631d
|
4
|
+
data.tar.gz: b69af451d262540f7a6b4f7e5e85159fbf268fcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b5ca9acb22f7125b6ce8fc4f6856eada2bac581c80a20b14e17a009a8cc93fc865403c5e8bb90e5e208ad6d49772a84cba7ef3b52183d2bdf9efa0b8a4df36e
|
7
|
+
data.tar.gz: 9fc521f7487a6284a6a50acef519072c28857b82124024eec657fe83aa88470d30052019cae394a73a3bb423a90aa319442ca3eadd057c2f3e215869abdd3d13
|
data/bin/coreos
CHANGED
@@ -11,9 +11,11 @@ end
|
|
11
11
|
|
12
12
|
class CoreOS < Thor
|
13
13
|
desc "deploy HOST", "deploys all services in ./coreos/HOST/*.service to HOST"
|
14
|
+
option :services, :type => :array
|
15
|
+
|
14
16
|
def deploy(host)
|
17
|
+
abort "./coreos does not exist" unless File.exists? "./coreos"
|
15
18
|
directories = Dir.entries("./coreos").select { |s| s.start_with? host }
|
16
|
-
puts directories
|
17
19
|
if directories.count == 1
|
18
20
|
host = directories[0]
|
19
21
|
end
|
@@ -22,6 +24,18 @@ class CoreOS < Thor
|
|
22
24
|
abort "Directory '#{base_directory}' does not exist" unless File.exists? base_directory
|
23
25
|
|
24
26
|
service_files = Dir.entries(base_directory).select { |s| s.end_with? ".service" }
|
27
|
+
|
28
|
+
if options[:services]
|
29
|
+
service_files = service_files.select { |service|
|
30
|
+
found = false
|
31
|
+
for prefix in options[:services]
|
32
|
+
found = true if service.start_with? prefix
|
33
|
+
end
|
34
|
+
|
35
|
+
found
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
25
39
|
abort "No service files found for #{host}" unless service_files.count > 0
|
26
40
|
|
27
41
|
login = nil
|
@@ -40,7 +54,7 @@ class CoreOS < Thor
|
|
40
54
|
images = images.flatten.uniq
|
41
55
|
abort "no docker image found to pull" unless images.count > 0
|
42
56
|
|
43
|
-
puts "==> Copying service files"
|
57
|
+
puts "==> Copying service files to #{host}"
|
44
58
|
system "scp #{base_directory}/*.service #{host}:"
|
45
59
|
|
46
60
|
Net::SSH.start("#{host}", ENV['USER'] ) do |ssh|
|
data/lib/coreos/version.rb
CHANGED