in spec/e2e.rb [43:84]
def deploy test_dir, build_id = nil
build_id ||= rand 1000..9999
test_name = versionize test_dir
version = "#{test_name}-#{build_id}"
key_path = File.expand_path ENV["GOOGLE_APPLICATION_CREDENTIALS"], __FILE__
key_file = File.read key_path
key_json = JSON.parse key_file
account_name = key_json["client_email"]
project_id = ENV["E2E_GOOGLE_CLOUD_PROJECT"]
exec "gcloud config set project #{project_id}"
exec "gcloud config set account #{account_name}"
app_yaml_path = File.expand_path "../../#{test_dir}/app.yaml", __FILE__
(0..3).each do |_attempt|
exec "gcloud app deploy #{app_yaml_path} --version=#{version} -q --no-promote"
break if $CHILD_STATUS.to_i.zero?
end
if $CHILD_STATUS.to_i != 0
output "Failed to deploy to gcloud"
return $CHILD_STATUS.to_i
end
sleep 10
@url = "https://#{version}-dot-#{project_id}.appspot.com"
0
end