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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

422 views 13 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you