You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							53 lines
						
					
					
						
							1.5 KiB
						
					
					
				
			
		
		
	
	
							53 lines
						
					
					
						
							1.5 KiB
						
					
					
				| 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 go'
 | |
|                     dependencyCheck additionalArguments: '-f JSON -f HTML -n --enableExperimental \
 | |
|                         -l deplog \
 | |
|                         --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'
 | |
|                     sh 'cat deplog'
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|         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
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 |