テスト環境デプロイ
This commit is contained in:
parent
bb072cc91c
commit
1259ba76c9
6 changed files with 267 additions and 30 deletions
24
functions/generate_minutes/.gcloudignore
Normal file
24
functions/generate_minutes/.gcloudignore
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# This file specifies files that are *not* uploaded to Google Cloud
|
||||
# using gcloud. It follows the same syntax as .gitignore, with the addition of
|
||||
# "#!include" directives (which insert the entries of the given .gitignore-style
|
||||
# file at that point).
|
||||
#
|
||||
# For more information, run:
|
||||
# $ gcloud topic gcloudignore
|
||||
#
|
||||
.gcloudignore
|
||||
# If you would like to upload your .git directory, .gitignore file or files
|
||||
# from your .gitignore file, remove the corresponding line
|
||||
# below:
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
node_modules
|
||||
|
||||
.env_dev
|
||||
.env_prod
|
||||
|
||||
deploy_function_dev.sh
|
||||
|
||||
package-lock.json
|
||||
|
||||
32
functions/generate_minutes/deploy_function_dev.sh
Normal file
32
functions/generate_minutes/deploy_function_dev.sh
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
# プロジェクトIDを設定
|
||||
PROJECT_ID="datacom-poc"
|
||||
|
||||
# デプロイする関数名
|
||||
FUNCTION_NAME="generate_minutes"
|
||||
|
||||
# 関数のエントリポイント
|
||||
ENTRY_POINT="helloHttp"
|
||||
|
||||
# ランタイム
|
||||
RUNTIME="nodejs22"
|
||||
|
||||
# リージョン
|
||||
REGION="asia-northeast1"
|
||||
|
||||
# 環境変数ファイル
|
||||
ENV_VARS_FILE=".env_dev"
|
||||
|
||||
gcloud auth application-default set-quota-project $PROJECT_ID
|
||||
gcloud config set project $PROJECT_ID
|
||||
|
||||
gcloud functions deploy $FUNCTION_NAME \
|
||||
--gen2 \
|
||||
--region $REGION \
|
||||
--runtime $RUNTIME \
|
||||
--source=. \
|
||||
--entry-point $ENTRY_POINT \
|
||||
--env-vars-file $ENV_VARS_FILE \
|
||||
--trigger-http \
|
||||
--timeout 600s \
|
||||
|
|
@ -6,6 +6,7 @@ import { hubspotController } from "./logics/hubspot";
|
|||
import { createCustomError, responseError } from "./logics/error";
|
||||
import { CLOUD_STORAGE_LOG_FOLDER_NAME, CLOUD_STORAGE_MASTER_FOLDER_NAME, COMPANIES_FILE_NAME, OWNERS_FILE_NAME } from "../serverConfig";
|
||||
import { Delay } from "cerceis-lib";
|
||||
import { googleDriveController } from "./logics/googleDrive";
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
|
|
@ -13,6 +14,10 @@ const router = express.Router();
|
|||
router.post("/miitel", async (req, res) => {
|
||||
try {
|
||||
const body = req.body;
|
||||
|
||||
if('challenge' in body) return res.status(200).contentType('text/plain').send(body.challenge);
|
||||
|
||||
|
||||
const parsedBody = MiiTelWebhookSchema.safeParse(body);
|
||||
if (!parsedBody.success) throw createCustomError("ZOD_FAILED");
|
||||
|
||||
|
|
@ -23,9 +28,10 @@ router.post("/miitel", async (req, res) => {
|
|||
await processRequest(videoInfo);
|
||||
// if(!result) throw
|
||||
|
||||
res.status(200).send("ok");
|
||||
return res.status(200).send("ok");
|
||||
} catch(err) {
|
||||
responseError(err, res)
|
||||
responseError(err, res);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -118,22 +124,22 @@ router.post("/logUpload", async (req, res) => {
|
|||
// res.send('ok');
|
||||
// });
|
||||
|
||||
// router.post("/test", async (req, res) => {
|
||||
// try {
|
||||
router.post("/test", async (req, res) => {
|
||||
try {
|
||||
|
||||
// const googleAuth = await googleDriveController.getAuth();
|
||||
// const driveClilent = googleDriveController.getDriveClient(googleAuth);
|
||||
// const sheetsClient = googleDriveController.getSheetsClient(googleAuth);
|
||||
// const folderId = await googleDriveController.searchFileIdByFileName(driveClilent, MINUTES_CREATION_HISTORY_FOLDER_ID, '2025');
|
||||
// if(!folderId) throw new Error()
|
||||
// // console.log(fileId);
|
||||
// // const sheetId = await googleDriveController.getLogSheetId(driveClilent, sheetsClient, folderId, 'test1');
|
||||
// // console.log('sheet id : ', sheetId);
|
||||
// res.send("ok");
|
||||
// } catch (error) {
|
||||
// console.error("Error in /test endpoint:", error);
|
||||
// res.status(500).send("Error in /test endpoint");
|
||||
// }
|
||||
// });
|
||||
// const googleAuth = await googleDriveController.getAuth();
|
||||
// const driveClilent = googleDriveController.getDriveClient(googleAuth);
|
||||
// const sheetsClient = googleDriveController.getSheetsClient(googleAuth);
|
||||
// const folderId = await googleDriveController.searchFileIdByFileName(driveClilent, MINUTES_CREATION_HISTORY_FOLDER_ID, '2025');
|
||||
// if(!folderId) throw new Error()
|
||||
// console.log(fileId);
|
||||
// const sheetId = await googleDriveController.getLogSheetId(driveClilent, sheetsClient, folderId, 'test1');
|
||||
// console.log('sheet id : ', sheetId);
|
||||
res.send("ok");
|
||||
} catch (error) {
|
||||
console.error("Error in /test endpoint:", error);
|
||||
res.status(500).send("Error in /test endpoint");
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
Loading…
Add table
Add a link
Reference in a new issue