Hi
So in other words, if there is no difference (no new commit) between newly created branch and 'develop' branch which is our main branch, I don't want Pipeline build get initiated.
Is there any configuration or can I do this with a script perhaps?
Thanks
If you want to limit pipelines only to the develop branch, you should properly configure bitbucket-pipelines.yml. You can find an example here:
You can read more info here:
https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
No I don't want to limit the build to a branch. When I create a branch off develop, the new branch kicks off the build automatically while no developer has made any change to the new branch. The new branch is basically the same as develop branch. I want this specific one to be skipped. However as developers make changes to the new branch, the build should starts as normal.
As I mentioned, I want to skip a build whenever there is no change against the branch compare to the target branch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, I see. I do not have such a problem, because I make a new branch in my IDE and then when I am done, I push my new branch to Bitbucket. That is why pipeline works only on the modified branch for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can stop the build with a few GIT command to check if the current head commit is the same as develop or not but I was wondering if Pipeline has a more elegant way :)
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have a solution, kindly post it as an answer and accept your answer. It will help other users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well... I've been trying to come up with a solution... I tried to use git diff command:
git diff remotes/origin/develop..${CURR_BRANCH_NAME}
but I get error as if there is no develop branch... didn't have time to investigate more but the thing is, I was thinking even if I get this working, all I can do is returning error so the build fails... which isn't good... I like the build to be green or any other state than failure.
Because this isn't really a failure. Also I guess if a build fails, all the caches get invalidated
So I leave this open to see if anyone answers with a better solution
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.