Contact DataCommons team to get permission for access of secret manager.
Contact DataCommons team to get permission for GCP application credential. Then run the following command once
gcloud config set project datcom-browser-staging && \
gcloud auth application-default login
This will generate a json file in your local machine, record the path and set the environment variable in your ~/.bash_profile or ~/.bashrc file
export GOOGLE_APPLICATION_CREDENTIALS=<JSON_CREDENTIAL_PATH>
./run_test.sh
./run_npm.sh
This will watch static files change and re-build on code edit.
Start the flask webserver locally at localhost:8080
./run_server.sh
Another way to start the server locally is to use Docker.
Make sure you have installed Docker Desktop.
Build Docker image
docker build -t datacommonsorg-website .
Run it locally
docker run \
-p 8080:8080 \
-e GOOGLE_APPLICATION_CREDENTIALS=<JSON_CREDENTIAL_PATH> \
-v $GOOGLE_APPLICATION_CREDENTIALS:<JSON_CREDENTIAL_PATH>:ro \
datacommonsorg-website
-
Build compiled asset bundle:
cd static npm run-script build cd ..
-
Deploy to Staging:
cd server && \ gcloud app deploy app_staging.yaml -q --project=datcom-browser-staging
-
Deploy to Prod:
cd server && \ gcloud app deploy app_prod.yaml -q --no-promote --project=datcom-browser-prod
This file is stored in GCS bucket: datcom-browser-prod.appspot.com (for prod) and datcom-browser-prod.appspot.com (for local and staging). For updating this file, please contact DataCommons team.