Add support for controlling amount of nodes

Nodes spun up in Gcloud defaults to '3' nodes
This number can be a lot considering the QA
autodevops spec does not need this many nodes
This commit is contained in:
Dan Davison 2019-07-31 02:08:36 +00:00 committed by Thong Kuah
parent ed85fcfa6c
commit 8a00c6b877
2 changed files with 5 additions and 0 deletions

View File

@ -181,6 +181,10 @@ module QA
ENV.fetch('GCLOUD_REGION')
end
def gcloud_num_nodes
ENV.fetch('GCLOUD_NUM_NODES', 3)
end
def has_gcloud_credentials?
%w[GCLOUD_ACCOUNT_KEY GCLOUD_ACCOUNT_EMAIL].none? { |var| ENV[var].to_s.empty? }
end

View File

@ -30,6 +30,7 @@ module QA
--enable-basic-auth
--region #{Runtime::Env.gcloud_region}
--disk-size 10GB
--num-nodes #{Runtime::Env.gcloud_num_nodes}
&& gcloud container clusters
get-credentials
--region #{Runtime::Env.gcloud_region}