Is there a way to use Bitbucket Pipes to sync a Bitbucket repo with an external git repo that only allows authentication with userid/password? I can only find examples of doing this with key-based authentication.
Presently Adobe Experience Cloud solutions host code in a git repo that they control, which only allows userid/password auth and not key-based auth.
Hi @Tad Reeves and welcome the community.
You can do this the following way:
1. Create variables for the username and password, either as repository variables (from the Repository settings page > Repository variables) or as workspace variables (from workspace Settings > Workspace variables), if you need those in more than one repo.
Make sure that you select the checkbox Secured when you create the variable for the password, so that it's not visible to anyone.
2. In your bitbucket-pipelines.yml file, you can include in the script a command that pushes to the repo:
git push https://${username}:${password}@hosting-provider/repo-owner/repo-name.git
assuming that the variables were named username and password
Replace also the values for hosting-provider/repo-owner/repo-name with the appropriate ones for your repo.
The Docker image that you use for the step that does the push should have git installed already for this to work.
Is this something that works for you? Please feel free to let me know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.