akauppi / GroundLevel-firebase-es

[ANCHORED] Stencil for operational web apps
https://groundlevel-sep22.web.app/
Other
23 stars 3 forks source link

Versioning the backend - for front end deployment script (can back off if not compatible); to be shown in the app's About #71

Open akauppi opened 3 years ago

akauppi commented 3 years ago

CI deployments are now working:

It deploys both backend and front-end, each time anything changes, leading to a CI run of 7 min 14 s.

Surely, we can do better?


Ideas

When doing a CI run, calculate a checksum for the parts affecting app, and backend deployments.

Store these checksums in Cloud Storage (as suggested here).

Compare the checksums and skip (test, build and deployment) of either part, if there are no changes.

Even this provides challenges. There is no "skip" or "goto" functionality in Cloud Build scripts, so we should:

(subtitle)

The reason we don't simply have two separate deployment scripts is that if both backend and front-end stuff changes, we want the back-end script to run first.

akauppi commented 3 years ago

Follow https://stackoverflow.com/questions/68496730/cloud-build-how-to-execute-two-ci-jobs-in-order

Likely do it as the side thought mentions there:

Come to think of it, I can bypass this by giving development guidance: if there are breaking changes (eg. a data model changes in the backend, or a new service such as Cloud Storage is added), those changes need to be deployed first in the backend. Making eg. two commits or deploying the backend manually.

akauppi commented 3 years ago

Splitting the merged CI script into two: backend and app, like master-pr already is. This is good.

What remains is ordering the two. For this, I intend to:

This allows parallel deployment of app and backend (in the same commit), if there are no incompatibility changes between the two.

If the currently deployed backend is not up to the front-end, the deployment of the front-end will simply fail (and need to be run manually). This is acceptable.