g5deploy 0.0.2 → 0.0.3

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: b16a0ec3392bf031a5bffe5d576f01aaa0a144f9
4
- data.tar.gz: 43fdaba1041424a5b28ed0aa4d0022894326d264
3
+ metadata.gz: af31f2c38d490dcdfd504ce812566381f4fd3563
4
+ data.tar.gz: c886eb9a37558a499634619a51a4448ab104b8f0
5
5
  SHA512:
6
- metadata.gz: 81c2a7e57df3f8a638fc14c90ef4013589e03cf1e55f32acf0325e5539e5a3494bcbada8e3687f056b3223f4653dbc6dc504210f31ca7b1983e545885b248740
7
- data.tar.gz: 849d0d231c5f56a4634316e5402039d7d9850c45a0f0c7b0f24f8f800de8d46ec73b320fa0479b83cddad08656101de5d8b8ab53ba574eeb000b86a26bd1705e
6
+ metadata.gz: 4d8e3e89f8985057418879b5d034d4450c9d5e99d52f299a0e7ed8b1cc5321703f5a1b52aeb85104adf938ead9d234aa01ffee728a86e5f91f31a949d6ba1b81
7
+ data.tar.gz: 9ffb504003376fbbda827112b2d2972e5435149e8464ce56b734110955d4bb20aefda5dafc81ec1ee829c992b38d1d335ee18a9a59322d835c73e7b1430083bf
data/lib/g5deploy/cli.rb CHANGED
@@ -7,19 +7,23 @@ module G5deploy
7
7
  option :with_migration
8
8
  def deploy(environment)
9
9
  if environment == "production" && options[:with_migration]
10
- `kubectl config use-context g5-prod && kubectl \
10
+ cmd = "kubectl config use-context g5-prod && kubectl \
11
11
  apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml \
12
- -f k8s/db-migrate.yaml`
12
+ -f k8s/db-migrate.yaml"
13
+ run_command(cmd)
13
14
  elsif environment == "production"
14
- `kubectl config use-context g5-prod && kubectl \
15
- apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml`
15
+ cmd = "kubectl config use-context g5-prod && kubectl \
16
+ apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml"
17
+ run_command(cmd)
16
18
  elsif environment == "staging" && options[:with_migration]
17
- `kubectl config use-context integrations-staging && kubectl \
19
+ cmd = "kubectl config use-context integrations-staging && kubectl \
18
20
  apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml \
19
- -f k8s/db-migrate.yaml`
21
+ -f k8s/db-migrate.yaml"
22
+ run_command(cmd)
20
23
  elsif environment == "staging"
21
- `kubectl config use-context integrations-staging && kubectl \
22
- apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml`
24
+ cmd = "kubectl config use-context integrations-staging && kubectl \
25
+ apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml"
26
+ run_command(cmd)
23
27
  else
24
28
  puts "Command not found!".upcase
25
29
  end
@@ -28,13 +32,23 @@ module G5deploy
28
32
  desc "pods <environment>", "pods production or pods staging"
29
33
  def pods(environment)
30
34
  if environment == "production"
31
- `kubectl config use-context g5-prod && kubectl get pods`
35
+ cmd = "kubectl config use-context g5-prod && kubectl get pods"
36
+ run_command(cmd)
32
37
  elsif environment == "staging"
33
- `kubectl config use-context integrations-staging && kubectl get pods`
38
+ cmd = "kubectl config use-context integrations-staging && kubectl get pods"
39
+ run_command(cmd)
34
40
  else
35
41
  puts "Command not found!".upcase
36
42
  end
37
43
  end
38
44
 
45
+ private
46
+
47
+ def run_command(cmd)
48
+ IO.popen(cmd) do |io|
49
+ io.each { |s| print s }
50
+ end
51
+ end
52
+
39
53
  end
40
54
  end
@@ -1,3 +1,3 @@
1
1
  module G5deploy
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Jon Villalobos