|
| 1 | +// Copyright 2017-2020 Intel Corporation |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +// This script acts as a trigger script for the main he-transformer-unittest.groovy |
| 16 | +// Jenkins job. This script is part of a Jenkins multi-branch pipeline job |
| 17 | +// which can trigger GitHub jobs more effectively than the GitHub Pull |
| 18 | +// Request Builder (GHPRB) plugin, in our environment. |
| 19 | + |
| 20 | +// The original he-transformer-unittest job required the following parameters. We |
| 21 | +// set these up below as global variables, so we do not need to rewrite the |
| 22 | +// original script -- we only need to provide this new trigger hook. |
| 23 | +// |
| 24 | + |
| 25 | +String JENKINS_BRANCH = "lam/update_SPH" |
| 26 | +String TIMEOUTTIME = "3600" |
| 27 | + |
| 28 | +// Constants |
| 29 | +String JENKINS_DIR = "jenkins" |
| 30 | + |
| 31 | +timestamps { |
| 32 | + |
| 33 | + node("trigger") { |
| 34 | + |
| 35 | + deleteDir() // Clear the workspace before starting |
| 36 | + |
| 37 | + // Clone the cje-algo directory which contains our Jenkins groovy scripts |
| 38 | + def sleeptime=0 |
| 39 | + retry(count: 3) { |
| 40 | + sleep sleeptime; sleeptime = 10 |
| 41 | + sh "git clone -b $JENKINS_BRANCH https://gitlab.devtools.intel.com/AIPG/AlgoVal/cje-algo $JENKINS_DIR" |
| 42 | + } |
| 43 | + def ngtfNNPICIPreMerge = load("$JENKINS_DIR/sph-ng-tf-validation/sph-ci-premerge/ng-tf-nnpi-ci-premerge.groovy") |
| 44 | + ngtfNNPICIPreMerge(prURL: CHANGE_URL, |
| 45 | + prAuthor: CHANGE_AUTHOR, |
| 46 | + useMBPipelineSCM: 'true', |
| 47 | + checkoutBranch: '-UNDEFINED-BRANCH-' |
| 48 | + ) |
| 49 | + echo "jenkins-trigger-nnpi.groovy completed" |
| 50 | + |
| 51 | + } // End: node |
| 52 | + |
| 53 | +} // End: timestamps |
| 54 | + |
| 55 | +echo "Done" |
0 commit comments