blob: 0b743eb6abf165bc52bb0c6f9d586da07283670a [file] [log] [blame]
You Wangd1a54642021-02-05 15:42:04 -08001// SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
2// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
3
4pipeline {
5
6 agent {
7 label "${params.buildNode}"
8 }
9
10 options {
11 lock(resource: "${params.pod}")
12 }
13
14 stages {
15 stage ("Environment Cleanup"){
16 steps {
17 step([$class: 'WsCleanup'])
18 }
19 }
20
21 stage ("Trigger Remote Test Job"){
22 steps {
23 withCredentials([string(credentialsId: 'aether-jenkins-remote-trigger-token-omec', variable: 'token')]) {
24 script {
25 def handle = triggerRemoteJob job: "${params.project}_premerge_${params.pod}",
26 parameters: """
27 ghprbTargetBranch=${params.ghprbTargetBranch}
28 ghprbPullId=${params.ghprbPullId}
29 ghprbActualCommit=${params.ghprbActualCommit}
30 """,
31 remoteJenkinsName: "${remoteJenkinsName}",
32 token: "${token}"
33 echo 'Remote Status: ' + handle.getBuildStatus().toString()
34 }
35 }
36 }
37 }
38 }
39 post {
40 always {
41 // Copy artifacts from the remote job dir (make sure both jobs run on the same node)
42 sh """
You Wangdc1305a2021-02-08 12:37:10 -080043 cp -r ../${params.project}_premerge_${params.pod}/artifacts/* ./
You Wangd1a54642021-02-05 15:42:04 -080044 """
You Wangdc1305a2021-02-08 12:37:10 -080045 archiveArtifacts artifacts: "**/*.*", allowEmptyArchive: true
You Wangd1a54642021-02-05 15:42:04 -080046 }
47 }
48}