Add manual run to FOSSA and REUSE license scans for OMEC repos.

Change-Id: Ia31ff00228af7937de97ea86d0c714fc59297e43
diff --git a/jjb/pipeline/omec-fossa-scan.groovy b/jjb/pipeline/omec-fossa-scan.groovy
index 24c6cab..a6c2169 100644
--- a/jjb/pipeline/omec-fossa-scan.groovy
+++ b/jjb/pipeline/omec-fossa-scan.groovy
@@ -37,6 +37,9 @@
         }
 
         stage ("Checkout Pull Request") {
+            when {
+                expression {return params.ghprbPullId != ""}
+            }
             steps {
                 checkout([
                     $class: 'GitSCM',
@@ -47,6 +50,20 @@
             }
         }
 
+        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 ("Perform License Scan") {
             steps {
                 withCredentials([string(credentialsId: 'fossa-api-key', variable: 'FOSSA_API_KEY')]) {
@@ -54,7 +71,12 @@
                         #!/usr/bin/env bash
 
                         cd ${params.project}
-                        git checkout FETCH_HEAD
+                        if [ ! -Z ${params.ghprbPullId} ]
+                        then
+                          git checkout FETCH_HEAD
+                        else
+                          git checkout ${params.branch}
+                        fi
                         git show
 
                         echo "Testing project: ${params.project}"