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).