@mac
To pull from a private repo in a Bitbucket pipeline, you will need to provide the necessary authentication credentials to access the repository. Here's how you can do it:
- Set up SSH key authentication:
Generate an SSH key pair on your local machine using ssh-keygen.
Add the public key to your Bitbucket account under "SSH keys" in your account settings.
Add the private key to your pipeline configuration as a secure environment variable.
- Use the SSH key to authenticate when pulling from the private repository in your pipeline script:
- ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- git clone [email protected]:
- Replace
- Don't forget to encrypt your SSH private key as a secure environment variable in your pipeline settings to ensure that it remains secure.
By following these steps, you should be able to pull from a private repo in a Bitbucket pipeline successfully.