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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/coreos +16 -2
  3. data/lib/coreos/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef184e886de61101c15787a20af08631d90f9948
4
- data.tar.gz: 7ca01708bc06ed362fabb67d531c8ba7651ad252
3
+ metadata.gz: e1e85fd5cbbf3539fe6957601df0a8d5f83b631d
4
+ data.tar.gz: b69af451d262540f7a6b4f7e5e85159fbf268fcb
5
5
  SHA512:
6
- metadata.gz: 6c2f9cc319f6653bfd6806d6c6ab03daaa66eb551c781aa4a218d9a33d03a1fd0e8f498eaa8ff0c603f397345fa6a55e816e8320aa8502b8ca3f770a5515c167
7
- data.tar.gz: d6bb350c8db717cf8773c00341875352045155a3387b5820fcdb6e73a24bd274deccd3218307c0ae88aed9d53e668cda0fb0c815f715212a4181bb500c8703f7
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|
@@ -1,3 +1,3 @@
1
1
  module Coreos
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coreos-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Letterer