Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.env
.env.local
.DS_Store
node_modules
18 changes: 18 additions & 0 deletions cloud-funcs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SETUP

- Create Google Cloud project
- Give project descriptive name
- Create service account with just permissions to build container images
- Create service account with just permissions to run cloud funcs
- Update `deploy.sh` vars as appropriate
- Generate GitHub fine-grained personal access token
- Increase expiration as desired
- Grant access to only one relevant repo
- Grant write permissions for issues
- Store in password vault
- Deploy cloud func
- Create `.env.local` file in this folder, make sure it is NOT TRACKED BY GIT, and add contents `GITHUB_TOKEN=TOKENVALUE`
- [Install `gcloud` CLI tool](https://cloud.google.com/sdk/docs/install)
- [Authenticate CLI](https://cloud.google.com/docs/authentication/gcloud)
- From this folder, run `./deploy.sh func-name`
- Copy function URL into `frontend/src/api` as appropriate
24 changes: 24 additions & 0 deletions cloud-funcs/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

name=$1
project=gap-som-dbmi-molevolvr-app-51
function=molevolvr-$name
build=cloudrunfunction-builder
run=cloudrunfunction-runtime
region=us-central1
instances=2

source .env.local
github=$GITHUB_TOKEN

gcloud run deploy $function \
--source ./$name \
--function entrypoint \
--base-image nodejs22 \
--region $region \
--project $project \
--build-service-account projects/$project/serviceAccounts/$build@$project.iam.gserviceaccount.com \
--service-account $run@$project.iam.gserviceaccount.com \
--max-instances $instances \
--no-invoker-iam-check \
--set-env-vars GITHUB_TOKEN=$github
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions scripts/README.md

This file was deleted.