Reputation: 1
I want to deploy only changed files (according to documentation: https://github.com/scolladon/sfdx-git-delta)
I add to bitbucket-pipelines.yml:
- mkdir changed-sources
- git status
- git diff YMLEdit origin/master
- sfdx sgd:source:delta --to "HEAD" -f origin/master --output changed-sources/ --generate-delta
without git diff i receive an error:
sfdx sgd:source:delta --to "HEAD" -f origin/master --output changed-sources/ --generate-delta
{
"error": "--from is not a valid sha pointer: \"origin/master\"",
"output": "changed-sources/",
"success": false,
"warnings": []
}
When I add git diff i receive this:
+ git diff YMLEdit origin/master
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Any ideas?
I tried using diffrent docker image I tried using git fetch
Upvotes: 0
Views: 1474
Reputation: 1
Okay so the above answer by @Luk En helps . I wanted to add that I was facing the same issue while trying to use the SFDX Git Delta plugin inside AWS Code Build , and Code Pipeline . I used the same fix , to CLONE FULL DEPTH in the source stage at both pipeline and build job level .
(P.S. The option at Build Job level is a bit difficult to find. Its there under Source > Additional Options > Depth . Set it to full!!)
It worked ! :)
Upvotes: 0
Reputation: 1
Bitbucket is probably running your pipeline in a shallow, single-branch clone, so that there is no origin/master.
Solution, that worked for me, following @torek's suggestion and this documentation: https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/#clone
I add to bitbucket-pipelines.yml:
clone:
depth: full
pipelines:
default:
# ...
Upvotes: 0