{"id":25286132,"url":"https://github.com/snappy-hq/snappy-notes","last_synced_at":"2025-10-27T20:30:40.544Z","repository":{"id":255693776,"uuid":"852929083","full_name":"snappy-hq/snappy-notes","owner":"snappy-hq","description":"A simple Next.js app to teach a lot of Good Practices","archived":false,"fork":false,"pushed_at":"2025-02-09T13:36:15.000Z","size":3545,"stargazers_count":3,"open_issues_count":7,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-09T14:31:52.074Z","etag":null,"topics":["devops","docker","husky","jest","markdown-editor","mdx","nextjs","tailwindcss","terraform","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snappy-hq.png","metadata":{"files":{"readme":"README-dev.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-05T17:12:35.000Z","updated_at":"2025-02-09T13:36:18.000Z","dependencies_parsed_at":"2024-09-14T19:40:37.805Z","dependency_job_id":"3dea85e2-2186-4ace-a141-3be85ad7e7e5","html_url":"https://github.com/snappy-hq/snappy-notes","commit_stats":null,"previous_names":["snappy-notes/snappy-notes"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snappy-hq%2Fsnappy-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snappy-hq%2Fsnappy-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snappy-hq%2Fsnappy-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snappy-hq%2Fsnappy-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snappy-hq","download_url":"https://codeload.github.com/snappy-hq/snappy-notes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238551304,"owners_count":19491064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","docker","husky","jest","markdown-editor","mdx","nextjs","tailwindcss","terraform","testing"],"created_at":"2025-02-12T21:25:14.967Z","updated_at":"2025-10-27T20:30:35.032Z","avatar_url":"https://github.com/snappy-hq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI/CD Pipeline Design\n\n## Problem Statement\nDesign an advanced CI/CD pipeline for the project with the following steps:\n\n1. **Triggering the Pipeline**\n   - The pipeline is triggered whenever code is pushed or a pull request is merged directly into the master branch.\n\n2. **Pipeline Steps**\n   - The pipeline consists of multiple steps and environments (development, staging, and production):\n\n### Steps\n\n1. **Pull the Code**\n   - Fetch the latest code from the repository.\n\n2. **Install Dependencies**\n   - Install all necessary dependencies for the project.\n\n3. **Lint the Code Base**\n   - Run linting tools to ensure code quality.\n\n4. **Test the Code Base**\n   - Execute tests, including SonarQube analysis for code quality and security.\n\n5. **Build Docker Image**\n   - If previous steps pass, build the project as a Docker image.\n   - Scan the Docker image with `trivy`.\n   - Push the Docker image to a private registry.\n   - Serve test coverage files located at `./coverage/*.html` as a static site using Nginx on the development machine.\n   - Host the development environment using Terraform.\n\n6. **Output IP for Coverage Files**\n   - Provide the IP address to access the coverage files served on the instance.\n   - Temporarily run the built project on the development machine, reverse proxying with Nginx (port 80 -\u003e 3000).\n\n7. **Approval for Staging Deployment**\n   - Prompt for approval to ship the built image to the staging environment.\n   - If approved, proceed to the next steps; otherwise, fail the CI build.\n\n8. **Deploy to Staging Environment**\n   - Spin up a new instance for the staging environment and delete the old development instance using Terraform.\n   - Pull the Docker image and run it.\n   - Output the link to access the running container and verify the site.\n\n9. **Approval for Production Deployment**\n   - Prompt for approval to proceed to the production environment.\n   - If approved, proceed to the next steps.\n\n10. **Deploy to Production Environment**\n    - Destroy the staging environment and spin up a new production environment using Terraform.\n    - Pull the Docker images and run three instances on different ports.\n    - Set up Jenkins for load balancing and rate limiting between the instances.\n    - Output the publicly accessible IP for the production environment.\n\n## Summary\nThis CI/CD pipeline ensures a robust and automated process for deploying code across development, staging, and production environments, with necessary checks and approvals at each stage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnappy-hq%2Fsnappy-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnappy-hq%2Fsnappy-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnappy-hq%2Fsnappy-notes/lists"}