-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add documentation for workflow
- Loading branch information
1 parent
2b414db
commit 54c907c
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## **To run this CI/CD Workflow:** | ||
- Simply, make a PR to the `main` branch or push changes to the `main` branch | ||
- Go to the `Actions` Tab to view the status of the workflow. | ||
|
||
## Details of Implementation | ||
- **CI Pipeline** | ||
- Specify that the CI Pipeline is triggered on PR or push to `main` | ||
- Checkout code via `Github Actions` | ||
- Install `docker-compose` | ||
- Log in to Docker Hub | ||
- Run `docker-compose build` to build frontend and backend images | ||
- **Note**: we have defined a redis container within the docker-compose file in case that we want to implement a test suite that requires redis to run | ||
- Tag frontend and backend images and push them to Docker Hub | ||
- List docker images | ||
- **CD Pipeline** | ||
- Specify workflow to run only after CI Pipeline has been completed | ||
- Run code on `ubuntu-latest` | ||
- Checkout code via `Github Actions` | ||
- Log in to Docker Hub | ||
- Pull Docker backend and frontend images | ||
- Deploy backend and frontend containers | ||
- Run Automated Tests on backend and frontend | ||
- We first install necessary packages (i.e. `npm install`) | ||
- Then, we run `npm test` for the respective containers each having their own test suite | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## **System Design for Building, Pushing, Deploying Docker** | ||
### **CI Pipeline** | ||
- `A2_Part1.yml` file | ||
- Responsible for building docker images for the frontend and backend and pushing them to DockerHub | ||
- `A2_Part2.yml` file | ||
- Responsible for pulling frontend and backend containers and running automated tests within their respective containers | ||
|
||
|
||
|
||
## **System Design for Automated Testing** | ||
### **Backend** | ||
- In `package.json`: | ||
- `npm test` | ||
- runs `jest --coverage --forceExit --maxWorkers=2` | ||
- In `__ tests __` : | ||
- `setProfilePic.test.js` | ||
- verify that making `POST` request at `/set-profile-pic` endpoint results in 200 response code | ||
### **Frontend** | ||
- In `package.json`: | ||
- `npm test` | ||
- runs `jest --coverage --transformIgnorePatterns \"node_modules/(?!axios)/\"` | ||
- In `__ tests __` : | ||
- `LoginPage.test.js`: | ||
- check that the Login component contains the phrase “Swipe. Match. Network.” |