Skip to content

Commit f62377f

Browse files
authored
chore: remove legacy gateway integration (#60)
1 parent 0f5972e commit f62377f

File tree

9 files changed

+1
-368
lines changed

9 files changed

+1
-368
lines changed

scw_serverless/cli.py

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
)
1010
from scw_serverless.config.generators.terraform import TerraformGenerator
1111
from scw_serverless.dependencies_manager import DependenciesManager
12-
from scw_serverless.deploy import backends, gateway
12+
from scw_serverless.deploy import backends
1313
from scw_serverless.logger import DEFAULT, get_logger
14-
from scw_serverless.utils.config import Config
1514
from scw_serverless.utils.credentials import DEFAULT_REGION, get_scw_client
1615
from scw_serverless.utils.loader import get_app_instance
1716

@@ -84,18 +83,6 @@ def cli() -> None:
8483
show_default=True,
8584
help="Select the backend used to deploy",
8685
)
87-
@click.option(
88-
"--gw-id",
89-
"-g",
90-
"gateway_id",
91-
envvar="SCW_APIGW_ID",
92-
help="API Gateway uuid to use with function endpoints",
93-
)
94-
@click.option(
95-
"--api-gw-host",
96-
envvar="SCW_API_GW_HOST",
97-
help="Host of the API to manage gateways",
98-
)
9986
def deploy(
10087
file: Path,
10188
backend: Literal["api", "serverless"],
@@ -104,8 +91,6 @@ def deploy(
10491
secret_key: Optional[str] = None,
10592
project_id: Optional[str] = None,
10693
region: Optional[str] = None,
107-
gateway_id: Optional[str] = None,
108-
api_gw_host: Optional[str] = None,
10994
) -> None:
11095
"""Deploy your functions to Scaleway.
11196
@@ -138,28 +123,6 @@ def deploy(
138123

139124
deploy_backend.deploy()
140125

141-
needs_gateway = any(function.gateway_route for function in app_instance.functions)
142-
if not needs_gateway:
143-
return
144-
config = Config(api_gw_host, gateway_id).update_from_config_file()
145-
# If gateway_id is not configured, gateway_domains needs to be set
146-
is_gateway_configured = config.gateway_id or app_instance.gateway_domains
147-
if not is_gateway_configured:
148-
raise RuntimeError(
149-
"Deploying a routed functions requires a"
150-
+ "gateway_id or a gateway_domain to be configured"
151-
)
152-
if not config.api_gw_host:
153-
raise RuntimeError("No api gateway host was configured")
154-
# Update the gateway
155-
manager = gateway.GatewayManager(
156-
app_instance,
157-
client,
158-
config.gateway_id,
159-
gateway.GatewayClient(config.api_gw_host),
160-
)
161-
manager.update_gateway_routes()
162-
163126

164127
@cli.command()
165128
@CLICK_ARG_FILE

scw_serverless/deploy/gateway/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

scw_serverless/deploy/gateway/client.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

scw_serverless/deploy/gateway/manager.py

Lines changed: 0 additions & 108 deletions
This file was deleted.

scw_serverless/deploy/gateway/models.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

scw_serverless/utils/config.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/dev/gateway.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/test_deploy/test_gateway/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)