Seeking help for git command line steps when Git Repository is selected Under Source Code Management Section of Jenkins job configure

93 views
Skip to first unread message

sa_nk

unread,
Mar 31, 2015, 1:48:38 PM3/31/15
to jenkins...@googlegroups.com
Hi Team,
This is Sathya, I am new to Jenkins. I am not sure if similar to my question was already posted and answered. If it did please direct me to that answer else please see below my request.
 

I am looking for git command line steps that can be accomplished as alternative to the procedure used in Jenkins UI with Git plugin as below:
 

Under Source Code Management Section of Jenkin Job configure UI:
----------------------------------------------------------------
 

Git Repository: Repository URL (https://github.com/<path>)
                Credentials (Select credentials from globally defined)
 

Branches to build: Branch Specifier (blank for 'any') (*/Development)
 

Repository broswer: (Auto)
 

Additional Behaviors: Check out to specific local branch - Branch name (Development)
 
 
 
In the above all the values are mentioned in the extream right parenthesis. What I am looking for is equivakent git command line steps with options to perform exactly like above so that when ever I experience git plugin issues I can have alternate method of doing it. Couple of times we experienced git plugin issues as below (And end up bouncing the Jenkins and some times even bouncing Jenkins did not resolve):
 

FATAL: argument type mismatch
java.lang.IllegalArgumentException: argument type mismatch
 
 
 
Thanks in advance and your help is highly appreciated.
-Sathya. 
 

Mark Waite

unread,
Mar 31, 2015, 4:07:58 PM3/31/15
to jenkins...@googlegroups.com
When the git plugin is used for a job, the git commands used by the plugin are generally listed in the job output.  What you listed seems to be even prior to job execution, so there is no way for you to see what the git plugin is doing.

An argument type mismatch is surprising.  There are relatively few hits in a google search of Jenkins git IllegalArgumentException.  You'll need to provide more information before others can help you resolve the issue, since I doubt there are many others seeing the issue.

Some of the common information which can help with diagnosis is described at https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue .  The steps listed there "before you submit a bug report" are good helps for diagnosis.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8772bb4a-0dd7-4555-8d15-0d982f33ac39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite

sa_nk

unread,
Mar 31, 2015, 5:26:13 PM3/31/15
to jenkins...@googlegroups.com
Thanks Mark for your reply. I did look at the previous successful job output and compiled a script with following.

if [ ! -d .git ]; then git init; git status; else git status; fi # This is to ijnitialize git -> this step not seen in the job output when plugin used.
git rev-parse --is-inside-work-tree
git config remote.origin.url ${URL}
git config --local credential.helper store --file=~/.git-credentials
git fetch --tags --progress ${URL} +refs/heads/*:refs/remotes/origin/*
git config --local --remove-section credential
git rev-parse origin/${BNAME}^{commit}
#git config core.sparsecheckout
git checkout -f ${REVNO}
#git branch -a
#git branch -D ${BNAME}
git checkout -b ${BNAME} ${REVNO}

I had commented out some lines above which were giving some errors, except that I am able to checkout the contents, but in the git hub site I see below commands (The clone command does little bit diff from above steps which creates the parent folder in the workspace) :
git clone https://github.com/<pathToRepo>
git checkout develop

Though I see required files checked out from git, but I am skeptical to use if it breaks anything. So far I am playing around with test repository, soon I need to hook this to Development code. Can you please look into it and verify if those steps are good to go?

Thanks in advance. -Sathya.

Mark Waite

unread,
Mar 31, 2015, 5:51:34 PM3/31/15
to jenkins...@googlegroups.com
On Tue, Mar 31, 2015 at 3:26 PM, 'sa_nk' via Jenkins Users <jenkins...@googlegroups.com> wrote:
Thanks Mark for your reply. I did look at the previous successful job output and compiled a script with following.

if [ ! -d .git ]; then git init; git status; else git status; fi # This is to ijnitialize git -> this step not seen in the job output when plugin used.
git rev-parse --is-inside-work-tree
git config remote.origin.url ${URL}
git config --local credential.helper store --file=~/.git-credentials
git fetch --tags --progress ${URL} +refs/heads/*:refs/remotes/origin/*
git config --local --remove-section credential
git rev-parse origin/${BNAME}^{commit}
#git config core.sparsecheckout
git checkout -f ${REVNO}
#git branch -a
#git branch -D ${BNAME}
git checkout -b ${BNAME} ${REVNO}

I had commented out some lines above which were giving some errors, except that I am able to checkout the contents, but in the git hub site I see below commands (The clone command does little bit diff from above steps which creates the parent folder in the workspace) :
git clone https://github.com/<pathToRepo>
git checkout develop

Though I see required files checked out from git, but I am skeptical to use if it breaks anything. So far I am playing around with test repository, soon I need to hook this to Development code. Can you please look into it and verify if those steps are good to go?

Those steps seem reasonable to me.

I don't understand why you're implementing the steps of the git plugin in your build script.  If the git plugin doesn't work for you, then that may hint that there is something more seriously wrong with your Jenkins installation.  The git plugin is installed on over 50000 Jenkins instances and is used in many different ways by many different users.

What are the specific problems you've encountered which have prompted you to replace the steps of the git plugin with steps in your build script?

What versions of the git plugin and the git client plugin and the credentials plugin and the Jenkins server are you running?

What Java version is hosting the Jenkins instance, and what operating system?

Mark Waite
 

For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite

sa_nk

unread,
Mar 31, 2015, 6:28:53 PM3/31/15
to jenkins...@googlegroups.com
Thanks Mark,
Please find the environment details for the jenkins:
Jenkins ver: Jenkins ver. 1.509.1.1
Jenkins GIT client plugin: 1.9.1
Jenkins GIT plugin: 2.2.1
Git server plugin: 1.3

OS: Red Hat Enterprise Linux Server release 6.6 (Santiago)
git --version -> git version 2.2.0
Java version (master) -> java version "1.7.0_65"
Java version (slave where job configured with git plugin running, using java 1.8 for other requirements) -> java version "1.8.0_25"
Credentials plugin: 1.13

master and slave runs on same Linux level.
The reason we would like to go for command line options because of the error posted in my question at the top. It was working fine for long time and all of sudden popped up with that error and all of the jobs using the git plugin started failing. After couple of jenjkins restart it came back to normal. I googled it for the resolution and couldn't find any resolution for it. So thought of implementing the alternative procedure as command line options for the git plugin.

-Thanks, Sathya.

Mark Waite

unread,
Apr 1, 2015, 12:04:36 AM4/1/15
to jenkins...@googlegroups.com
On Tue, Mar 31, 2015 at 4:28 PM, 'sa_nk' via Jenkins Users <jenkins...@googlegroups.com> wrote:
Thanks Mark,
Please find the environment details for the jenkins:
Jenkins ver: Jenkins ver. 1.509.1.1
Jenkins GIT client plugin: 1.9.1
Jenkins GIT plugin: 2.2.1
Git server plugin: 1.3


Your Jenkins server version is almost two years older than the most recent long term support version.  It is the oldest version supported by git plugin 2.2 and the git client plugin.  I don't have any suggestion to offer you other than to consider installing a much more recent long term support version on a separate machine to see if it will resolve your issue.

Mark Waite
 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite

sa_nk

unread,
Apr 1, 2015, 12:16:09 PM4/1/15
to jenkins...@googlegroups.com
Jenkins upgrade was attempted few months back, during then while restarting Jenkins it was failing to start and due to criticality of availability it was backed out. We are going to try upgrade again shortly. Thanks for looking into it.

-Sathya.
 

On Tuesday, March 31, 2015 at 10:48:38 AM UTC-7, sa_nk wrote:

Mark Waite

unread,
Apr 1, 2015, 1:02:14 PM4/1/15
to jenkins...@googlegroups.com
With code that old, I wouldn't attempt an in-place upgrade until you've performed an upgrade on a separate instance that you configured just for upgrade testing.  Two years of evolution in Jenkins has introduced many changes.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite

sa_nk

unread,
Apr 1, 2015, 5:54:19 PM4/1/15
to jenkins...@googlegroups.com
Thanks Mark for valuable suggestion and inputs, sure we will build another instance with new version and test it out.

-Regards,
Sathya.

On Tuesday, March 31, 2015 at 10:48:38 AM UTC-7, sa_nk wrote:
Reply all
Reply to author
Forward
0 new messages