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

How can I deploy repository to Firebase with SSH key?

Edited

Hi everybody.

I'm absolutely new to Bitbucket, exactly start from thanksgiving day.

I'm going to deploy project to Firebase.

Then I have a error that unable to access to repo with requested url return 403.

I'm user of repo, not owner.

Please help me everybody.

How can I deploy repository to Firebase with SSH key?

Do I need the owner's SSH key? or else?

2 answers

Hi @Caroline R . Thanks for your kindness.

I set up SSH key, and then updated the remote URL to my repository to change the authentication to SSH before.

And then I'm going to deploy project of the repository by using pipeline as frontend.

I written file bitbucket_pipeline.yaml as follows:

 

image: atlassian/default-image:2

pipelines:

branches:

master:

- step:

name: 'Build and Test'

script:

- echo "Your build and test goes here..."

- step:

name: 'Updation'

script:

- echo "Pulling Latest code from the git"

- ssh $CREDIBLED_PROD_SERVER_USER@$CREDIBLED_PROD_SERVER "cd credibled_app && git pull"

- ssh $CREDIBLED_PROD_SERVER_USER@$CREDIBLED_PROD_SERVER "docker rm -f frontend && docker rmi frontend"

- step:

name: 'Deployment'

script:

- ssh $CREDIBLED_PROD_SERVER_USER@$CREDIBLED_PROD_SERVER "cd compose && docker-compose up -d frontend"

- echo "Application deployed successfully"

I'd like to know why I can't my repository with SSH key, and how to repair this if there is a way.

I hope you are very helpful forward. I'm waiting. 

Thanks.

From Maksim.

Caroline R Atlassian Team Dec 06, 2021

Hi, Maksim

Thanks for the additional information. We have the following guide on how to deploy to Firebase, which includes step by step instructions on how to use a pipe and a Firebase token to push:

If you prefer to stick to your approach and your YAML file, could you please confirm the following information:

  • Which command gives you an error?

  • What is the output of the command that is failing, now that you switched to SSH?

  • Can you access this server, $CREDIBLED_PROD_SERVER, outside of Pipelines? Either directly or via SSH from your machine? If so, can you try a git pull command in that directory directly from the server, and let us know what is the output then?

Please let me know how it goes and feel free to share any additional questions or concerns regarding this case. 

Kind regards,
Caroline

0 votes
Caroline R Atlassian Team Nov 30, 2021

Hi, @maksim kolin! Welcome to the community! 

By the error message you shared with us, I believe you were trying to use HTTPS to connect with your repository, is that correct? If that’s the case, we announced in June that we are phasing out the use of user login passwords for REST APIs and git over HTTPS.

We recently announced the first phase of this, where any user with an Atlassian account created on or after UTC 00:00 on 13 September 2021 must use a Bitbucket Cloud generated App Password for all git operations over HTTPS and for REST API authentication.

In this case, as you have recently created your account, you will need to use an App Password if you would like to use HTTPS. So I would ask you to please try to create and use an App Password and let me know if you have any problems using or configuring this, we will be happy to assist you. 

However, if you want to use SSH to authenticate, you will need to first Set up an SSH key, and then update the remote URL to your repository to change the authentication to SSH. You can follow the steps described in this doc to change the remote URL:

I hope this helps, but do let me know if you have any questions. 

Kind regards,
Caroline

Hi @Caroline R . Thanks for your kindness.

I set up SSH key, and then updated the remote URL to my repository to change the authentication to SSH before.

And then I'm going to deploy project of the repository by using pipeline as frontend.

I written file bitbucket_pipeline.yaml as follows:

 

image: atlassian/default-image:2

pipelines:

branches:

master:

- step:

name: 'Build and Test'

script:

- echo "Your build and test goes here..."

- step:

name: 'Updation'

script:

- echo "Pulling Latest code from the git"

- ssh $CREDIBLED_PROD_SERVER_USER@$CREDIBLED_PROD_SERVER "cd credibled_app && git pull"

- ssh $CREDIBLED_PROD_SERVER_USER@$CREDIBLED_PROD_SERVER "docker rm -f frontend && docker rmi frontend"

- step:

name: 'Deployment'

script:

- ssh $CREDIBLED_PROD_SERVER_USER@$CREDIBLED_PROD_SERVER "cd compose && docker-compose up -d frontend"

- echo "Application deployed successfully"

I'd like to know why I can't my repository with SSH key, and how to repair this if there is a way.

I hope you are very helpful forward. I'm waiting. 

Thanks.

From Maksim.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

216 views 2 5
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