$ mkdir trader-stable.git $ cd trader-stable.git $ git init --bare Initialized empty Git repository in /Users/Shared/trader-stable.git/ $
Configuring automatic push by successfully build
TweetPosted on Sunday Mar 01, 2015 at 11:19PM in Jenkins
Making Jenkins to push to an another remote repository if build finishes successfully.
Recipe
-
Create a bare repository
-
Click
Add Repository
-
Enter
Repository URL
-
Click
Advanced…
-
Enter
stable
toName
-
Click
Add post-build action
⇒Git Publisher
-
Check
Push Only If Build Succeeds
-
Click
Add Tag
-
Enter
$BUILD_NUMBER
toTag to push
-
Check
Create new tag
-
Enter
stable
toTarget remote name
-
Click
Save
Test
$ pwd /Users/kyle/tmp/trader $ echo 'push if succeeds test' >> hi.txt $ git commit -am 'push if succeeds test' $ git push origin master
Jenkins said Pushing tag 8 to repo stable
$ git remote add stable /Users/Shared/trader-stable.git $ git fetch stable remote: Counting objects: 1, done. remote: Total 1 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (1/1), done. From /Users/Shared/trader-stable * [new tag] 8 -> 8 $
Good info! This is exactly what I needed as well. Does this push only tags or can it even push the whole repository? I tried several times and I see only tags on my second repository.
Posted by Srinivas on September 04, 2016 at 11:21 AM JST #
Hi,
What if my Tag name already exists and If I could see error like below.
> C:\Program Files (x86)\Git\bin\git.exe tag -l 9 # timeout=10
ERROR: Step ‘Git Publisher’ failed: Tag 9 already exists and Create Tag is specified, so failing.
Posted by Kalyan on January 31, 2017 at 02:27 PM JST #
So you are pushing to a local file system? Pushing to a remote server seems more helpful.
Posted by robert on April 15, 2017 at 06:32 AM JST #
Git publisher is not present in Jenkins v.2.176.1 or the git plugin v.3.10.1
Posted by Tom on July 10, 2019 at 10:19 PM JST #
Hi,
can you please help me to provide the process steps to publish the artifacts into GitHub server using Jenkins git publisher, Actually i am trying to push the artifacts into Azure local git not sure how to do it.
What would be the Target remote name? and where the git publisher will get the portal login details?
Posted by Madhu on November 12, 2019 at 02:48 PM JST #
Let See we are working on Multi pipeline project for CI-CD for one project we are using multiple repository.
Example : we have
1. one repository having data 'a' in A repository. its also store the Jenkins command.
2. second for some data 'b', store in B repository.
I am performing some addition between 'a' (A) and 'b' (B) let se output is 'c' .
now I wanted to push the expected output 'c' to the different repository C.
In (C) repository I already have some data. I don't want to create bare repository.
the error i was facing is
/jenkins/workspace/A@tmp/durable-ssasd/script.sh: 5: /jenkins/workspace/A@tmp/durable-ssasd/script.sh: git: not found
Posted by SANJEEV PRAJAPATI on January 13, 2020 at 04:43 PM JST #