Move OMEC CI container jobs to remote Jenkins
Change-Id: I47b419f0ab442ee8b2fde4ee55332398ff259d36
diff --git a/jjb/pipeline/omec-container-remote.groovy b/jjb/pipeline/omec-container-remote.groovy
new file mode 100644
index 0000000..6b3323d
--- /dev/null
+++ b/jjb/pipeline/omec-container-remote.groovy
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
+// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+pipeline {
+
+ agent {
+ label "${params.buildNode}"
+ }
+
+ options {
+ lock(resource: "${params.pod}")
+ }
+
+ stages {
+ stage ("Environment Cleanup"){
+ steps {
+ step([$class: 'WsCleanup'])
+ }
+ }
+
+ stage ("Trigger Remote Test Job"){
+ steps {
+ withCredentials([string(credentialsId: 'aether-jenkins-remote-trigger-token-omec', variable: 'token')]) {
+ script {
+ def handle = triggerRemoteJob job: "${params.project}_premerge_${params.pod}",
+ parameters: """
+ ghprbTargetBranch=${params.ghprbTargetBranch}
+ ghprbPullId=${params.ghprbPullId}
+ ghprbActualCommit=${params.ghprbActualCommit}
+ """,
+ remoteJenkinsName: "${remoteJenkinsName}",
+ token: "${token}"
+ echo 'Remote Status: ' + handle.getBuildStatus().toString()
+ }
+ }
+ }
+ }
+ }
+ post {
+ always {
+ // Copy artifacts from the remote job dir (make sure both jobs run on the same node)
+ sh """
+ cp -r ../${params.project}_premerge_${params.pod}/* ./
+ """
+ archiveArtifacts artifacts: "omec/*/*", allowEmptyArchive: true
+ archiveArtifacts artifacts: "ng40/*/*", allowEmptyArchive: true
+ }
+ }
+}