Code Challenge solution to create CI/CD approach using Github Pull and PUSH Request actions and deploy the code to AWS cloud server.
GitHub actions helps to perform the CI/CD operations based on PR creation and any push to the main branch.
After creating pull request code build and checks are performed on the PR, once the code build completes successfully PR is ready for review and then merge. Below status shows the status of latest code build performed.
Once any code is merged or pushed to the main
branch, corresponding code is deployed to the respective AWS EC2 environment. Below status shows the status of latest code deploy performed.
This application uses SQLite and Python to Fetch and Add Employee ID and Name in the SQLite database created using Flask GET and POST API method technique.
- With
GET
request, code fetches all the employee data [employee-id] or [employee-name] from the database and return. - With
POST
request, employee data like ID and Name is inserted in the database for further use.
- AWS EC2
- Github
- Python Flask
- SQLite
- Github Action
Use below commands to run GET and POST request -
Execute GET request using "curl http://127.0.0.1:5000/result" command on the system to check the employee details returned by the employee database from SQLite.
Execute mentioned POST request to insert user detail in the SQLite "test.db" using command -> curl --header "Content-Type: application/json" --request POST --data '{"Emp_Id":{employee_id},"Emp_Name":"{employee_name}"}' http://127.0.0.1:5000/results