keel 0.1.0 → 0.1.1
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/README.md +2 -0
- data/lib/generators/keel/config_generator.rb +2 -2
- data/lib/keel/gcloud/auth.rb +2 -2
- data/lib/keel/gcloud/cli.rb +2 -2
- data/lib/keel/gcloud/component.rb +2 -2
- data/lib/keel/gcloud/config.rb +4 -4
- data/lib/keel/gcloud/kubernetes/pod.rb +2 -2
- data/lib/keel/gcloud/kubernetes/replication_controller.rb +1 -1
- data/lib/keel/gcloud/notifier/new_relic.rb +1 -1
- data/lib/keel/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: 9b6eaebb9c8ca3c0d335c1447a0ead60aa4ae0fa
|
4
|
+
data.tar.gz: 5069e1a53e464f13a0e2a1baecf66919c510754a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
[](https://badge.fury.io/rb/keel)
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
data/lib/keel/gcloud/auth.rb
CHANGED
@@ -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.
|
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.
|
29
|
+
@cli.system_call "gcloud container clusters get-credentials #{self.config.container_cluster}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
data/lib/keel/gcloud/cli.rb
CHANGED
@@ -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
|
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.
|
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.
|
21
|
+
Cli.new.system_call 'gcloud components install kubectl'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/keel/gcloud/config.rb
CHANGED
@@ -53,7 +53,7 @@ module Keel::GCloud
|
|
53
53
|
# @return [Boolean]
|
54
54
|
#
|
55
55
|
def executable_installed?
|
56
|
-
@cli.
|
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.
|
105
|
-
@cli.
|
106
|
-
@cli.
|
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.
|
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.
|
92
|
+
@cli.system_call "kubectl logs #{f}#{self.name} --namespace=#{self.namespace} -c=#{self.app}"
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -10,7 +10,7 @@ module Keel::GCloud
|
|
10
10
|
#
|
11
11
|
def notify
|
12
12
|
env = @env == 'production' ? 'production' : 'staging'
|
13
|
-
@cli.
|
13
|
+
@cli.system_call "newrelic deployments -e #{env} -r #{@sha} -u #{@user}"
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/keel/version.rb
CHANGED