You Wang | d1a5464 | 2021-02-05 15:42:04 -0800 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org> |
| 2 | // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 3 | |
| 4 | pipeline { |
| 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 { |
Jeremy Ronquillo | 1de9830 | 2022-02-09 09:37:31 -0800 | [diff] [blame^] | 25 | def handle = triggerRemoteJob job: "${params.project}_premerge_${params.pod}_4g_bess_${params.ghprbTargetBranch}", |
You Wang | d1a5464 | 2021-02-05 15:42:04 -0800 | [diff] [blame] | 26 | parameters: """ |
Jeremy Ronquillo | 1de9830 | 2022-02-09 09:37:31 -0800 | [diff] [blame^] | 27 | sdcore_version=${params.ghprbTargetBranch} |
| 28 | aether_version=${params.ghprbTargetBranch} |
You Wang | d1a5464 | 2021-02-05 15:42:04 -0800 | [diff] [blame] | 29 | ghprbTargetBranch=${params.ghprbTargetBranch} |
| 30 | ghprbPullId=${params.ghprbPullId} |
| 31 | ghprbActualCommit=${params.ghprbActualCommit} |
| 32 | """, |
| 33 | remoteJenkinsName: "${remoteJenkinsName}", |
| 34 | token: "${token}" |
| 35 | echo 'Remote Status: ' + handle.getBuildStatus().toString() |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | post { |
| 42 | always { |
| 43 | // Copy artifacts from the remote job dir (make sure both jobs run on the same node) |
| 44 | sh """ |
Jeremy Ronquillo | 1de9830 | 2022-02-09 09:37:31 -0800 | [diff] [blame^] | 45 | cp -r ../${params.project}_premerge_${params.pod}_4g_bess_${params.ghprbTargetBranch}/* ./ |
You Wang | d1a5464 | 2021-02-05 15:42:04 -0800 | [diff] [blame] | 46 | """ |
You Wang | dc1305a | 2021-02-08 12:37:10 -0800 | [diff] [blame] | 47 | archiveArtifacts artifacts: "**/*.*", allowEmptyArchive: true |
You Wang | d1a5464 | 2021-02-05 15:42:04 -0800 | [diff] [blame] | 48 | } |
| 49 | } |
| 50 | } |