raft-tech / TANF-app

Repo for development of a new TANF Data Reporting System
Other
17 stars 4 forks source link

Consolidate duplicate deploy and build jobs in CircleCi config #2000

Closed n0remac closed 2 years ago

n0remac commented 2 years ago

Description: The jobs deploy-dev, deploy-staging, and deploy-production are nearly identical, as are deploy-infrastructure-dev, deploy-infrastructure-staging, and deploy-infrastructure-production. The reason there are these three similar jobs are to pass different parameters to deploy-cloud-dot-gov and deploy-infrastructure.

These similar jobs could be abstracted into a single Orb that has one command for setting up infastructure and one to deploy. Based on the branch name, different variables will be set for those jobs.

Acceptance Criteria:

Notes: There should be minimal logic in the Orb. The main logic is setting the variables based on the branch. Ideally, this only happens once.

Supporting Documentation:

This is untested, but is a start: https://github.com/raft-tech/TANF-app/blob/cameron/orb-testing/.circleci/config.yml

Docs on inline orbs: https://circleci.com/docs/reusing-config#writing-inline-orbs

This entire page is useful, but this bit on passing steps and parameters might be useful for consolidating jobs: https://circleci.com/docs/reusing-config#steps

Open Questions: Some jobs might seem like they can be refactored, but based on how they are used this might be overly complicated. Duplicate code might be fine if it is simpler then a more complicated logic tree.

andrew-jameson commented 2 years ago

OBE as discussed with dev team 11/14.