PESolut / leaf-me

new and final mono repo for the leaf me system: Leaf-Me is a full-stack Uber Eats-style delivery platform designed for dispensaries. The app streamlines the process of placing, preparing, and delivering orders through multiple role-based interfaces
0 stars 0 forks source link

setup pipeline for backend #3

Open PESolut opened 3 days ago

PESolut commented 3 days ago

setup CI/CD pipeline for Leaf-Me Backend

Image

Implement a robust CI/CD pipeline using GitHub Actions to automate the build, test, and deployment processes for the Leaf-Me backend application. This pipeline will streamline our development workflow, ensure code quality, and facilitate efficient deployments.

Workflow Overview

1. Source Control Management (SCM)

2. Continuous Integration (CI)

3. Continuous Deployment (CD)

Technologies to be Used

Acceptance Criteria

Benefits

Additional Notes


PESolut commented 2 days ago

completed tasks:

1) create a backend workflow

2) Configure the workflow to trigger on pushes to dev

3) Set up a job to install dependencies and run tests.

blocker

time to test to see if changes run the workflow....

edit:

it seems that we forgot to change our biild from react build to just a node build and we dont have any test script so lets just create a basic test suite and correct our build for our env.

PESolut commented 2 days ago

blocker: Update Backend CI/CD Pipeline to fix our basic pipeline

  1. Update build step

    • [x] Replace React build with Node.js build
    • [x] Update the npm run build command to match backend build process
  2. Add basic test suite

    • [x] Create a new test file (e.g., backend.test.js)
    • [ ] Write simple test cases for core backend functionality
    • [x] Update package.json to include a test script
  3. Update CI/CD workflow

    • [x] Modify .github/workflows/backend-ci-cd.yml
    • [x] Update the build step to use the correct build command
    • [x] Ensure the test step is correctly configured
  4. Test and verify

    • [x] Push changes to dev branch
    • [x] Monitor CI/CD pipeline execution
    • [x] Verify successful build and test runs
  5. Documentation

    • [ ] Update README or relevant documentation with new build and test instructions

PESolut commented 2 days ago

task one completed ,testing:

needed to remove the test script within our package.json...

new blocker: push to main;

output from github actions fail:

Switched to a new branch 'main'
branch 'main' set up to track 'origin/main'.
Updating b33a916..55ac857
Fast-forward
 backend/app.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
remote: Permission to PESolut/leaf-me.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/PESolut/leaf-me/': The requested URL returned error: 403

solution:

changed workflow permissions. https://github.com/PESolut/leaf-me/settings/actions

testing...

PESolut commented 2 days ago

task 3: Implement a deployment job that runs only on pushes to main

This will require three prerequisite task done before I can start to implement it

BLOCKERS AND ACTION ITEMS

1) install docker onto the backends ec2 instance 2) create a dockerhub repo for leafme's backend 3) in the Leafme repo share all the secrets ( reference portfolio project page for the needed secrets ) including but not limited to: GitHub PAT, backend address, leaf-me-masterkey.pem, and three other values ( that I can't remember or reference atm ) 4) all above task items that has not been completed should be completed before we finalize the pipeline and start development on the frontend