Add manual run to FOSSA and REUSE license scans for OMEC repos.
Change-Id: Ia31ff00228af7937de97ea86d0c714fc59297e43
diff --git a/jjb/pipeline/omec-reuse-scan.groovy b/jjb/pipeline/omec-reuse-scan.groovy
index 55aa0c4..9db0c9c 100644
--- a/jjb/pipeline/omec-reuse-scan.groovy
+++ b/jjb/pipeline/omec-reuse-scan.groovy
@@ -37,6 +37,9 @@
}
stage ("Checkout Pull Request") {
+ when {
+ expression {return params.ghprbPullId != ""}
+ }
steps {
checkout([
$class: 'GitSCM',
@@ -47,16 +50,35 @@
}
}
+ stage ("Checkout Repo (manual)") {
+ when {
+ expression {return params.ghprbPullId == ""}
+ }
+ steps {
+ checkout([
+ $class: 'GitSCM',
+ userRemoteConfigs: [[ url: "https://github.com/${params.ghprbGhRepository}" ]],
+ extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${params.project}"]],
+ ],
+ )
+ }
+ }
+
stage("Run REUSE Linter"){
steps {
- sh '''
+ sh """
#!/usr/bin/env bash
- cd $project
- git checkout FETCH_HEAD
+ cd ${params.project}
+ if [ ! -Z ${params.ghprbPullId} ]
+ then
+ git checkout FETCH_HEAD
+ else
+ git checkout ${params.branch}
+ fi
git show
reuse lint
- '''
+ """
}
}
}