diff --git a/cdp_backend/infrastructure/Justfile b/cdp_backend/infrastructure/Justfile index d85bf2ca..73c1c1fd 100644 --- a/cdp_backend/infrastructure/Justfile +++ b/cdp_backend/infrastructure/Justfile @@ -109,9 +109,9 @@ deploy-clipping key=default_key region=default_region: --allow-unauthenticated # run both setup and deploy -setup-and-deploy project region=default_region: +setup-and-deploy project region=default_region cookiecutter_yaml=default_cookiecutter_yaml: just setup {{region}} - just deploy {{project}} + just deploy {{project}} cookiecutter_yaml={{cookiecutter_yaml}} # fully teardown project destroy project: @@ -126,4 +126,4 @@ clean key=default_key: # remove all database documents (including search index) and filestore objects clean-full key=default_key: clean_cdp_database {{key}} --clean-index - clean_cdp_filestore {{key}} \ No newline at end of file + clean_cdp_filestore {{key}} diff --git a/cdp_backend/infrastructure/dev-cookiecutter-metadata.yaml b/cdp_backend/infrastructure/dev-cookiecutter-metadata.yaml new file mode 100644 index 00000000..36e2591a --- /dev/null +++ b/cdp_backend/infrastructure/dev-cookiecutter-metadata.yaml @@ -0,0 +1,13 @@ +default_context: + municipality: "CDP Dev Muni" + iana_timezone: "America/Los_Angeles" + governing_body_type: "other" + municipality_slug: "cdp-dev-muni" + python_municipality_slug: "cdp_dev_muni" + infrastructure_slug: "cdp_dev_muni_000001" + maintainer_or_org_full_name: "evamaxfield" + hosting_github_username_or_org: "CouncilDataProject" + hosting_github_repo_name: "cdp-dev-muni" + hosting_github_url: "https://github.com/CouncilDataProject/cdp-dev-muni" + hosting_web_app_address: "https://councildataproject.github.io/cdp-dev-muni" + firestore_region: "us-central" diff --git a/dev-infrastructure/README.md b/dev-infrastructure/README.md index 5b265977..8c865cf1 100644 --- a/dev-infrastructure/README.md +++ b/dev-infrastructure/README.md @@ -25,10 +25,10 @@ found in our ## Dependencies -Deploying the CDP infrastructure requires having `cdp-backend` installed. +Deploying the CDP infrastructure requires having `cdp-backend` installed along with the contributor tools. For more detailed information please see the -[project installation details](https://github.com/CouncilDataProject/cdp-backend#installation). +[project installation details](https://github.com/CouncilDataProject/cdp-backend#installation) and [contributing details](https://github.com/CouncilDataProject/cdp-backend/blob/main/CONTRIBUTING.md). ## Account Setup @@ -45,14 +45,17 @@ sure the [`gcloud` SDK](https://cloud.google.com/sdk/install) is installed. _If this was the first time installing either of those packages, it is recommended to restart your terminal after installation._ -After `gcloud` has both been installed and terminal restarted, run the -following commands to log in to gcloud: `just login` - ## Create a New Project and Deploy the Infrastructure ```bash -get_cdp_infrastructure_stack {OPTIONAL: dir path to store to} +get_cdp_infrastructure_stack {dir path to store to} +just login just init {project-name} +``` + +Attach your billing account to the GCP project you just created in the [GCP console](https://console.cloud.google.com/). + +``` just setup-and-deploy {project-name} {OPTIONAL: region} ``` @@ -72,12 +75,22 @@ just setup-and-deploy cdp-eva-dev-001 just deploy {project-name} ``` +Or optionally passing cookiecutter yaml +```bash +just deploy {project-name} cookiecutter-yaml={path to yaml file} +``` + Example: ```bash just deploy cdp-eva-dev-001 ``` +Or optionally passing cookiecutter yaml +```bash +just deploy cdp-eva-dev-001 cookiecutter-yaml='some/fakepath.yaml' +``` + Enable video / audio clipping: ```bash @@ -109,4 +122,14 @@ with each collection model. Useful links for managing Cloud Functions: * [Pre-installed System Packages](https://cloud.google.com/functions/docs/reference/system-packages) -* [Execution Environments](https://cloud.google.com/functions/docs/concepts/execution-environment) \ No newline at end of file +* [Execution Environments](https://cloud.google.com/functions/docs/concepts/execution-environment) + +## Troubleshooting + +If you receive a `firebase: not found` error at any point in the deployment process, make sure that you have the Firebase CLI installed. + +`Invalid project selection, please verify project cdp-isaac-dev-2023 exists and you have access.` +- Run `firebase projects:list` and check whether your project is listed +- Run `firebase projects:addfirebase {{project-name}}` + +If you are running into issues with various packages or tools not being installed, it is highly recommended to start a fresh virtual env.