From 284007b4cbbde36b5b29dd43be7b0214c6abbc16 Mon Sep 17 00:00:00 2001 From: Nigel Harniman Date: Fri, 6 May 2016 09:51:26 +0100 Subject: [PATCH] Load CPS library from central location --- .../reload-cps-library-on-scm-change/Jenkinsfile | 8 ++++++++ .../reload-cps-library-on-scm-change/README.md | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 global-library-examples/reload-cps-library-on-scm-change/Jenkinsfile create mode 100644 global-library-examples/reload-cps-library-on-scm-change/README.md diff --git a/global-library-examples/reload-cps-library-on-scm-change/Jenkinsfile b/global-library-examples/reload-cps-library-on-scm-change/Jenkinsfile new file mode 100644 index 0000000..d0b379b --- /dev/null +++ b/global-library-examples/reload-cps-library-on-scm-change/Jenkinsfile @@ -0,0 +1,8 @@ +#!groovy + +node('master') { + stage "checkout" + checkout scm + stage "push to jenkins" + sh "git push jenkins@localhost:workflowLibs.git '+refs/remotes/origin/*:refs/heads/*'" +} diff --git a/global-library-examples/reload-cps-library-on-scm-change/README.md b/global-library-examples/reload-cps-library-on-scm-change/README.md new file mode 100644 index 0000000..b325559 --- /dev/null +++ b/global-library-examples/reload-cps-library-on-scm-change/README.md @@ -0,0 +1,7 @@ +# Synopsis +An example of how to store the CPS Global Library in a common GitHub location +and reload it into the Jenkins masters on change + +# Credit + +This comes from the [Docker](https://github.com/docker/jenkins-pipeline-scripts/blob/master/Jenkinsfile).