Yes, a Jenkins pipeline invokes another pipeline. Suppose if you have two Jenkins pipelines named pipeline-A and pipeline-B and want to invoke pipeline-A in pipeline-B (pipeline-A is a subset of pipeline-B). Here is how you can invoke pipeline-A in pipeline-B:
pipeline {
agent
{
node {
label 'master'
customWorkspace "${env.JobPath}"
}
}
stages
{
stage('Start') {
steps {
sh 'ls'
}
}
stage ('Invoke_pipeline') {
steps {
build job: 'pipeline1', parameters: [
string(name: 'param1', value: "value1")
]
}
}
stage('End') {
steps {
sh 'ls'
}
}
}
}
If you want to learn Jenkins, check out this Jenkins Certification course by Intellipaat.
Also, watch this video on Jenkins Pipeline: