Update Blackduck jobs
- Add post-merge jobs
- Rename periodic jobs
- Add an ONOS gerrit periodic check
- Use `blackduck-project` and eliminate use of `project-name`
Change-Id: I37cbb13c9b8f3915a76e1a125df9f38f189fc116
diff --git a/jjb/pipeline/docker-publish.groovy b/jjb/pipeline/docker-publish.groovy
index 9279635..dce23f1 100644
--- a/jjb/pipeline/docker-publish.groovy
+++ b/jjb/pipeline/docker-publish.groovy
@@ -1,3 +1,17 @@
+// Copyright 2017-present Open Networking Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
/* docker-publish pipeline */
pipeline {
diff --git a/jjb/pipeline/synopsys-check.groovy b/jjb/pipeline/synopsys-check.groovy
index f111415..c0fca94 100644
--- a/jjb/pipeline/synopsys-check.groovy
+++ b/jjb/pipeline/synopsys-check.groovy
@@ -105,7 +105,7 @@
script {
repos.each { gitRepo ->
sh "echo Running Synopsys Detect on: ${gitRepo}"
- synopsys_detect("--detect.source.path=${gitRepo} --detect.project.name=${blackduck_project} --detect.project.version.name=${branch} --detect.blackduck.signature.scanner.snippet.mode=true --detect.tools=ALL --detect.cleanup=false")
+ synopsys_detect("--detect.source.path=${gitRepo} --detect.project.name=${blackduck_project}_${gitRepo} --detect.project.version.name=${branch} --detect.blackduck.signature.scanner.snippet.mode=true --detect.tools=ALL --detect.cleanup=false")
}
}
}
diff --git a/jjb/pipeline/synopsys-single.groovy b/jjb/pipeline/synopsys-single.groovy
new file mode 100644
index 0000000..c1df6ec
--- /dev/null
+++ b/jjb/pipeline/synopsys-single.groovy
@@ -0,0 +1,74 @@
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// synopsys-single.groovy
+// checks a single repo against synopsys
+
+pipeline {
+
+ /* no label, executor is determined by JJB */
+ agent {
+ label "${params.executorNode}"
+ }
+
+ options {
+ timeout(30)
+ }
+
+ stages {
+
+ stage ("Clean workspace") {
+ steps {
+ sh 'rm -rf *'
+ }
+ }
+
+ stage('checkout') {
+ steps {
+ checkout([
+ $class: 'GitSCM',
+ userRemoteConfigs: [[
+ url: "${params.gitUrl}",
+ name: "${params.gitRef}",
+ ]],
+ extensions: [
+ [$class: 'WipeWorkspace'],
+ [$class: 'RelativeTargetDirectory', relativeTargetDir: "${params.projectName}"],
+ [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
+ ],
+ ])
+ script {
+ git_tag_or_branch = sh(script:"cd $projectName; if [[ \$(git tag -l --points-at HEAD) ]]; then git tag -l --points-at HEAD; else ${branchName}; fi", returnStdout: true).trim()
+ }
+ }
+ }
+
+ stage ("Synopsys Detect") {
+ steps {
+ sh "echo Running Synopsys Detect on: ${params.projectName}"
+ synopsys_detect("--detect.source.path=${params.projectName} --detect.project.name=${blackduck_project}_${params.projectName} --detect.project.version.name=$git_tag_or_branch --detect.blackduck.signature.scanner.snippet.mode=true --detect.tools=ALL --detect.cleanup=false")
+ }
+ }
+
+ stage ("Save logs") {
+ steps {
+ sh returnStdout: true, script: """
+ echo COPYING LOGS
+ mkdir -p bd_logs
+ cp -r /home/jenkins/blackduck/runs/* bd_logs
+ ls -l bd_logs/*/*
+ """
+ archiveArtifacts artifacts:'bd_logs/**/*.*'
+ }
+ }
+ }
+}