I've been able to `git push ...` in Pipeline scripts for awhile now, however, I'm moving over to using the new "Pipe" variant of deployments and I'm finding it impossible to push updates back to the same repo.
Is this only supported in Pipelines and not Pipes
I receive the following error:
`fatal: unable to access 'http://bitbucket.org/username/the_repo_name/': Failed to connect to localhost port 29418: Connection refused`
@Michael Russell @Brett Mathe you can use the git auth proxy feature from withing the pipe. All you have to do is to add the following line somewhere in your script:
git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://host.docker.internal:29418/
This will route git traffic from the docker container to the same git auth proxy that is used to authenticate git push commands in pipelines. Make sure you use the BITBUCKET_GIT_HTTP_ORIGIN as your git origin as well.
More info about pushing back to a repo from pipelines: https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html
Will that port always be the same? And if so, can we get this in the confluence doc you linked to as methods to push from a "Pipe" specifically; I read through that which lead me to the whole auth string bit but took a moment to get there.
This was a bit of a time sink for myself with no straight documentation on the internal workings of Pipes and git push back. It makes sense when you dig in, it was just bump in time when I was porting things over to Pipes.
Thanks for the feed back @Alexander Zhukov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The host and port should be the same. We'll consider adding this to a confluence doc after we discuss this internally.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, thanks @Alexander Zhukov it seems between your method, which appears to be what happens during build setup or using the BB auth string is the way to go.
Hopefully you all can get something on the docs for this :)
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunatelly doesn't work, error messgae:
Could not resolve proxy: host.docker.internal
Pipeline:
- git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://host.docker.internal:29418/
- git tag test
- git push origin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mateusz Przybyłek this approach is for pushing from a pipe. If you wan't to push from a pipeline, you should set the proxy to 'localhost' instead:
- git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/
See this page for more details about pushing back from pipelines https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
THANK YOU! I also took a huge hit to productivity as we switched from pipelines to pipes.
My issue is that in my yml I was calling a BB pipe - and then running `git` commands after. The BB pipe had switched my git.config as part of it's tasks - https://bitbucket.org/atlassian/bitbucket-pipe-release/src/master/pipe/scripts/git-commit.sh
Adding
git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/
after I ran the BB pipe reset my git.config so it works again. YAY
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm running into this issue too. Did you have to setup OAuth to get this to work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just do the above in my comment, you can make a BB_AUTH_STRING via instructions here https://confluence.atlassian.com/bitbucket/deploy-build-artifacts-to-bitbucket-downloads-872124574.html
It's basically just a username/app-password mash up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My current work around is to do `git remote set-url origin "https://${BB_AUTH_STRING}@Bitbucket.org/${BITBUCKET_REPO_FULL_NAME}.git"` would be amazing for Pipes to work the same way as Pipelines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.