navapbc / wic-participant-recertification-portal

https://navapbc.github.io/wic-participant-recertification-portal/
Apache License 2.0
0 stars 1 forks source link

[PRP-166] Update CD for new project structure #18

Closed rocketnova closed 1 year ago

rocketnova commented 1 year ago

Ticket

https://wicmtdp.atlassian.net/browse/PRP-166

Changes

What was added, updated, or removed in this PR.

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.

This PR modifies our CD to support a slightly different data model than the infra template currently supports. Namely, we want:

Although we could organize the infra dir to have multiple "app" dirs (e.g. one for the participant portal, one for the staff portal, etc), this isn't actually what we want. We want to be able to share resources across our apps.

To accomplish this, I've made some changes.

Feedback

It might be possible to DRY up the cd-on-push.yml, but I didn't want to keep pursuing this further. This can be saved for a future refactoring exercise. However, if you, the reviewer, know how to do this in Github Action syntax, please let me know!

Testing

Screenshots, GIF demos, code examples or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.

To verify the CD github action:

  1. Go to https://github.com/navapbc/wic-participant-recertification-portal/actions/workflows/cd.yml
  2. Select "Run workflow" and choose this branch (PRP-166-cd-connect-the-infrastructure). Leave the default settings. Screen Shot 2023-03-10 at 2 08 04 AM

To verify the deploy on push github action:

  1. This workflow run demonstrates that it works when a change has been made to a file in a watched directory (in this case the participant_portal dir). Note that the other apps (staff_portal and analytics) did not trigger a deploy because no files were changed in those directories. It's ok that the deploy itself failed; that's a IAM permissions problem unrelated to this CD trigger. Screen Shot 2023-03-10 at 2 10 50 AM
  2. This other workflow demonstrates that it works when a file is deleted in a watched directory.

To verify that the bugs in the participant_portal Makefile and Dockerfiles have been fixed (these are also tested in the above workflow runs, but here are the manual testing instructions):

  1. Run cd participant_portal && docker compose build. You should get no errors.
  2. Run make release-build APP_NAME=participant_portal. You should get no errors.

TODO

rocketnova commented 1 year ago

Closing this in favor of #21