Re: Git Plugin Checkout From Branch With Tag

2021-04-14 Thread eric.fetzer
Thamks Mark!  So how would I go about checking out a branch based on a point in 
time (a label in most systems)?  Is there a way to snap a label and then check 
out based on that label or are we resigned to only deal in tip revisions?Sent 
from my T-Mobile 4G LTE Device
 Original message From: Mark Waite  
Date: 4/14/21  1:44 PM  (GMT-05:00) To: Jenkins Users 
 Subject: Re: Git Plugin Checkout From Branch 
With Tag On Wed, Apr 14, 2021 at 10:22 AM Eric Fetzer  
wrote:Well if I don't tell it what branch to get, how will it get the right 
branch?  Sorry, Github is a paradigm shift for me.  I've been using StarTeam 
for 20 years and github for just a few weeks now...No problem.  Been through 
that paradigm shift.  Took a long time before the key git concepts finally 
registered.A git tag represents a specific commit.  A checkout of a tag does 
not need a branch.  In your case, you're asking for a branch and a tag.  The 
git plugin decided to give you the branch instead of the tag.  If you only ask 
for a tag, it will checkout the commit at that tag.Mark Waite On Wed, Apr 14, 
2021 at 10:13 AM Mark Waite  wrote:Don't use a 
branch parameter.  Place the tag name in the "Branches to build" field.  
Compare my screen shots and your screen shots.  You have more things in your 
job definition than I have in mine.  Those extra things are causing the 
behavior you're seeingOn Wed, Apr 14, 2021 at 8:32 AM Eric Fetzer 
 wrote:So I've tried to incorporate what you've said, 
Mark, but it still just clones the tip revision (9.9.9.10 in this case).  Here 
are my tags:git show-ref --tags -d4efbdb878c77557d050abbd228fc377adb9419b0 
refs/tags/1.0.0.1799eda70c5f052a6f8e757b044b3b60f704a705a 
refs/tags/1.0.0.1^{}c516e3681d2675d4e407b3c26ddfc7da0404c898 
refs/tags/1.0.0.240bf9dd858780d79facfb789921f53d673c08dc9 
refs/tags/1.0.0.2^{}9083515085949bfad75f028194226f5a9b1e5ecf 
refs/tags/9.9.9.1049b0f2cfbf93f36acf6b2124d589a64940eecf18 
refs/tags/9.9.9.10^{}019b3f3c634b9071c43f570a62c1191be05c0f4e 
refs/tags/9.9.9.9b2f49473794ad74af0e5943f9292e57e05938fbe 
refs/tags/9.9.9.9^{}I'm trying to get 9.9.9.9.  Here is my setup:It is honoring 
the branch specifier for branch, but not for tag.  I've tried it with just 
${tag_name} as well as with tags/${tag_name} as well as refs/tags/${tag_name}.  
What am i doing wrong?  Thanks!!!On Wed, Apr 14, 2021 at 8:06 AM Eric Fetzer 
 wrote:Thanks for the detailed description Mark!  Only 
one thing confuses me, I don't see you specifying the branch to build anywhere 
in there.  Can you explain that to me because I have to specify the branch as 
well as the tag?On Tue, Apr 13, 2021 at 7:42 PM Mark Waite 
 wrote:On Tue, Apr 13, 2021 at 5:57 PM eric.fetzer 
 wrote:I am SO sorry Mark, I confused this Jenkins 
thread with a totally unrelated support ticket.  I'm not using pipeline, just 
the git plug in in conjuction with git parameters.  What exactly do you mean by 
fetching the tags?I defined a Jenkins Freestyle job that fetches a specific tag 
and verifies within the job that the specific tag was fetched.  You can read 
the job definition if that helps.Crucial portions of the job definition 
included:Define the parameter for the tag to checkoutUse the parameter in the 
checkout as the local branch nameI believe the default behavior is to fetch 
tags, but I included it in the job definition as part of "Advanced clone 
behaviors" to be certain.I enabled "Honor refspec on initial clone" because 
that test repository is very large and I only wanted a specific branch in the 
clone.  You  probably won't need that option, though it does no harm to enable 
it.Mark Waite Sent from my T-Mobile 4G LTE Device Original message 
From: Mark Waite  Date: 4/13/21  7:29 PM  
(GMT-05:00) To: Jenkins Users  Subject: Re: 
Git Plugin Checkout From Branch With Tag As far as I can tell, you didn't 
provide the context of the old conversation.  The steps you've attempted and 
the context where you're trying those steps are not clear to me.  The comments 
that follow are my guesses of things that might help you.If you're using 
Jenkins Pipeline and want to checkout a tag in your parameterized job, you must 
use the 'checkout scm' step rather than the 'git' step.  The Pipeline snippet 
generator will help you generate the correct syntax for your desired checkout.  
There is a brief video included in the git plugin documentation that shows how 
to use the Pipeline snippet generator.  The git step documentation warns that 
'checkout' is the preferred step and that tag checkout is not supported with 
the git step.If you're using a Freestyle job, then you may need to check that 
you're fetching the tags and that the tag parameter you're providing is being 
placed in the "Branch to build" as a variable to be expanded.Mark WaiteOn 
Tuesd

Re: Git Plugin Checkout From Branch With Tag

2021-04-13 Thread eric.fetzer
I am SO sorry Mark, I confused this Jenkins thread with a totally unrelated 
support ticket.  I'm not using pipeline, just the git plug in in conjuction 
with git parameters.  What exactly do you mean by fetching the tags?Sent from 
my T-Mobile 4G LTE Device
 Original message From: Mark Waite  
Date: 4/13/21  7:29 PM  (GMT-05:00) To: Jenkins Users 
 Subject: Re: Git Plugin Checkout From Branch 
With Tag As far as I can tell, you didn't provide the context of the old 
conversation.  The steps you've attempted and the context where you're trying 
those steps are not clear to me.  The comments that follow are my guesses of 
things that might help you.If you're using Jenkins Pipeline and want to 
checkout a tag in your parameterized job, you must use the 'checkout scm' step 
rather than the 'git' step.  The Pipeline snippet generator will help you 
generate the correct syntax for your desired checkout.  There is a brief video 
included in the git plugin documentation that shows how to use the Pipeline 
snippet generator.  The git step documentation warns that 'checkout' is the 
preferred step and that tag checkout is not supported with the git step.If 
you're using a Freestyle job, then you may need to check that you're fetching 
the tags and that the tag parameter you're providing is being placed in the 
"Branch to build" as a variable to be expanded.Mark WaiteOn Tuesday, April 13, 
2021 at 1:21:39 PM UTC-6 eric@gmail.com wrote:Tried a bunch more stuff 
using Git Parameters:https://plugins.jenkins.io/git-parameter/Again, I can 
checkout from the branch, but not using the tag.  I set a git parameter for 
branch and then put it in the branch specifier and that worked.  I added 
another for tag, then put that in the same branch specifier after a space and 
got an error.  If I put it in an additional branch specifier, it seems to have 
gotten ignored.  Just got the tip revision from that branch.On Tue, Apr 13, 
2021 at 12:57 PM eric@gmail.com  wrote:OK, I think I've 
tried everything in this OLD conversation, but none of them work.  I have no 
issues checking out from a branch using branch specifier.  I've tried adding on 
to the specifier:  ${my_branch} tags/${my_tag}.  Have also added another branch 
and used this sort of thing (as well as every other way they said to do it in 
that thread).  Every way seems to just get the tip revision of all the files in 
that branch.  Does anyone have guidance of how to get this done?  Thanks!  Eric



-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-users/UGyBIx3pX9s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c045a834-8d68-46fe-8b72-860e89416209n%40googlegroups.com.





-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-users/UGyBIx3pX9s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/54da0d5e-e11e-4564-a7b4-c2a49f94efaan%40googlegroups.com.

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/60762fe0.1c69fb81.51b85.e697%40mx.google.com.


Re: GitHub Clone to Different Local Directory

2021-03-26 Thread eric.fetzer
Thanks Mark, I'll check it out.  Has to beat the hokey workaround I worked up.  
:)Sent from my T-Mobile 4G LTE Device
 Original message From: Mark Waite  
Date: 3/26/21  10:49 PM  (GMT-05:00) To: Jenkins Users 
 Subject: Re: GitHub Clone to Different Local 
Directory Good point.  How about the external workspace plugin from GSoC 2016?  
https://plugins.jenkins.io/external-workspace-manager/On Fri, Mar 26, 2021 at 
8:00 PM eric.fetzer  wrote:Thanks for the response 
Mark..  I'm using freestyle.  Doesn't checkout to a subdirectory only take 
relative paths?Sent from my T-Mobile 4G LTE Device Original message 
From: Mark Waite  Date: 3/26/21  6:44 PM  
(GMT-05:00) To: Jenkins Users  Subject: Re: 
GitHub Clone to Different Local Directory If you're using pipeline, change to 
that directory with the dir('/users/username/projectname') { } wrapper around 
the checkout step;If you're using a freestyle job, use the git plugin extension 
'checkout to a subdirectory'On Fri, Mar 26, 2021 at 10:54 AM eric@gmail.com 
 wrote:OK, so this is kind of complex so hang with me.  
We're moving from StarTeam to Github and I'm trying to reproduce what I'm doing 
in StarTeam with Github.  StarTeam was easy because I owned the repository 
machine as well as administrated the tool.  With Github, we're hosted.  So I'm 
admin on the project but can't create an RSA Token on the machine for easy 
access.  So I had to play around to make a personal access token work.  In 
order to make that access token work, I had to run the checkout job on a 
different node so that it was running as a user that lived in Github as well 
(access token's namesake).  So when this job gets called from the jenkins job, 
I want it to clone to the calling job's workspace 
(/opt/jenkins/workspace/).  Well since in order to authenticate, 
it lives in it's own shell, the workspace for this guy, and where it wants to 
clone to, is /home//.  All that for my question:  how 
can I specify what folder to checkout to?  I tried to use "checkout to specific 
local branch" but it fails saying "is not a valid branch name".  Well, yeah, 
branch is referring to branch not folder, lol.  In StarTeam this is easy, you 
just specify working folder.  Any help?  Thanks!



-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/128374b8-63d5-4b8c-86bb-5f214f5e68d2n%40googlegroups.com.




-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-users/Ob42FqU-0UY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtG6VTjt8F7Vj5pJW13VQJTfxCqRuZuDHjj5zZTa3jJ9%3Dg%40mail.gmail.com.




-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/605e9199.1c69fb81.932c2.d78c%40mx.google.com.




-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-users/Ob42FqU-0UY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHWfuOvLQubF%2BWHBoExHugTGd_FnmEvh2fHWPMNcH08ZQ%40mail.gmail.com.

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/605ea0fc.1c69fb81.fb3e3.5cbf%40mx.google.com.


Re: GitHub Clone to Different Local Directory

2021-03-26 Thread eric.fetzer
Thanks for the response Mark..  I'm using freestyle.  Doesn't checkout to a 
subdirectory only take relative paths?Sent from my T-Mobile 4G LTE Device
 Original message From: Mark Waite  
Date: 3/26/21  6:44 PM  (GMT-05:00) To: Jenkins Users 
 Subject: Re: GitHub Clone to Different Local 
Directory If you're using pipeline, change to that directory with the 
dir('/users/username/projectname') { } wrapper around the checkout step;If 
you're using a freestyle job, use the git plugin extension 'checkout to a 
subdirectory'On Fri, Mar 26, 2021 at 10:54 AM eric@gmail.com 
 wrote:OK, so this is kind of complex so hang with me.  
We're moving from StarTeam to Github and I'm trying to reproduce what I'm doing 
in StarTeam with Github.  StarTeam was easy because I owned the repository 
machine as well as administrated the tool.  With Github, we're hosted.  So I'm 
admin on the project but can't create an RSA Token on the machine for easy 
access.  So I had to play around to make a personal access token work.  In 
order to make that access token work, I had to run the checkout job on a 
different node so that it was running as a user that lived in Github as well 
(access token's namesake).  So when this job gets called from the jenkins job, 
I want it to clone to the calling job's workspace 
(/opt/jenkins/workspace/).  Well since in order to authenticate, 
it lives in it's own shell, the workspace for this guy, and where it wants to 
clone to, is /home//.  All that for my question:  how 
can I specify what folder to checkout to?  I tried to use "checkout to specific 
local branch" but it fails saying "is not a valid branch name".  Well, yeah, 
branch is referring to branch not folder, lol.  In StarTeam this is easy, you 
just specify working folder.  Any help?  Thanks!



-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/128374b8-63d5-4b8c-86bb-5f214f5e68d2n%40googlegroups.com.




-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-users/Ob42FqU-0UY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtG6VTjt8F7Vj5pJW13VQJTfxCqRuZuDHjj5zZTa3jJ9%3Dg%40mail.gmail.com.

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/605e9199.1c69fb81.932c2.d78c%40mx.google.com.