parent
3cd8c2e618
commit
299d606df0
@ -0,0 +1,50 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
kubernetes {
|
||||||
|
yaml '''
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: alpine
|
||||||
|
image: alpine:3.15
|
||||||
|
command:
|
||||||
|
- sleep
|
||||||
|
- infinity
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Dependency check') {
|
||||||
|
environment {
|
||||||
|
DEPCHECKDB = credentials('depcheck-postgres')
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
container('alpine') {
|
||||||
|
sh 'apk update && apk add openjdk11 java-postgresql-jdbc'
|
||||||
|
dependencyCheck additionalArguments: '-f JSON -f HTML \
|
||||||
|
--dbDriverName org.postgresql.Driver \
|
||||||
|
--dbDriverPath /usr/share/java/postgresql-jdbc.jar \
|
||||||
|
--dbUser $DEPCHECKDB_USR \
|
||||||
|
--dbPassword $DEPCHECKDB_PSW \
|
||||||
|
--connectionString jdbc:postgresql://postgres-postgresql.postgres/depcheck', odcInstallation: 'depcheck'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('SonarQube analysis') {
|
||||||
|
environment {
|
||||||
|
SONARSCANNER_HOME = tool 'sonarscanner'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
withSonarQubeEnv('sonarqube') {
|
||||||
|
sh '$SONARSCANNER_HOME/bin/sonar-scanner'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('SonarQube quality gate') {
|
||||||
|
steps {
|
||||||
|
waitForQualityGate webhookSecretId: 'sonar-webhook', abortPipeline: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
sonar.projectKey=terraform-provider-decort-sast
|
||||||
|
sonar.dependencyCheck.jsonReportPath=dependency-check-report.json
|
||||||
|
sonar.dependencyCheck.htmlReportPath=dependency-check-report.html
|
||||||
|
|
||||||
|
sonar.exclusions=dependency-check-report.*
|
||||||
|
|
||||||
|
sonar.language=go
|
Loading…
Reference in new issue