Jenkins' AWS SQS plugin today triggers all Jenkins jobs that subscribe to the SQS queue, but does not perform filtering on Git branches.
The problem occurs in the following scenario:
a CodeCommit git repo has two branches, "master" and "development"
a SQS queue is created for this repo to monitor changes to it
there are 2 Jenkins jobs, 1 for building "master" and 1 for building "development"
these two Jenkins jobs are configured to build using the Jenkins SQS plugin subscribing to the SQS queue.
Here, any code push to the "development" branch, will trigger both "master" and "development" Jenkins jobs, which is very bad especially when there are multiple branches being tracked.
The reason for this is, the Jenkins AWS SQS plugin is not smart enough to trigger the "right" jobs -- the SQS message in fact already tells you what branch has been changed. If we can make the plugin smarter, and provide an extra field when enabling the plugin for the job called "Subscribed branches" (which can default to the branch referred to in the build steps), the plugin only needs to trigger the jobs that match the subscribed branch.
** is recognized as wildcard that includes the separator '/'
Therefore, origin/branches* would match origin/branches-foobut not origin/branches/foo, while origin/branches** would match both origin/branches-foo and origin/branches/foo
Jenkins' AWS SQS plugin today triggers all Jenkins jobs that subscribe to the SQS queue, but does not perform filtering on Git branches.
The problem occurs in the following scenario:
Here, any code push to the "development" branch, will trigger both "master" and "development" Jenkins jobs, which is very bad especially when there are multiple branches being tracked.
The reason for this is, the Jenkins AWS SQS plugin is not smart enough to trigger the "right" jobs -- the SQS message in fact already tells you what branch has been changed. If we can make the plugin smarter, and provide an extra field when enabling the plugin for the job called "Subscribed branches" (which can default to the branch referred to in the build steps), the plugin only needs to trigger the jobs that match the subscribed branch.
Wildcard should be supported like it is in Jenkin Git Plugin
*
is recognized as a wildcard**
is recognized as wildcard that includes the separator '/'Therefore,
origin/branches*
would matchorigin/branches-foobut
notorigin/branches/foo
, whileorigin/branches**
would match bothorigin/branches-foo
andorigin/branches/foo