{"id":21395897,"url":"https://github.com/gtroshin/pipeline-api","last_synced_at":"2025-03-16T14:40:27.842Z","repository":{"id":259271653,"uuid":"865852727","full_name":"gtroshin/pipeline-api","owner":"gtroshin","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-08T16:29:06.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T02:10:00.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gtroshin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-01T08:45:00.000Z","updated_at":"2024-11-05T20:16:32.000Z","dependencies_parsed_at":"2024-10-24T02:16:09.700Z","dependency_job_id":"96b5c08f-07b8-44de-b30c-5087f03b3878","html_url":"https://github.com/gtroshin/pipeline-api","commit_stats":null,"previous_names":["gtroshin/pipeline-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtroshin%2Fpipeline-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtroshin%2Fpipeline-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtroshin%2Fpipeline-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtroshin%2Fpipeline-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gtroshin","download_url":"https://codeload.github.com/gtroshin/pipeline-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243885853,"owners_count":20363642,"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":[],"created_at":"2024-11-22T14:23:54.459Z","updated_at":"2025-03-16T14:40:27.821Z","avatar_url":"https://github.com/gtroshin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI/CD Pipeline API\n![Python 3.8.0](https://img.shields.io/badge/Python-3.8.0-green.svg)\n![Flask 3.0.3](https://img.shields.io/badge/Flask-3.0.3-blue.svg)\n[![CI](https://github.com/gtroshin/pipeline-api/actions/workflows/ci.yml/badge.svg)](https://github.com/gtroshin/pipeline-api/actions/workflows/ci.yml)\n\nThis is a simple CI/CD pipeline app built using Flask. It allows users to create, retrieve, update, delete, and trigger pipelines. This project also includes a CLI for interacting with the API.\n\n## Prerequisites\n\n- Python 3.8+\n\n## Dependencies\n\nYou can install the dependencies using pip (it is highly recommended to use a virtual environment):\n\n```bash\npython -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\nTo deactivate the virtual environment, run:\n\n```bash\ndeactivate\n```\n\n## Environment Variables\n\nCreate a `.env` file in root directory of project and add necessary environment variables (example):\n\n```plaintext\nAPI_KEY=api_key\nAPI_URL=http://127.0.0.1:5000\n```\n\n## Running Tests\n\nTo run the unit tests, use the following command:\n\n```bash\npython -m unittest discover -s tests\n```\n\n## Running the API\n\nTo run the app locally, use the following command:\n\n```bash\npython run.py\n```\n\nThe app will run on `http://127.0.0.1:5000`.\n\n## App Example Usage\n\n### Create a New Pipeline\n\n```bash\ncurl -X POST http://127.0.0.1:5000/pipelines -H \"Content-Type: application/json\" -H \"Authorization: Bearer api_key\" -d '{\n    \"stages\": [\n        {\n            \"type\": \"run\",\n            \"command\": \"echo \\\"Running tests\\\"\"\n        },\n        {\n            \"type\": \"build\",\n            \"dockerfile\": \"Dockerfile\"\n        },\n        {\n            \"type\": \"deploy\",\n            \"manifest\": \"k8s/deployment.yaml\"\n        }\n    ]\n}'\n```\n\n### Update an Existing Pipeline\n\n```bash\ncurl -X PUT http://127.0.0.1:5000/pipelines/1 -H \"Content-Type: application/json\" -H \"Authorization: Bearer api_key\" -d '{\n    \"stages\": [\n        {\n            \"type\": \"run\",\n            \"command\": \"echo \\\"Running updated tests\\\"\"\n        },\n        {\n            \"type\": \"build\",\n            \"dockerfile\": \"UpdatedDockerfile\"\n        },\n        {\n            \"type\": \"deploy\",\n            \"manifest\": \"k8s/updated_deployment.yaml\"\n        }\n    ]\n}'\n```\n\n### Retrieve an Existing Pipeline by ID\n\n```bash\ncurl -X GET http://127.0.0.1:5000/pipelines/1 -H \"Authorization: Bearer api_key\"\n```\n\n### Trigger the Execution of a Pipeline\n\n```bash\ncurl -X POST http://127.0.0.1:5000/pipelines/1/trigger -H \"Authorization: Bearer api_key\"\n```\n\n### Delete a Pipeline\n\n```bash\ncurl -X DELETE http://127.0.0.1:5000/pipelines/1 -H \"Authorization: Bearer api_key\"\n```\n\n## Install `cicd-cli` CLI locally\n\nRun the following command while at the project root to install the CLI:\n\n```bash\npip install -e .\n```\n\nTo uninstall the CLI, run:\n\n```bash\npip uninstall cicd-cli\n```\n\n## CLI Example Usage\n\n### Show help\n\n```bash\ncicd-cli help\n```\n\n### Create a New Pipeline\n\n```bash\ncicd-cli create-pipeline '{\"stages\": [{\"type\": \"run\", \"command\": \"echo \\\"Running tests\\\"\"}, {\"type\": \"build\", \"dockerfile\": \"Dockerfile\"}, {\"type\": \"deploy\", \"manifest\": \"k8s/deployment.yaml\"}]}'\n```\n\n### Retrieve an Existing Pipeline by ID\n\n```bash\ncicd-cli get-pipeline 1\n```\n\n### Update an Existing Pipeline\n\n```bash\ncicd-cli update-pipeline 1 '{\"stages\": [{\"type\": \"run\", \"command\": \"echo \\\"Running updated tests\\\"\"}, {\"type\": \"build\", \"dockerfile\": \"UpdatedDockerfile\"}, {\"type\": \"deploy\", \"manifest\": \"k8s/updated_deployment.yaml\"}]}'\n```\n\n### Trigger the Execution of a Pipeline\n\n```bash\ncicd-cli trigger-pipeline 1\n```\n\n### Delete a Pipeline\n\n```bash\ncicd-cli delete-pipeline 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtroshin%2Fpipeline-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgtroshin%2Fpipeline-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtroshin%2Fpipeline-api/lists"}