This repository has shared functionality for stack ci/cd jobs.
Create a Jenkinsfile
which loads the Jenkins Pipeline libraries
from this repo, then call into the pipeline you want to run.
Here is how to dynamically load and call the branch pipeline from a Jenkinsfile:
// Load a library dynamically. For more detail, see:
// https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-declarative-pipelines
library identifier: 'stack-cicd@master', retriever: modernSCM(
[$class: 'GitSCMSource',
remote: 'https://github.com/suskin/stack-cicd',
credentialsId: 'github-upbound-jenkins'])
// This is the name of a file declared in vars/{{fileName}}.groovy in the library repository.
runStackBranchPipeline()
There are other ways to load shared libraries. See the Jenkins Pipeline documentation for more detail.
See this guide.