forked from gitter-badger/daikon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-srcclr
87 lines (76 loc) · 2.79 KB
/
Jenkinsfile-srcclr
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* Pod configuration
*/
def slackChannel = 'eng-daikon'
def projectName = 'daikon'
def podLabel = "${projectName}-${UUID.randomUUID().toString()}".take(53)
def podConfiguration = """
apiVersion: v1
kind: Pod
spec:
imagePullSecrets:
- talend-registry
containers:
- name: veracode
image: artifactory.datapwn.com/tlnd-docker-prod/talend/common/tsbi/jdk17-svc-springboot-builder:4.0.7-20231211094745
command:
- cat
tty: true
resources:
requests:
memory: "4Gi"
cpu: "1"
limits:
memory: "4Gi"
cpu: "1"
volumeMounts:
- name: docker
mountPath: /var/run/docker.sock
- name: m2
mountPath: /root/daikon/.m2/repository
volumes:
- name: docker
hostPath:
path: /var/run/docker.sock
- name: m2
persistentVolumeClaim:
claimName: efs-jenkins-common-m2
"""
pipeline {
agent {
kubernetes {
label podLabel
yaml podConfiguration
}
}
stages {
stage("Scan 3rd parties vulnerabilities") {
steps {
container('veracode') {
configFileProvider([configFile(fileId: 'maven-settings-nexus-zl', variable: 'MAVEN_SETTINGS')]) {
withCredentials([string(credentialsId: 'veracode-daikon-token', variable: 'SRCCLR_API_TOKEN')]) {
sh """#!/bin/bash
cp ${MAVEN_SETTINGS} ~/.m2/settings.xml
curl -sSL https://download.sourceclear.com/ci.sh | DEBUG=1 sh -s -- scan;
"""
}
}
}
}
}
}
post {
success {
slackSend color: 'good', message: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}", channel: "${slackChannel}"
}
unstable {
slackSend color: 'warning', message: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}", channel: "${slackChannel}"
}
failure {
slackSend color: '#e81f3f', message: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}", channel: "${slackChannel}"
}
aborted {
slackSend color: 'warning', message: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}", channel: "${slackChannel}"
}
}
}