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:
[ ] Create an orb that can house conditional logic
[ ] Identify duplicate jobs, commands, and workflows and abstract them to orb
[ ] Make sure changes do not break existing architectures, variable names should stay the same, how they are assigned can change.
[ ] Testing Checklist has been run and all tests pass
[ ] README is updated, if necessary
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.
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.
Description: The jobs
deploy-dev
,deploy-staging
, anddeploy-production
are nearly identical, as aredeploy-infrastructure-dev
,deploy-infrastructure-staging
, anddeploy-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.