8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/g5deploy/cli.rb', line 8
def deploy(environment)
if environment == "production" && options[:with_migration]
cmd = "kubectl config use-context g5-prod && kubectl \
apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml \
-f k8s/db-migrate.yaml"
run_command(cmd)
elsif environment == "production"
cmd = "kubectl config use-context g5-prod && kubectl \
apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml"
run_command(cmd)
elsif environment == "staging" && options[:with_migration]
cmd = "kubectl config use-context integrations-staging && kubectl \
apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml \
-f k8s/db-migrate.yaml"
run_command(cmd)
elsif environment == "staging"
cmd = "kubectl config use-context integrations-staging && kubectl \
apply -f k8s/sidekiq-workers.yaml -f k8s/rails-servers.yaml"
run_command(cmd)
else
puts "Command not found!".upcase
end
end
|