Commit 3ceb6499 authored by crlishka's avatar crlishka Committed by Robert Kimball

Implement new CI trigger to alleviate API rate issues (#1311)

* Initial stab at a trigger script for Jenkins mult-branch pipeline

* CHANGE_URL is not working, so disable for now

* CHANGE_AUTHOR not found either, disabling

* Disable some prints of vars that do not appear to be available

* Add in node block

* Correct the node-label expression

* Put Jenkins repo in a subdirectory and use the requested branch

* Fix groovy syntax error

* Call ngraph-unittest.groovy

* Corrected the branch name for cje-algo

* Now that the GitHub plugin is working, try restoring CHANGE_URL and CHANGE_AUTHOR

* Set an environment variable MB_PIPELINE_CHECKOUT, to trigger proper checkout command in runNgraphBuild()

* Try alternate load mechanism

* I've settled on using "load()" to directly run the code in ngraph-unittest.groovy, so remove vestigal loading of an ngraphUnitTest() function

* Change parameter assignments to be of the form params.var = 'new value'

* Try alternate method of setting parameter values for ngraph-unittest.groovy

* Try parameters-setting syntax from https://qa.nuxeo.org/jenkins/pipeline-syntax/globals#params

* Correct typo

* Try to work around parameter expansion issue

* Modify strategy for passing parameters and using MB Pipeline style checkouts, as per discussions with Nick

* Fixed calling syntax

* Simply call

* Make job parameters as local variables and passed as parameters to ngraphCIPremerge() function, as many of these are used in the closure for parallel tasks, and the lexically scoped global vaiariables was causing function signature mismatches on runNgraphBuild() calls.

* Remove prints

* Move CI to working from Jenkins cje-algo master branch

* Add standard header copyright message

* Changes from suggestions in PR review

* Revert env.WORKSPACE (requested in a review) because it wasn't working -- a "null" ending up in the load path, for unknown reasons
parent 24b41844
// Copyright 2017-2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This script acts as a trigger script for the main ngraph-unittest.groovy
// Jenkins job. This script is part of a Jenkins multi-branch pipeline job
// which can trigger GitHub jobs more effectively than the GitHub Pull
// Request Builder (GHPRB) plugin, in our environment.
// The original ngraph-unittest job required the following parameters. We
// set these up below as global variables, so we do not need to rewrite the
// original script -- we only need to provide this new trigger hook.
//
// Parameters which ngraph-unittest uses:
String PR_URL = CHANGE_URL
String PR_COMMIT_AUTHOR = CHANGE_AUTHOR
String JENKINS_BRANCH = "master"
Integer TIMEOUTTIME = "3600"
// BRANCH parameter is no loner needed
// TRIGGER_URL parameter is no longer needed
// Constants
JENKINS_DIR = '.'
env.MB_PIPELINE_CHECKOUT = true
timestamps {
node("trigger") {
deleteDir() // Clear the workspace before starting
// Clone the cje-algo directory which contains our Jenkins groovy scripts
git(branch: JENKINS_BRANCH, changelog: false, poll: false,
url: 'https://github.intel.com/AIPG/cje-algo')
// Call the main job script.
//
// NOTE: We keep the main job script in github.intel.com because it may
// contain references to technology which has not yet been released.
//
echo "Calling ngraph-ci-premerge.groovy"
def ngraphCIPreMerge = load("${JENKINS_DIR}/ngraph-ci-premerge.groovy")
ngraphCIPreMerge(PR_URL, PR_COMMIT_AUTHOR, JENKINS_BRANCH, TIMEOUTTIME)
echo "ngraph-ci-premerge.groovy completed"
} // End: node
} // End: timestamps
echo "Done"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment