I have netcoreapp1.0 , which I create using Bitbucket pipelines and pack using the dotnet pack , and click Octopus to deploy as MyAssembly.Api.1.0.0-beta - *. nupkg, where * number of the commit number / assembly (or any other stable incremented number).
Since commit identifiers in GIT are UUIDs, I tried the following commands (see below) to get a commit counter, but the total number of commits is very unreliable and does not work properly. Locally, I get that it works very well, and the number of transactions increases for each commit that I make for my local repo. Unfortunately, none of the commands works in the pipeline (works in the Docker container). For some reason, the number of fixations remains the same or even sometimes decreases.
I read somewhere that this is due to the “shallow / inexpressible” GIT repo blabla ... and that it can be resolved by logging in (before GIT) every time. I don’t want to do this if I can avoid it, and I find it kind of ironic that I will need to enter the GIT inside Bitbucket itself.
git shortlog | grep -cE '^[ ]+\w+' git rev-list HEAD --count git rev-list --all --count git rev-list --no-merges --count HEAD git log --pretty=format:'' | wc -l git log master --pretty=oneline | wc -l
Q: Is there any other way to increase the value and access it as a variable in the pipeline?
source share