Skip to content

Created documentation for Incubator Deployment #677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added mkdocs/docs/assets/ctj-infra-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions mkdocs/docs/developer/deployment-infra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
_<p style="text-align: center;">Project deployment and hosting</p>_



![CTJ Infrastructure Diagram](../assets/ctj-infra-diagram.png)


### Summary
CivicTechJobs is hosted on the Incubator AWS account, which is managed by the DevOps CoP. The application is deployed through Fargate, which itself deploys the CivicTechJob docker image. This repo sends updates to the Incubator through a github action `deploy-stage.yml`.

Incubator aws resources are managed using terraform files which are commited to the [Incubator Source](https://github.com/hackforla/incubator/tree/main/terraform/projects/civic-tech-jobs)

The resources used by CTJ include the following:
- A Database(shared with other projects)
- DNS Entry
- ECS Task Definition
- A Fargate Task


### Github Action
Github actions are the mechanism used to convey changes in this CivicTechJobs repo to the AWS deployment. The deploy-stage action is set to run on any updates to the main branch. On run the action will assume an AWS credential, push the newest docker image to the ECR, then force a ECS-Fargate redeployment. This process will depend on OIDC to grant AWS permissions for its execution
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats ecr?


### Regarding Environment Variables
The combination of Fargate(a managed service from AWS) and terraform means that environment variables are passed into the application differently than when the application is run locally. The environment variables are set in terraform at the following [location](https://github.com/hackforla/incubator/blob/main/terraform/projects/civic-tech-jobs/environment-stage.tf).
Note that these variables are the same as those found in this repo's [env.example](https://github.com/hackforla/CivicTechJobs/blob/develop/dev/dev.env.example)

Some values will come from the terraform modules, but in essense if you must add or edit environment variables for the application in deployment, you will need to change them in Incubator.

### DNS
The staging environment is current set to run at: https://stage.civictechjobs.org/

Domain management is done in AWS Route53, through terraform files found in Incubator

### Fargate
AWS Fargate is a managed service which allows CTJ to easily deploy it's containerized application. This is done by updating a AWS task definition and then restarting the associated Fargate service.

Both of these steps are preformed automatically by the github action in `deploy-stage.yml` when new commits are merged into the `main` branch


## Additional Resources

[Incubator Repo](https://github.com/hackforla/incubator/tree/main/terraform/projects/civic-tech-jobs)