31 lines
No EOL
933 B
Bash
Executable file
31 lines
No EOL
933 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# 環境変数
|
|
API_NAME="sales-tool-api"
|
|
API_CONFIG_NAME="sales-tool-gw-dev-conf-20251209"
|
|
GATEWAY_NAME="sales-tool-gw-dev-20251209"
|
|
OPENAPI_SPEC="openapi_dev.yaml"
|
|
PROJECT_ID="datacom-poc"
|
|
SERVICE_ACCOUNT="mrt-apigateway-sa-devtest@datacom-poc.iam.gserviceaccount.com"
|
|
LOCATION="asia-northeast1"
|
|
|
|
gcloud auth application-default set-quota-project $PROJECT_ID
|
|
gcloud config set project $PROJECT_ID
|
|
|
|
# API GatewayのAPI Configを作成
|
|
echo "Creating API Config..."
|
|
gcloud api-gateway api-configs create $API_CONFIG_NAME \
|
|
--api=$API_NAME \
|
|
--openapi-spec=$OPENAPI_SPEC \
|
|
--project=$PROJECT_ID \
|
|
--backend-auth-service-account=$SERVICE_ACCOUNT
|
|
|
|
# API GatewayのGatewayを作成
|
|
echo "Creating Gateway..."
|
|
gcloud api-gateway gateways create $GATEWAY_NAME \
|
|
--api=$API_NAME \
|
|
--api-config=$API_CONFIG_NAME \
|
|
--location=$LOCATION \
|
|
--project=$PROJECT_ID
|
|
|
|
echo "API Gateway deployment completed successfully." |