Hi,
as part of conditional deployment in the bitbucket pipelines, i am trying to use git diff
i.e. git diff remotes/origin/${branch_1} remotes/origin/master -- $file
for each object and deploy only specific objects.
I have create a new branch , updated the pipeline with :
clone:
depth: full
but the pipeline fails for my team mates deployment and works for me .below is the error that my team mate is seeing while deploying his branch :
+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="develop" https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
Cloning into '/opt/atlassian/pipelines/agent/build'...
error :
fatal: bad revision 'remotes/origin/feature/<branch_name>
Your teammate and you, you might build different revisions. If develop not yet contains the topic branch (e.g. it is not merged into it yet), I find it imaginable that the topic is not available in git as branch HEAD. See the `git clone` command, only the `develop` branch is cloned. All other branches may (must) not exist (there are no reference to them), therefore the topic branch (`remotes/origin/feature/<branch_name>`) is a bad revision, git can not resolve the name to a revision hash (or does not have cloned up to that revision hash, from top of my head I can't specifically say for git).
All in all, fetching the topic branch first in the pipeline might already solve the issue for your teammate as well. You might have run the pipeline on the topic branch directly, therefore it was cloned. Comparing the output for your build against the one of your colleague, might shed more light.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.