Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Fixed #312, simplify firebase deploy #335

Merged
merged 1 commit into from
Apr 22, 2022
Merged

Conversation

rhelmer
Copy link
Contributor

@rhelmer rhelmer commented Apr 22, 2022

There's really no need to push to a git branch, we can just store an archive of the deployable version of the site:

  • the firebase config
  • the compiled functions
  • the compiled website

This works similar to before but without involving git:

  1. check out and build the site in production mode
  2. persist the workspace (next step modifies things)
  3. test the site (reconfigures to dev mode for this)
  4. restore the workspace from step (2)
  5. zip up and archive the workspace
  6. if this is master branch, run firebase deploy

@rhelmer rhelmer self-assigned this Apr 22, 2022
@rhelmer
Copy link
Contributor Author

rhelmer commented Apr 22, 2022

This is going to be a little tricky to test before landing, I'll need to use some temporary commits to make it deploy from a this test branch, then I will rebase those away.

@rhelmer rhelmer requested review from thomik-corp and aaga April 22, 2022 03:09
@rhelmer rhelmer force-pushed the simplify-firebase-deploy branch from a8ce42b to 0739192 Compare April 22, 2022 03:10
@rhelmer
Copy link
Contributor Author

rhelmer commented Apr 22, 2022

I'd like to continue looking at alternatives such as GitHub actions, but this feels like a relatively small change that should make our deployments more solid.

Note that I tried setting the filter to use this branch instead of master and it gets all the way to the final deploy step but it looks like the service account is missing a permission, I alerted SRE:

#!/bin/bash -eo pipefail
GOOGLE_APPLICATION_CREDENTIALS="$HOME"/gcloud.json ./node_modules/.bin/firebase deploy --project $PROJECT_ID_STAGE


=== Deploying to '*****************************'...

i  deploying firestore, functions, hosting
i  cloud.firestore: checking firestore.rules for compilation errors...
✔  cloud.firestore: rules file firestore.rules compiled successfully
⚠  functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  functions: ensuring required API artifactregistry.googleapis.com is enabled...
⚠  functions: missing required API artifactregistry.googleapis.com. Enabling now...
✔  functions: required API cloudbuild.googleapis.com is enabled
✔  functions: required API cloudfunctions.googleapis.com is enabled

Error: HTTP Error: 403, Permission denied to enable service [artifactregistry.googleapis.com]
Help Token: Ae-hA1NaDBLakHsaC26-GLFrCnnfiMQmwM5jrzqQ7WZhLiSk-Y92lrK2fdFuzPxA5r4iVDyGKYcVV9jNlcyVFwxWeyR4mV0IvQvVHvIjWbxQr-5S

Exited with code exit status 1

CircleCI received exit code 1

@rhelmer rhelmer requested a review from stansky April 22, 2022 16:15
@rhelmer rhelmer merged commit 7fcf218 into master Apr 22, 2022
@rhelmer rhelmer deleted the simplify-firebase-deploy branch April 22, 2022 18:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants