Skip to content

Commit 33f79cf

Browse files
committed
Update Sonarqube and use local image for database
1 parent 47c0e88 commit 33f79cf

13 files changed

Lines changed: 89 additions & 15 deletions

.github/workflows/continuous-integration-workflow.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-22.04
5252
strategy:
5353
matrix:
54-
version: ['10.8.0'] # 9.9 = LTS
54+
version: ['2025.1.1'] # 2025.1.1 = LTS
5555
edition: ['developer', 'enterprise']
5656
steps:
5757
-
@@ -66,6 +66,21 @@ jobs:
6666
run: |
6767
cd sonarqube && ./test.sh --sq-version=${{ matrix.version }} --sq-edition=${{ matrix.edition }}
6868
69+
sonarqube-postgresql:
70+
name: SonarQube PostgreSQL tests
71+
runs-on: ubuntu-22.04
72+
steps:
73+
-
74+
name: Checkout repository
75+
uses: actions/checkout@v4.2.2
76+
-
77+
name: Build docker image
78+
run: |
79+
./.github/workflows/build-docker-image.sh \
80+
--imagename ods-sonarqube-postgresql \
81+
--dockerdir sonarqube/docker \
82+
--dockerfile Dockerfile.database
83+
6984
nexus:
7085
name: Nexus tests
7186
runs-on: ubuntu-22.04

configuration-sample/ods-core.env.sample

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ SONAR_SAML_CERTIFICATE_B64=changeme
133133
# your SonarQube version, see https://docs.sonarqube.org/latest/requirements/requirements/.
134134
# Take care when upgrading either database or SQ version.
135135
# E.g. registry.redhat.io/rhel9/postgresql-15
136-
SONAR_DATABASE_IMAGE=docker-registry.default.svc:5000/openshift/postgresql:15
136+
SONAR_DATABASE_IMAGE=registry.redhat.io/rhel9/postgresql-15
137137
# Connection string for JDBC. Typically this does not need to be changed.
138138
SONAR_DATABASE_JDBC_URL=jdbc:postgresql://sonarqube-postgresql:5432/sonarqube
139139
# Database name for SonarQube. Typically this does not need to be changed.
@@ -151,8 +151,8 @@ SONAR_EDITION=developer
151151
# SonarQube version.
152152
# See Dockerhub https://hub.docker.com/_/sonarqube/tags
153153
# Officially supported is:
154-
# - 10.8.0
155-
SONAR_VERSION=10.8.0
154+
# - 2025.1.1
155+
SONAR_VERSION=2025.1.1
156156

157157
# SonarQube memory and CPU resources
158158
SONARQUBE_CPU_REQUEST=200m

jenkins/agent-base/Dockerfile.ubi8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM quay.io/openshift/origin-jenkins-agent-base
22

33
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
44

5-
ENV SONAR_SCANNER_VERSION=6.2.1.4610 \
6-
CNES_REPORT_VERSION=5.0.0 \
5+
ENV SONAR_SCANNER_VERSION=7.0.2.4839 \
6+
CNES_REPORT_VERSION=5.0.1 \
77
COSIGN_VERSION=2.4.3 \
88
TAILOR_VERSION=1.3.4 \
99
SOPS_VERSION=3.9.0 \

jenkins/master/plugins.ubi8.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Aditional plugins
22
greenballs:1.15.1
3-
sonar:2.17.2
3+
sonar:2.18
44
ansicolor:1.0.4
55
audit-trail:361.v82cde86c784e
66
Office-365-Connector:5.0.0

sonarqube/chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.1.1
18+
version: 1.2.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "10.8.0"
24+
appVersion: "2025.1.1"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: build.openshift.io/v1
2+
kind: BuildConfig
3+
metadata:
4+
labels:
5+
app: {{ .Values.global.appName }}
6+
name: {{ .Values.global.appName }}-postgresql
7+
spec:
8+
failedBuildsHistoryLimit: 5
9+
nodeSelector: null
10+
output:
11+
to:
12+
kind: ImageStreamTag
13+
name: {{ printf "%s-postgresql:%s" .Values.global.appName .Values.global.odsImageTag }}
14+
postCommit: {}
15+
resources:
16+
limits:
17+
cpu: {{ .Values.buildConfig.cpuLimit }}
18+
memory: {{ .Values.buildConfig.memLimit }}
19+
requests:
20+
cpu: {{ .Values.buildConfig.cpuRequest }}
21+
memory: {{ .Values.buildConfig.memRequest }}
22+
runPolicy: Serial
23+
source:
24+
contextDir: sonarqube/docker
25+
git:
26+
uri: {{ .Values.global.repoBase }}/{{ .Values.global.odsBitBucketProject }}/ods-core.git
27+
ref: {{ .Values.global.odsGitRef }}
28+
sourceSecret:
29+
name: cd-user-token
30+
type: Git
31+
strategy:
32+
type: Docker
33+
dockerStrategy:
34+
dockerfilePath: Dockerfile.database
35+
from:
36+
kind: DockerImage
37+
name: {{ .Values.global.sonarDatabaseImage}}
38+
forcePull: true
39+
noCache: true
40+
successfulBuildsHistoryLimit: 5
File renamed without changes.

sonarqube/chart/templates/dc-postgresql.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
configMapKeyRef:
4141
key: database-name
4242
name: {{ .Values.global.appName }}
43-
image: {{ .Values.global.sonarDatabaseImage}}
43+
image: {{ .Values.global.registry }}/{{ .Values.global.odsNamespace }}/{{ .Values.global.appName }}-postgresql:{{ .Values.global.odsImageTag }}
4444
imagePullPolicy: IfNotPresent
4545
livenessProbe:
4646
failureThreshold: 3
@@ -98,4 +98,13 @@ spec:
9898
claimName: {{ .Values.global.appName }}-postgresql-backup
9999
test: false
100100
triggers:
101-
- type: ConfigChange
101+
- imageChangeParams:
102+
automatic: true
103+
containerNames:
104+
- {{ .Values.global.appName }}-postgresql
105+
from:
106+
kind: ImageStreamTag
107+
name: {{ .Values.global.appName }}-postgresql:{{ .Values.global.odsImageTag }}
108+
namespace: {{ .Values.global.odsNamespace }}
109+
type: ImageChange
110+
- type: ConfigChange
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: image.openshift.io/v1
2+
kind: ImageStream
3+
metadata:
4+
labels:
5+
app: {{ .Values.global.appName }}
6+
name: {{ .Values.global.appName }}-postgresql
7+
spec:
8+
lookupPolicy:
9+
local: false
File renamed without changes.

0 commit comments

Comments
 (0)