in lib/google/serverless/exec/tasks.rb [181:203]
def setup_exec_task
::Rake.application.last_description =
"Execute the given command in a Google serverless application."
::Rake::Task.define_task "serverless:exec", [:cmd] do |_t, args|
command = extract_command args[:cmd], ::ARGV
verify_gcloud_and_report_errors
selected_product = extract_product ::ENV[PRODUCT_ENV]
app_exec = Exec.new command,
project: ::ENV[PROJECT_ENV],
service: ::ENV[SERVICE_ENV],
config_path: ::ENV[CONFIG_ENV],
version: ::ENV[VERSION_ENV],
timeout: ::ENV[TIMEOUT_ENV],
wrapper_image: ::ENV[WRAPPER_IMAGE_ENV],
strategy: ::ENV[STRATEGY_ENV],
gcs_log_dir: ::ENV[LOGS_DIR_ENV],
region: ::ENV[REGION_ENV],
product: selected_product
start_and_report_errors app_exec
exit
end
end