-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCodescan
More file actions
47 lines (46 loc) · 1.28 KB
/
Codescan
File metadata and controls
47 lines (46 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
nodeSelector:
kubernetes.io/arch: arm64
securityContext:
runAsUser: 0
runAsGroup: 0
fsGroup: 0
containers:
- name: default
image: vardyng/sonar-scanner:arm-openjdk-17-node-16-17
tty: true
resources:
requests:
cpu: "500m"
memory: "512Mi"
limits:
cpu: "500m"
memory: "512Mi"
'''
}
}
stages {
stage('Scan') {
steps {
container('default') {
checkout([$class: 'GitSCM', branches: [[name: 'dev']], extensions: [], userRemoteConfigs: [[credentialsId: 'vardyng-github-pat', url: 'https://github.com/VardyNg/Portfolio.git']]])
script {
def scannerHome = tool 'homelab-sonarqube';
withSonarQubeEnv('homelab-sonarqube') { // If you have configured more than one global server connection, you can specify its name
sh """
export BROWSERSLIST_IGNORE_OLD_DATA=true
${scannerHome}/bin/sonar-scanner
"""
}
}
}
}
}
}
}