Missed Team ’24? Catch up on announcements here.

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

Hello i want to push file from jenkins job (i've creted bitbucket repo add user with public key)

Dragiša Jevtović October 10, 2018
Jenkins is instaled localy on windows machine. I am using bitbucket plugin for jenkins)

2 answers

1 accepted

0 votes
Answer accepted
Dragiša Jevtović October 10, 2018

You mean because plugin left me in the detach head status i need first to do checkout and after that all git commands?

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 10, 2018

Correct, so you need to checkout the branch first before making any changes in the work space.

Dragiša Jevtović October 10, 2018

I will try that tomorrow and inform you after

Thanks in advance

0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 10, 2018

Welcome to the Atlassian Community.

You can use the standard git push command to push changes done by your Jenkins job back to the repository in Bitbucket.

Dragiša Jevtović October 10, 2018

After plugin had finished ferching repo in part of windows batch i created txt file. Git add pass git commit pass bit when i want to push simpy with git push i got error ( to use git push origin HEAD:name of the branch.).

I've changed job and put this command and jenkoms job never finish executing this comand. I have to abort job.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 10, 2018

What happens if you change the push command to git push origin HEAD or git push origin <name of the current branch>?

Dragiša Jevtović October 10, 2018

Job tried to execute command but never finish( infinitive loop ) so i had to abort job to exit.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 10, 2018

Also, are you checking out the branch in question as part of your script? If not then you first have to checkout the branch before making any changes, Jenkins will by default checkout a commit.

Dragiša Jevtović October 10, 2018

You mean because plugin left me in detach head i need to checkout first?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events