I would highly appreciate if you could please help me with the below issue.
I am having a multibranch pipeline in Jenkins.
The JenkinsFile (pushed on the code source repository) for this multibranch pipeline is below. The job is not triggering even though I can see in the Jenkins Logs, the Push event is received from GitHub.
library(
identifier: ‘jenkins-library@master’,
retriever: modernSCM(
[
$class: ‘GitSCMSource’,
remote: ‘https://github.com/ABC/Jenkins-CommonLib.git',
credentialsId: ‘20860d33-a0da-445c-ab1c-1d26a416e3f8’
]
)
)
properties([pipelineTriggers([githubPush()])])
node {
serviceAppBuild{}
}
However, if I use below given Jenkinsfile, then Jenkins do trigger the job correctly.
library(
identifier: ‘jenkins-library@master’,
retriever: modernSCM(
[
$class: ‘GitSCMSource’,
remote: ‘https://github.com/ABC/Jenkins-CommonLib.git',
credentialsId: ‘20860d33-a0da-445c-ab1c-1d26a416e3f8’
]
)
)
properties([pipelineTriggers([githubPush()])])
pipeline {
agent any
stages {
stage(‘Stage 1’) {
steps {
script {
echo ‘Stage 1’
}
}
}
stage(‘Stage 2’) {
steps {
script {
echo ‘Stage 2’
}
}
}
}
}
I want to do it using the first approach. But the job is not getting poked.