I have a question about triggering my pipeline.
Github Repo A:
Github Repo B:
So I want this pipeline to be triggered every time a commit is pushed into Repo B, what is the best way to do that? Is using Github webhooks the best way to do this?
I had a similar issue. My JenkinsFile was not in the same SCM I want to watch and trigger by BitBucket push.
SCM CodeBase JenkinsFile.groovy
SCM SourceCpp <project>
I tried to create declarative pipeline with JenkinsFile.groovy to be triggered for push into SourceCpp.
So far I have tried:
Poll SCM - does not work, I cannot specify what SCM to poll. Trigger builds remotely - obvious security risk, cannot have API key in cleartext. GitHub - not applicable for my BitBucket. Bitbucket webhook trigger - cannot override SCM to SourceCpp
Build when a change is pushed to BitBucket - promising, but does not work/trigger despite I have overrided URL.
But there is a solution:
or as a declarative syntax:
*triggers {
// this is a hack to make dependency on SourceCpp.git work
upstream 'Dull_project'
}*
Problem solved.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.