hackforla / hackforla/CivicTechJobs

Epic (Devops): Deploy develop Branch to Staging Environment in AWS

Open
#585 9 comments 0 reactions 1 assignee Assigned to @RSkuma View on GitHub
complexity: large feature: Architecture P2: Med-high PBV: dev role: devops size: 13pt+
Dominant language
TypeScript
Stars
24
Forks
27
Avg merge
2m
Merged PRs (30d)
1

Description

### Overview
Epic summary: **As a development team, we want to deploy the `develop` branch to a staging environment in AWS to test the latest changes in an environment that closely mirrors production.**

Acceptance Criteria:
- Ensure a fully automated deployment pipeline is configured for a staging environment in AWS.
- The pipeline should handle source control, continuous integration, environment provisioning, deployment, and monitoring.
- The pipeline is documented so that any new team members can easily read docs and look at a chart to understand the flow.
- A staging environment is deployed to AWS via Hack for LA's incubator account, following their required processes and procedures

##### Details
The `develop` branch will be used to test new code changes before merging to the `main` branch, which should deploy to a production environment.

For now, this epic will focus on the staging deployment only. The next step after this for devops is to deploy the `main` branch to production, then set it up so that whenever changes are made to the `main` branch, it is automatically deployed through terraform/github actions/AWS.

This epic is an overview of what generally needs to be done to achieve our goal. A devops engineer that works on this will need to break it down into more specific stories and action items, define their own tasks as well as track their own progress. It will require an ability to work independently and make sound decisons on behalf of the team.

### Action Items

##### User Story 1: Create Staging Environment Infrastructure in AWS
- As a DevOps engineer, I want to define and provision a staging environment in AWS using infrastructure-as-code (IAC) so that deployments are consistent and replicable.

Acceptance Criteria:
- Use Terraform (and/or other IAC tools if necessary) to define staging infrastructure.
- Provision an isolated VPC, EC2 instances, or Lambda functions, depending on the application's architecture.
- Ensure environment mirrors the production environment as closely as possible.

Tasks

- [x] Write Terraform/CloudFormation templates to define AWS resources (e.g., VPC, ECS, RDS, S3, etc.).
- [x] Ensure security groups, IAM roles, and permissions are correctly set.
- [ ] Verify successful provisioning and connectivity between components.

##### User Story 2: Configure Deployment Pipeline to Staging
As a DevOps engineer, I want to automate the deployment process to AWS when the `develop` branch is merged into or updated, so that the application is consistently deployed to the staging environment.

Acceptance Criteria:
- Configure deployment triggers via GitHub Actions.
- Deploy the application to AWS ECS, EKS, or EC2 as per the infrastructure setup.
- Ensure rollback functionality is available in case of deployment failure.

Tasks:

- [x] Set up the CI/CD pipeline to deploy artifacts from the build phase to the AWS staging environment.
- [x] Define environment variables and secrets using AWS Systems Manager or Secrets Manager.
- [ ] Implement rollback strategy (e.g., using AWS CodeDeploy or Terraform).

##### User Story 3: Document devops Process
As a developer, I should be able to read documentation about the devops and deployments process so that I can have an understanding of how it works.

Acceptance Criteria:
- Our project's mkdocs should have a page about how AWS/incubator deployments are set up
- Mkdocs should have a page about our github actions related to the deployment pipelines
- There should be a diagram to easily visualize how the different AWS services are structured together

Tasks:

- [x] Write documentation about the AWS deployments
- [x] Write documentation about the github actions used for deployment
- [ ] Create an AWS service diagram

### Resources/Instructions

- [Resources - CivicTechJobs Docs](https://hackforla.github.io/CivicTechJobs/resources/)
- https://hackforla.github.io/CivicTechJobs/developer/devops/
- https://github.com/hackforla/incubator
- https://developer.hashicorp.com/terraform
- https://docs.github.com/en/actions

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.