keel 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9990776275902868c2a1b8a6d21d0fd22513062d
4
- data.tar.gz: f85d922dbfb13ffe9bff782ff8e0e4f98cd85435
3
+ metadata.gz: 9b6eaebb9c8ca3c0d335c1447a0ead60aa4ae0fa
4
+ data.tar.gz: 5069e1a53e464f13a0e2a1baecf66919c510754a
5
5
  SHA512:
6
- metadata.gz: 3009f39f0f6d91b7e2f6fe3d86d18d8fabfe166dd65426efeeb17c8d4a660cd6cd4a2c997574f483ade191124d21f3dbff978c5eafb75587089c19ced0933835
7
- data.tar.gz: 014e2faea3583f3bb45a62b2b9dce4010a34bd78a5431978c05172ba7e0683c2bfac8fd445a4029d66f2b62dffeedba0aa0e4f210069ede90e236011c906ca1a
6
+ metadata.gz: acb1c9adc1efc8cb292684a73952c543b5a0aa74118d984c8badd06411b5136610986bfd9b6e0dc123762d5dfa762f388ee78fd510fc5ecd1832c5a2ea993eed
7
+ data.tar.gz: 86cc49d869b21b9155ade83bb4e2d47bd22a2f6327591264d6972517ba03416d686a70a8159ac5e34231b5260af78d9b4f3faf17dbbb0a2fd69940d37adae2c5
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  This gem provides a few easy to run rake tasks to deploy your [Rails](http://rubyonrails.org/) application to a [Kubernetes](http://kubernetes.io/) cluster.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/keel.svg)](https://badge.fury.io/rb/keel)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -5,8 +5,8 @@ module Keel
5
5
 
6
6
  source_root File.expand_path('../templates', __FILE__)
7
7
 
8
- def copy_settings
9
- copy "gcloud.yml", "config/gcloud.yml"
8
+ def copy_config
9
+ copy_file "gcloud.yml", "config/gcloud.yml"
10
10
  end
11
11
  end
12
12
  end
@@ -16,7 +16,7 @@ module Keel::GCloud
16
16
  # @return [Boolean] whether the call succeeded or not
17
17
  #
18
18
  def self.authenticate
19
- Cli.new.system 'gcloud auth login'
19
+ Cli.new.system_call 'gcloud auth login'
20
20
  end
21
21
 
22
22
  #
@@ -26,7 +26,7 @@ module Keel::GCloud
26
26
  # @return [Boolean] whether the call succeeded or not
27
27
  #
28
28
  def authenticate_k8s
29
- @cli.system "gcloud container clusters get-credentials #{self.config.container_cluster}"
29
+ @cli.system_call "gcloud container clusters get-credentials #{self.config.container_cluster}"
30
30
  end
31
31
  end
32
32
  end
@@ -1,7 +1,7 @@
1
1
  module Keel::GCloud
2
2
  #
3
3
  # A helper class to run system commands and handle interrupts.
4
- #
4
+ #
5
5
  class Cli
6
6
  def execute command
7
7
  begin
@@ -11,7 +11,7 @@ module Keel::GCloud
11
11
  end
12
12
  end
13
13
 
14
- def system command
14
+ def system_call command
15
15
  begin
16
16
  system command
17
17
  rescue Interrupt
@@ -9,7 +9,7 @@ module Keel::GCloud
9
9
  # @return [Boolean] whether the call succeeded or not
10
10
  #
11
11
  def self.update
12
- Cli.new.system 'gcloud components update'
12
+ Cli.new.system_call 'gcloud components update'
13
13
  end
14
14
 
15
15
  #
@@ -18,7 +18,7 @@ module Keel::GCloud
18
18
  # @return [Boolean] whether the call succeeded or not
19
19
  #
20
20
  def self.install_k8s
21
- Cli.new.system 'gcloud components install kubectl'
21
+ Cli.new.system_call 'gcloud components install kubectl'
22
22
  end
23
23
  end
24
24
  end
@@ -53,7 +53,7 @@ module Keel::GCloud
53
53
  # @return [Boolean]
54
54
  #
55
55
  def executable_installed?
56
- @cli.system 'which gcloud'
56
+ @cli.system_call 'which gcloud'
57
57
  $?.success?
58
58
  end
59
59
 
@@ -101,9 +101,9 @@ module Keel::GCloud
101
101
  # if they are not already set.
102
102
  #
103
103
  def set_properties
104
- @cli.system "gcloud config set compute/zone #{self.compute_zone}"
105
- @cli.system "gcloud config set container/cluster #{self.container_cluster}"
106
- @cli.system "gcloud config set project #{self.project_id}"
104
+ @cli.system_call "gcloud config set compute/zone #{self.compute_zone}"
105
+ @cli.system_call "gcloud config set container/cluster #{self.container_cluster}"
106
+ @cli.system_call "gcloud config set project #{self.project_id}"
107
107
  end
108
108
  end
109
109
  end
@@ -71,7 +71,7 @@ module Keel::GCloud
71
71
  # @return [Boolean] whether the call succeeded or not
72
72
  #
73
73
  def delete
74
- @cli.system "kubectl delete po #{self.name} --namespace=#{self.namespace}"
74
+ @cli.system_call "kubectl delete po #{self.name} --namespace=#{self.namespace}"
75
75
  end
76
76
 
77
77
  #
@@ -89,7 +89,7 @@ module Keel::GCloud
89
89
  @prompter.print 'Use Ctrl-C to stop'
90
90
  end
91
91
 
92
- @cli.system "kubectl logs #{f}#{self.name} --namespace=#{self.namespace} -c=#{self.app}"
92
+ @cli.system_call "kubectl logs #{f}#{self.name} --namespace=#{self.namespace} -c=#{self.app}"
93
93
  end
94
94
  end
95
95
  end
@@ -62,7 +62,7 @@ module Keel::GCloud
62
62
  # @return [Boolean] whether the call succeeded or not
63
63
  #
64
64
  def self.replace file
65
- Cli.new.system "kubectl replace -f #{file}"
65
+ Cli.new.system_call "kubectl replace -f #{file}"
66
66
  end
67
67
 
68
68
  #
@@ -10,7 +10,7 @@ module Keel::GCloud
10
10
  #
11
11
  def notify
12
12
  env = @env == 'production' ? 'production' : 'staging'
13
- @cli.system "newrelic deployments -e #{env} -r #{@sha} -u #{@user}"
13
+ @cli.system_call "newrelic deployments -e #{env} -r #{@sha} -u #{@user}"
14
14
  end
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Keel
2
- VERSION = "0.1.0" # :nodoc:
2
+ VERSION = "0.1.1" # :nodoc:
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Youssef Chaker