Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding poolboy to sonarqube for static analysis of code #119

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
stages:
- static-analysis

.static-analysis:
stage: static-analysis
interruptible: true
needs: []

sonarqube-check:
extends: .static-analysis
image: images.paas.redhat.com/alm/sonar-scanner-alpine:latest
variables:
LANG: "en_US.UTF-8"
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
SONAR_HOST_URL: https://sonarqube.corp.redhat.com
SONAR_SCM_PROVIDER: git
SONAR_SCANNER_OPTS: "-Xmx512m"
SONAR_USER_HOME: /tmp/.sonar
KUBERNETES_MEMORY_REQUEST: "512Mi"
KUBERNETES_MEMORY_LIMIT: "4Gi"
KUBERNETES_EPHEMERAL_STORAGE_REQUEST: "512Mi"
KUBERNETES_EPHEMERAL_STORAGE_LIMIT: "1Gi"
cache:
key: "${CI_JOB_NAME}"
paths:
- "${SONAR_USER_HOME}/cache"
script:
- >
set -x; sonar-scanner -Dsonar.python.version="3.7, 3.8, 3.9"
${SONAR_SETTINGS:+-Dproject.settings="$SONAR_SETTINGS"}
${SONAR_QUALITY_GATE_WAIT:+-Dsonar.qualitygate.wait="$SONAR_QUALITY_GATE_WAIT"}
${SONAR_SOURCE_ENCODING:+-Dsonar.sourceEncoding="$SONAR_SOURCE_ENCODING"}
${SONAR_PROJECT_KEY:+-Dsonar.projectKey="$SONAR_PROJECT_KEY"}
${SONAR_PROJECT_NAME:+-Dsonar.projectName="$SONAR_PROJECT_NAME"}
${SONAR_PROJECT_VERSION:+-Dsonar.projectVersion="$SONAR_PROJECT_VERSION"}
${SONAR_SOURCES:+-Dsonar.sources="$SONAR_SOURCES"}
${SONAR_EXCLUSIONS:+-Dsonar.exclusions="$SONAR_EXCLUSIONS"}
${SONAR_SCM_PROVIDER:+-Dsonar.scm.provider="$SONAR_SCM_PROVIDER"}
${CI_MERGE_REQUEST_IID:+-Dsonar.pullrequest.key="$CI_MERGE_REQUEST_IID"}
${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:+-Dsonar.pullrequest.branch="$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"}
${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:+-Dsonar.pullrequest.base="$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"}
timeout: 15 minutes
allow_failure: true
tags:
- shared
2 changes: 2 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sonar.projectKey=com.redhat.rhpds.redhat-cop.poolboy
sonar.qualitygate.wait=true
Loading