g5deploy 0.0.2 → 0.0.3
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/lib/g5deploy/cli.rb +24 -10
- data/lib/g5deploy/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: af31f2c38d490dcdfd504ce812566381f4fd3563
|
|
4
|
+
data.tar.gz: c886eb9a37558a499634619a51a4448ab104b8f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
35
|
+
cmd = "kubectl config use-context g5-prod && kubectl get pods"
|
|
36
|
+
run_command(cmd)
|
|
32
37
|
elsif environment == "staging"
|
|
33
|
-
|
|
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
|
data/lib/g5deploy/version.rb
CHANGED