Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Latest commit

 

History

History

function

primap-function

Cloud Functions for primap

Overview

flowchart TD
  scheduler["Cloud Scheduler"] -- Runs once a day --> cron["CronUpdateShops"]

  cron --> queue1["QueueSaveShop"]
  cron --> queue2["QueueSaveShop"]
  cron --> queue3["QueueSaveShop"]

  queue1 --> firestore[(Cloud Firestore)]
  queue2 --> firestore
  queue3 --> firestore
Loading

There are the following functions.

Requirement API keys

Register followings from https://console.cloud.google.com/apis/credentials

  • GOOGLE_MAPS_API_KEY
    • Application restrictions: None
    • API restrictions: Geocoding API

Variables

Register following keys to Secret Manager

  • GOOGLE_MAPS_API_KEY (required)

Development

Setup

cp .env.examle .env
vi .env

Testing

Run one of the following

  1. firebase --project test emulators:exec --only firestore,pubsub "make test"
  2. docker-compose up --build