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