I do a modification in my local copy of the repository and commit the change to the local repository into a new branch. Then i do some more corrections and commit those changes to the same branch. Now my local branch has two commits done to two separate files in the repo. Then i push the local branch to the remote repository.
Now the default pipeline gets triggered. But i see that the default pipeline is triggered only one the last commit that was done to the branch and it does not include the first commit.
Depending on what files are changes in a commit i have change sets in place to trigger different builds in the default pipeline. So when my branch that was pushed contain changes to two different files done in two different commits i expect that both builds would get executed because there were two changes. But in this case only the last commit was picked and only that build will get executed.
How can I overcome this behaviour, because i need all the builds to be triggered that matches the change sets when i do a push.
Here is an extract of my pipeline:
pipelines:
default: #This will build and push the modified container image
- parallel:
- step: &build_ifs_secrets_handler
name: build_ifs_secrets_handler
script:
- export COMMIT_VERSION=`echo ${BITBUCKET_BRANCH} | sed 's/\///g'`
- HOST_UID=`id -u` TRACE=true ./build_push_secrets.sh
condition:
changesets:
includePaths:
- ifs/secret-handler/**
artifacts: # results of the security scan
- ifs/pipeline_scripts/*.txt
services:
- docker
caches:
- docker
- step: &build_ifs_base_image
name: build_ifs_base_image
script:
- HOST_UID=`id -u` TRACE=true ./build_push_base.sh
condition:
changesets:
includePaths:
- ifs/base/**
artifacts: # results of the security scan
- ifs/pipeline_scripts/*.txt
services:
- docker
caches:
- docker
- trivycache
So if my first commit had change done to ifs/secret-handler/** and my second commit had changes done to ifs/base/** i want both pipelines to be triggered when the branch is pushed with those two commits.
But what happens now is only the second commit gets triggered and only the pipeline build_ifs_base_image gets executed.