You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have been using a runner using Docker, and was able to execute my pipeline successfully each time. I have recently switched to Linux Shell as I do not want to reinstall dependencies each time I need to run the pipeline (no company artifactory available to store Docker images) and it is easier to just use the bash shell to do all the same commands.
I was able to set up the Linux Shell fine and it did all of my commands in my scripts successfully and as expected, however it is not able to do a git push, causing the pipeline to fail. I get this error in my pipeline that kills it:
fatal: could not read Username for 'https://bitbucket.org': No such device or address
What can I fix in my pipeline configuration or in my runner to allow for this to work successfully?
Hey @Illya Kuzmych !
Thanks for reaching out to the Community :)
Based on the error message being returned :
fatal: could not read Username for 'https://bitbucket.org': No such device or address
Git does not have the credentials configured for the authentication to the repository, causing the push to fail.
When trying to push back to the repository from within the pipeline using self-hosted linux shell runners, you will need to first set the credentials that will be used by git to authenticate with Bitbucket Cloud. This can be done by executing the following command as part of your pipeline before the push:
git remote set-url origin https://$USERNAME:$APP_PASS@bitbucket.org/WORKSPACE/RESPOSITORY.git
In this example we are considering the creation of environment variables named USERNAME and APP_PASS, where :
Following is an example pipeline using the command above :
pipelines:
default:
- step:
name: Test
runs-on:
- 'self.hosted'
- 'linux.shell'
script:
- git remote set-url origin https://$USERNAME:$APP_PASS@bitbucket.org/WORKSPACE/REPOSITORY.git
- touch fileA.txt
- git add .
- git commit -m "[skip ci] testing push from linux shell"
- git push
The [skip ci] label can be used in the commit message so this commit does not trigger a new pipeline build, which could cause pipelines to get into a loop.
Hope that helps! Let me know in case you have any questions.
Thank you, @Illya Kuzmych !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.