Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Bitbucket pipeline to build and push artifact to another repo

I have a repo with all my source code (JavaScript) in, and I am trying to create a pipeline that builds this using Browserify, and then pushes only the final files to another bitbucket repo. The files to push are bundle.js (generated by Browserify), as well as an HTML page and CSS.
With my attempts so far, I've managed to push either just the html and CSS, or all the source files without the artifact, but I'm not really sure where to go.
Any help is greatly appreciated. Thank you in advance

2 answers

0 votes
Peter Plewa Atlassian Team Aug 16, 2018

Hi @alexclifton4

Could you share your bitbucket-pipelines.yml, it looks like you are not staging bundle.js with other files, perhaps it is specified in .gitignore?



I tried a few different things and this was the closest that I got:

image: node:4.6.0

    - step:
           - node
        script: # Modify the commands below to build your repository.
          - npm install -g browserify
          - browserify src/main.js -o bundle.js
          - git config **email**
          - git checkout -b temp
          - git remote add dist https://**username**:$
          - git add bundle.js
          - git add index.html
          - git add style.css
          - git commit -m "build [skip ci]"
          - git push dist master --force

 (I've removed my username and email to post it here)


Any help is greatly appreciated as I'm very new to this.

Peter Plewa Atlassian Team Aug 19, 2018

Hey @alexclifton4

Try removing bundle.js entry from your .gitignore file.




It wasn't in my .gitignore file, but I've now changed my workflow so that I no longer need to do this.

Thank you for your help anyway!



Hey did you ever get this working? Trying to do something similar. 


I have repo A, I make a commit. I create a patch file of the last commit and I want to apply that patch to another repo in BitBucket, repo B.

I never did I’m afraid - this was for a project I was working on a while ago

If you want to push from REPO-A to REPO-B, first import your SSH keys (or create another user who have write access to REPO-B) to the SSH keys section of REPO-A repository settings.

Then you can add lines like this in your bitbucket-piplelines.yml file:

- date > test.txt
- apt-get update
- apt install --assume-yes --no-install-recommends git openssh-client
- git config --global bitbucket-pipelines
- git config --global
- git clone
- cp test.txt REPO-B
- cd REPO-B
- git add -A
- git commit -m "Added new version of test.txt at $(date)"
- git push

Thanks for your reply - this was a while ago so I no longer need this, but hopefully it’ll be useful for someone else :)

Like # people like this

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

270 views 2 10
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