Skip to content

Commit

Permalink
added support for cloudfunction gen2 (#181)
Browse files Browse the repository at this point in the history
* added support for cloudfunction gen2

* added cloud run for gcloud function deployments and a bit refactoring

* fixed typo
  • Loading branch information
Grashalmbeisser authored Nov 8, 2024
1 parent 46a930b commit ba5d3ec
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/viur_cli/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def deploy(action, profile, name, ext, yes, skip_checks: bool, additional_args):
return
else:
echo_info("\U00002714 No vulnerabilities found.")

version = replace_vars(
conf["version"],
{k: v for k, v in conf.items() if k not in ["version"]}
Expand Down Expand Up @@ -720,7 +720,7 @@ def build_deploy_command(name, conf):
f"You can create a cloudfunction entry by calling 'viur cloud create function'")

command = (
f"gcloud functions deploy "
f"gcloud run deploy "
f"{name} "
f"--region='{conf['region']}'"
f"--max-instances={conf['max-instances']}"
Expand Down Expand Up @@ -799,12 +799,13 @@ def create(profile, action, gen, source, name, entrypoint, env_vars_file, memory
function_dict["trigger"] = function_dict.get("trigger",
trigger if trigger else click.prompt(
"Please enter your cloud function trigger type",
default="http")
default="https")

)

function_dict["source"] = function_dict.get("source",
source if source else click.prompt(
"Enter the directory of your cloud functio"
"Enter the directory of your cloud function"
"(deploy/cloudfunction/{FileName})")
)

Expand All @@ -813,4 +814,5 @@ def create(profile, action, gen, source, name, entrypoint, env_vars_file, memory
config[profile] = conf
config.migrate()
echo_positive("Your cloud function creation was successful, if you want to add more flags, "
"add them in your project.json under")
"add them in your project.json")

0 comments on commit ba5d3ec

Please sign in to comment.