Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using Bitbucket Pipelines to Sync Git Repos with Password-based Access

Tad Reeves December 1, 2020

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. 

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 7, 2020

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events