From 5645a735d75d96307843fe05a1bef9d526cbf376 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 27 Nov 2017 11:56:55 -0500 Subject: Rename file --- vars/jfile_utils.groovy | 40 ---------------------------------------- vars/utils.groovy | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 40 deletions(-) delete mode 100644 vars/jfile_utils.groovy create mode 100644 vars/utils.groovy (limited to 'vars') diff --git a/vars/jfile_utils.groovy b/vars/jfile_utils.groovy deleted file mode 100644 index 27f4821..0000000 --- a/vars/jfile_utils.groovy +++ /dev/null @@ -1,40 +0,0 @@ -// Jenkinsfile utilities - -// Clone the source repository and examine the most recent commit message. -// If a '[ci skip]' or '[skip ci]' directive is present, immediately abort the build -// terminate the job with a success code. -// If no skip directive is found, stash all the source files for efficient retrieval -// by subsequent nodes. -def scm_checkout() { - skip_job = 0 - node("on-master") { - stage("Setup") { - checkout(scm) - // Obtain the last commit message and examine it for skip directives. - logoutput = sh(script:"git log -1 --pretty=%B", returnStdout: true).trim() - if (logoutput.contains("[ci skip]") || logoutput.contains("[skip ci]")) { - skip_job = 1 - currentBuild.result = 'SUCCESS' - println("\nBuild skipped due to commit message directive.\n") - // System.exit(0) // WARNING: FATAL to Jenkins - return skip_job - //throw new hudson.AbortException('Guess what!') - //throw new java.io.IOException('Guess what!') - } - sh(script: "ls -al") - stash includes: '**/*', name: 'source_tree' - } - } - return skip_job -} - -//if (scm_checkout()) { -// return -//} - - -def concurrent2(mylist) { - for (build in mylist) { - println("concurrent2: build.nodetype = ${build.nodetype}") - } -} diff --git a/vars/utils.groovy b/vars/utils.groovy new file mode 100644 index 0000000..d56bf8a --- /dev/null +++ b/vars/utils.groovy @@ -0,0 +1,37 @@ +// Jenkinsfile utilities + +// Clone the source repository and examine the most recent commit message. +// If a '[ci skip]' or '[skip ci]' directive is present, immediately +// terminate the job with a success code. +// If no skip directive is found, stash all the source files for efficient retrieval +// by subsequent nodes. +def scm_checkout() { + skip_job = 0 + node("on-master") { + stage("Setup") { + checkout(scm) + // Obtain the last commit message and examine it for skip directives. + logoutput = sh(script:"git log -1 --pretty=%B", returnStdout: true).trim() + if (logoutput.contains("[ci skip]") || logoutput.contains("[skip ci]")) { + skip_job = 1 + currentBuild.result = 'SUCCESS' + println("\nBuild skipped due to commit message directive.\n") + // System.exit(0) // WARNING: FATAL to Jenkins + return skip_job + //throw new hudson.AbortException('Guess what!') + //throw new java.io.IOException('Guess what!') + } + sh(script: "ls -al") + stash includes: '**/*', name: 'source_tree' + } + } + return skip_job +} + + +def concurrent2(configs) { + def tasks = [:] + for (config in configs) { + println("concurrent2: build.nodetype = ${config.nodetype}") + } +} -- cgit