aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <rendinam@users.noreply.github.com>2019-06-17 17:27:27 -0400
committerGitHub <noreply@github.com>2019-06-17 17:27:27 -0400
commit98aaadd0d686909a7040d549b851cb4ccb790ef0 (patch)
tree9bc83b513040c5f2080669d515e153212977906a
parentea6e3635c2899d61c82560c99579529d37ee2f38 (diff)
downloadjscu_refactor-98aaadd0d686909a7040d549b851cb4ccb790ef0.tar.gz
Traverse to clone subdir for execution of git log command (#54)1.3.17
Document dir blocks. Remove lib override
-rw-r--r--Jenkinsfile5
-rw-r--r--vars/utils.groovy22
2 files changed, 14 insertions, 13 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index df5255b..4cc967a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,5 +1,4 @@
-//@Library('utils@subdir') _
-
+//@Library('utils@subdirfix') _
// [skip ci] and [ci skip] have no effect here.
if (utils.scm_checkout(['skip_disable':true])) return
@@ -7,7 +6,7 @@ if (utils.scm_checkout(['skip_disable':true])) return
// Allow modification of the job configuration, affects all relevant build configs.
// Pass this object in the argument list to the`run()` function below to apply these settings to the job's execution.
jobconfig = new JobConfig()
-jobconfig.post_test_summary = true
+//jobconfig.post_test_summary = true
//jobconfig.credentials = ['SECRET_VALUE']
//jobconfig.enable_env_publication = true
//jobconfig.publish_env_on_success_only = false
diff --git a/vars/utils.groovy b/vars/utils.groovy
index 2232325..2fb8fe5 100644
--- a/vars/utils.groovy
+++ b/vars/utils.groovy
@@ -58,16 +58,18 @@ def scm_checkout(args = ['skip_disable':false]) {
sh "mkdir clone"
stat = sh(script: "shopt -s dotglob; mv * clone", returnStatus: true)
println("args['skip_disable'] = ${args['skip_disable']}")
- if (args['skip_disable'] == false) {
- // 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")
- return skip_job
+ dir('clone') {
+ if (args['skip_disable'] == false) {
+ // 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")
+ return skip_job
+ }
}
- }
+ } //end dir(...
stash includes: '**/*', name: 'source_tree', useDefaultExcludes: false
}
}
@@ -310,7 +312,7 @@ def publishCondaEnv(jobconfig, test_info) {
} else {
pushToArtifactory("conda_env_dump_*", pub_repo)
}
- }
+ } // end dir(...
}
}