From 0fd6acb1142046f62f87d6707a84801c988884c4 Mon Sep 17 00:00:00 2001 From: code-anupam <92819400+anupams20@users.noreply.github.com> Date: Mon, 26 May 2025 16:50:47 +0530 Subject: [PATCH] Create python_property.json --- workflow-templates/python_property.json | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 workflow-templates/python_property.json diff --git a/workflow-templates/python_property.json b/workflow-templates/python_property.json new file mode 100644 index 0000000..66254c0 --- /dev/null +++ b/workflow-templates/python_property.json @@ -0,0 +1,49 @@ +{ + "name": "CI Pipeline", + "triggers": { + "on_push_to": "$default-branch", + "on_pull_request_to": "$default-branch" + }, + "environment": { + "SONAR_SCANNER_VERSION": "6.1.0.4477", + "SONAR_SCANNER_HOME": "${{ github.workspace }}/sonar-scanner", + "PYTHON_VERSION": "3.11", + "POETRY_VERSION": "1.8.0" + }, + "jobs": { + "run-tests": { + "name": "Run Python Tests", + "runs-on": "self-hosted", + "steps": [ + "Checkout code", + "Set up Python", + "Install Poetry", + "Cache Poetry dependencies", + "Install dependencies (if cache miss)", + "Run tests using Poetry", + "Download and install SonarQube Scanner", + "Run SonarQube Scanner with secrets" + ] + }, + "docker-build-push": { + "name": "Build and Push Docker Images", + "runs-on": "ubuntu-latest", + "needs": ["run-tests"], + "condition": "push only", + "steps": [ + "Checkout code", + "Set up Docker Buildx", + "Log in to Docker Hub", + "Extract Docker metadata for backend", + "Build and push Docker backend image with caching" + ] + } + }, + "secrets_used": [ + "SONAR_TOKEN", + "SONAR_HOST_URL", + "SONAR_PROJECT_KEY", + "DOCKERHUB_USERNAME", + "DOCKERHUB_TOKEN" + ] +}