navapbc / template-infra

A template to set up foundational infrastructure for your application in AWS
Apache License 2.0
9 stars 2 forks source link

Update documentation to clarify support for multiple AWS accounts and multiple applications #589

Open rocketnova opened 2 months ago

rocketnova commented 2 months ago

Ticket

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.

This PR provides a comprehensive revision for all of the setup documentation, with an emphasis on providing clear and consistent guidance on how to set up a new project with one or more applications. It addresses existing setup and update instructions that are not clear and/or have circular dependencies (e.g. should you set up network first or app first?).

The new documentation uses the same format for all set up documents:

All of the documentation has been revised for basic technical writing best practices (e.g. active voice over passive voice, short clear sentences, define new terms, etc).

Note: this PR does not attempt to address #581.

Testing

Provide evidence that the code works as expected. Explain what was done for testing and the results of the test plan. Include screenshots, GIF demos, shell commands or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.

Testing setup

Our current scripting process recommends that users curl from the main branch of this repo, so the changes in this PR follow that same pattern. That means that testing requires a manual (noted below).

  1. Checkout this branch (i.e. rocket/multi-app).
  2. In /template-only-bin/download-and-install-app.sh, replace main/template-only-bin with rocket/multi-app/template-only-bin.
  3. In /template-only-bin/update-template.sh, replace main/template-only-bin with rocket/multi-app/template-only-bin.

Test 1: Install into a project with a single app

  1. Clone the nextjs template into a new directory.

    git clone git@github.com:navapbc/template-application-nextjs.git test-one-app 
  2. Change into the new project directory

    cd test-one-app 
  3. Dog-food the revised documentation in this PR. Start with the main README.md.

    1. Run the normal install script to install the latest main of the infra template.
    2. Run git commit after installing and before configuring the infra template, so you can easily verify changes using git diff.
  4. Verify that the the full infra set up works as expected.

Screenshot showing a fully configured project (No gif I created fit under the github file size limit of 10MB) ![CleanShot 2024-05-15 at 18 32 30@2x](https://github.com/navapbc/template-infra/assets/67701/880d50d2-c22f-4e0e-a6ee-8e0786ff44bc)

Test 2: Update a project with a single app

  1. Using the test-one-app project dir from Test 1, follow the update directions.

    1. Normally, you would run the curl command, but because that runs the version of the script on main without the changes in this PR and you want to test the changes in this PR, instead run the following to update to the latest release version of the template:
    cat <PATH_TO_INFRA_TEMPLATE>/template-only-bin/update-template.sh | bash -s -- app v0.8.0 tag
  2. Read the output and run git diff to verify changes.

Example output for updating to a branch ![CleanShot 2024-05-16 at 10 05 04@2x](https://github.com/navapbc/template-infra/assets/67701/f1c11c09-719d-4e8c-9bb2-85c99770d1b2)
Example output for updating to a tag ![CleanShot 2024-05-16 at 10 07 03@2x](https://github.com/navapbc/template-infra/assets/67701/48066ea3-2606-45b4-80af-ff6b8e1866af)

Test 3: Install into a project with multiple apps

  1. Clone the nextjs template into a new directory.

    git clone git@github.com:navapbc/template-application-nextjs.git test-multiple-apps 
  2. Change into the new project directory

    cd test-multiple-apps 
  3. Install the infra template. Run the normal install script to install the latest main of the infra template:

    curl https://raw.githubusercontent.com/navapbc/template-infra/main/template-only-bin/download-and-install-template.sh | bash -s
  4. Run git commit to commit the installed infra template.

  5. Before continuing with the remaining infra template installation steps, install a second app to the project by following these instructions.

    1. Name the application folder second-app.
    2. Normally, you would run the curl command, but because that runs the version of the script on main without the changes in this PR and you want to test the changes in this PR, instead run the following to update to the latest release version of the template:
    cat <PATH_TO_INFRA_TEMPLATE>/template-only-bin/download-and-install-app.sh | bash -s -- second-app
  6. Run git commit to commit the installed second app.

  7. Dog-food the revised documentation in this PR. Start with the main README.md. Make sure to follow the "For exach application" sections!

  8. Verify that the the full infra set up works as expected

Screenshot showing a configured account + network ![CleanShot 2024-05-16 at 11 09 55@2x](https://github.com/navapbc/template-infra/assets/67701/3da3385b-b5cd-47af-a971-54468136b8f8)
Screenshot showing the first configured app CleanShot 2024-05-16 at 11 13 43@2x
Screenshot showing the second configured app ![CleanShot 2024-05-16 at 11 24 13@2x](https://github.com/navapbc/template-infra/assets/67701/2e49ee3f-0224-4836-a335-3db26839a5e2)

Test 4: Update a project with multiple apps

  1. Using the test-multiple-app project dir from Test 3, follow the update directions.

    1. Normally, you would run the curl command, but because that runs the version of the script on main without the changes in this PR and you want to test the changes in this PR, instead run the following to update to the latest release version of the template:

      cat <PATH_TO_INFRA_TEMPLATE>/template-only-bin/update-template.sh | bash -s -- app,second-app rocket/multi-app branch
  2. Read the output and run git diff to verify changes.

Example output for updating to a branch ![CleanShot 2024-05-16 at 11 30 40@2x](https://github.com/navapbc/template-infra/assets/67701/abcba5b8-72b5-41e3-8759-55ffbb56c91c)
rocketnova commented 1 month ago

@lorenyu This PR is really close to being fully done, but I would appreciate if you could give a WIP review of this draft so we can get aligned on the high level changes.

This should be a documentation-only PR. The current draft includes changes to template-only-bin and .github that I will pull into a separate PR and then I will adjust the documentation in this PR accordingly. That means that the testing instructions in this PR description do not apply.

rocketnova commented 1 month ago

Also, this PR does not yet incorporate recent PRs that have been merged, so I would also need to merge those changes in and update this documentation.

rocketnova commented 1 month ago

@lorenyu Also, if it's not clear, the entrypoint to review should be:

  1. Start with: https://github.com/navapbc/template-infra/blob/rocket/multi-app/README.md
  2. Click through the links starting with the "Setup" steps