Skip to content

chore: remove legacy gateway integration #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 1 addition & 38 deletions scw_serverless/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
)
from scw_serverless.config.generators.terraform import TerraformGenerator
from scw_serverless.dependencies_manager import DependenciesManager
from scw_serverless.deploy import backends, gateway
from scw_serverless.deploy import backends
from scw_serverless.logger import DEFAULT, get_logger
from scw_serverless.utils.config import Config
from scw_serverless.utils.credentials import DEFAULT_REGION, get_scw_client
from scw_serverless.utils.loader import get_app_instance

Expand Down Expand Up @@ -84,18 +83,6 @@ def cli() -> None:
show_default=True,
help="Select the backend used to deploy",
)
@click.option(
"--gw-id",
"-g",
"gateway_id",
envvar="SCW_APIGW_ID",
help="API Gateway uuid to use with function endpoints",
)
@click.option(
"--api-gw-host",
envvar="SCW_API_GW_HOST",
help="Host of the API to manage gateways",
)
def deploy(
file: Path,
backend: Literal["api", "serverless"],
Expand All @@ -104,8 +91,6 @@ def deploy(
secret_key: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None,
gateway_id: Optional[str] = None,
api_gw_host: Optional[str] = None,
) -> None:
"""Deploy your functions to Scaleway.

Expand Down Expand Up @@ -138,28 +123,6 @@ def deploy(

deploy_backend.deploy()

needs_gateway = any(function.gateway_route for function in app_instance.functions)
if not needs_gateway:
return
config = Config(api_gw_host, gateway_id).update_from_config_file()
# If gateway_id is not configured, gateway_domains needs to be set
is_gateway_configured = config.gateway_id or app_instance.gateway_domains
if not is_gateway_configured:
raise RuntimeError(
"Deploying a routed functions requires a"
+ "gateway_id or a gateway_domain to be configured"
)
if not config.api_gw_host:
raise RuntimeError("No api gateway host was configured")
# Update the gateway
manager = gateway.GatewayManager(
app_instance,
client,
config.gateway_id,
gateway.GatewayClient(config.api_gw_host),
)
manager.update_gateway_routes()


@cli.command()
@CLICK_ARG_FILE
Expand Down
2 changes: 0 additions & 2 deletions scw_serverless/deploy/gateway/__init__.py

This file was deleted.

44 changes: 0 additions & 44 deletions scw_serverless/deploy/gateway/client.py

This file was deleted.

108 changes: 0 additions & 108 deletions scw_serverless/deploy/gateway/manager.py

This file was deleted.

39 changes: 0 additions & 39 deletions scw_serverless/deploy/gateway/models.py

This file was deleted.

30 changes: 0 additions & 30 deletions scw_serverless/utils/config.py

This file was deleted.

14 changes: 0 additions & 14 deletions tests/dev/gateway.py

This file was deleted.

Empty file.
Loading