Re: [workflow] Git step to check out a commit instead of a branch

2016-03-20 Thread 'Björn Pedersen' via Jenkins Users
Hi,

you could install gerrit-trigger-plugin (you do not need to use gerrit for 
your use-case) and use the gerrit-trigger checkout strategy that can 
use  hashes/tags/etc...

Björn

Am Mittwoch, 25. März 2015 15:26:37 UTC+1 schrieb Lóránt Pintér:
>
> Hi,
>
> Is it possible to check out a particular commit hash, instead of a branch 
> with the git workflow step?
>
> Thanks,
> Lorant
>

-- 
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/2f47b34b-3d3d-4a4f-b6f6-df4d92b4a5a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow] Git step to check out a commit instead of a branch

2016-03-19 Thread Simone Vratogna
I did, but to me it doesn't work, it checks out anyway the next branch... :(

On Fri, Mar 18, 2016 at 8:58 AM, Baptiste Mathus  wrote:

> Did you try using the generic SCM way as proposed by Jesse?
> Le 17 mars 2016 4:51 PM, "Simone Vratogna"  a écrit :
>
>> Hello, I'm interested as well. Did you find any solution?
>>
>> On Wednesday, March 25, 2015 at 3:26:37 PM UTC+1, Lóránt Pintér wrote:
>>>
>>> Hi,
>>>
>>> Is it possible to check out a particular commit hash, instead of a
>>> branch with the git workflow step?
>>>
>>> Thanks,
>>> Lorant
>>>
>> --
>> 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/ff3a7df7-73e4-4ad0-923b-67cc53917664%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/M3tDkHYFfWo/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/CANWgJS5GJLNw5k_G1D1dsRhwgz17msLfJP08tadFfnkGdDV1iQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAN37iofovhF6%3DTw1D4DvfeQmGQsuJxy3uCW5gMYE%2B5oq6UYurw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow] Git step to check out a commit instead of a branch

2016-03-19 Thread Simone Vratogna
Hello, I'm interested as well. Did you find any solution?

On Wednesday, March 25, 2015 at 3:26:37 PM UTC+1, Lóránt Pintér wrote:
>
> Hi,
>
> Is it possible to check out a particular commit hash, instead of a branch 
> with the git workflow step?
>
> Thanks,
> Lorant
>

-- 
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/ff3a7df7-73e4-4ad0-923b-67cc53917664%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow] Git step to check out a commit instead of a branch

2016-03-18 Thread Baptiste Mathus
Now thinking about it, another solution is to just use the plain git CLI.
(Requires git on the path, note)

*def theSha = ""*
*sh "git checkout $theSha"*

*// here you go*


2016-03-18 9:12 GMT+00:00 'Björn Pedersen' via Jenkins Users <
jenkinsci-users@googlegroups.com>:

> Hi,
>
> you could install gerrit-trigger-plugin (you do not need to use gerrit for
> your use-case) and use the gerrit-trigger checkout strategy that can
> use  hashes/tags/etc...
>
> Björn
>
> Am Mittwoch, 25. März 2015 15:26:37 UTC+1 schrieb Lóránt Pintér:
>>
>> Hi,
>>
>> Is it possible to check out a particular commit hash, instead of a branch
>> with the git workflow step?
>>
>> Thanks,
>> Lorant
>>
> --
> 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/2f47b34b-3d3d-4a4f-b6f6-df4d92b4a5a6%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CANWgJS4HMFa9anD6WHygSURsRZZNWU_RfwC3cj24chvOQJYYuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow] Git step to check out a commit instead of a branch

2015-08-12 Thread Jesse Glick
On Wednesday, June 17, 2015 at 2:53:25 PM UTC-4, Stephan Stachurski wrote:

 using our conventional jenkins pipeline, we have been burned in the past 
 when the head of a branch changed between the start and end of the pipeline.


If using a multibranch workflow (currently in beta), you just say `checkout 
scm` to get a consistent commit anywhere within the build. 

-- 
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/125283f3-ddc7-4b60-ac3f-6e4bd79ce8d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow] Git step to check out a commit instead of a branch

2015-06-17 Thread Stephan Stachurski
I would really like to figure this out. Haven't transitioned to workflow 
yet, but using our conventional jenkins pipeline, we have been burned in 
the past when the head of a branch changed between the start and end of the 
pipeline.

On Tuesday, June 16, 2015 at 2:50:37 PM UTC-4, Jesse Glick wrote:

 On Wednesday, March 25, 2015 at 10:26:37 AM UTC-4, Lóránt Pintér wrote:

 Is it possible to check out a particular commit hash, instead of a branch 
 with the git workflow step?


 No, but it should be possible with some exotic options to GitSCM, run via 
 the generic checkout step. 


-- 
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/3d535000-1fa2-44a7-b01d-1cced9634cd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow] Git step to check out a commit instead of a branch

2015-06-16 Thread Jesse Glick
On Wednesday, March 25, 2015 at 10:26:37 AM UTC-4, Lóránt Pintér wrote:

 Is it possible to check out a particular commit hash, instead of a branch 
 with the git workflow step?


No, but it should be possible with some exotic options to GitSCM, run via 
the generic checkout step. 

-- 
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/29353c54-d805-4666-a509-4dc1246c65a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [workflow] Git step to check out a commit instead of a branch

2015-03-29 Thread Lóránt Pintér
I tried, but it results in weird errors about no commit being found to build:





Running: Git

  git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository

  git config remote.origin.url g...@github.com:prezi/boxfish-text-editor.git # 
timeout=10

Fetching upstream changes from g...@github.com:prezi/boxfish-text-editor.git

  git --version # timeout=10

  git -c core.askpass=true fetch --tags --progress 
g...@github.com:prezi/boxfish-text-editor.git 
+refs/heads/*:refs/remotes/origin/*

  git rev-parse refs/remotes/origin/2.0^{commit} # timeout=10

  git rev-parse refs/remotes/origin/origin/2.0^{commit} # timeout=10

  git rev-parse origin/2.0^{commit} # timeout=10

Running: Allocate workspace : Body : End

Running: Allocate workspace : End

Running: Allocate node : Body : End

Running: Allocate node : End

Running: Mail

Running: Print Message

Error in boxfish-text-editor: Author: Unknown Author boxfish...@prezi.com




hudson.AbortException: Couldn't find any revision to build. Verify the 
repository and branch configuration for this job.

at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:918)

at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1017)

at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:106)

at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)

at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:70)

at 
org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:34)

at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:136)

at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:100)

at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)

at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)

at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)

at 
com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)

at Script1.run(Script1.groovy:14)

at Unknown.Unknown(Unknown)

at ___cps.transform___(Native Method)

at 
com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)

at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)

at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:76)

at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)

at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)

at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)

at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)

at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)

at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)

at 
com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:33)

at 
com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)

at 
com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:22)

at 
com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)

at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)

at com.cloudbees.groovy.cps.Next.step(Next.java:58)

at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145)

at 
org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)

at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:268)

at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71)

at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:177)

at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:175)

at 
org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at 

Re: [workflow] Git step to check out a commit instead of a branch

2015-03-28 Thread Baptiste Mathus
Just a wild guess: since in Git branch names are actually not very special
things, which in the end get translated to the associated sha1, did you
just try to put branch: 'abc123' e.g. ?

2015-03-25 15:26 GMT+01:00 Lóránt Pintér lorant.pin...@gmail.com:

 Hi,

 Is it possible to check out a particular commit hash, instead of a branch
 with the git workflow step?

 Thanks,
 Lorant

 --
 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/c99f109f-8d16-44a4-b480-d6d3de2c6f7a%40googlegroups.com
 https://groups.google.com/d/msgid/jenkinsci-users/c99f109f-8d16-44a4-b480-d6d3de2c6f7a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
Baptiste Batmat MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

-- 
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/CANWgJS6X58xzLEy23-iaxMU%2Bny7Z0mO%3D16_3sar_z_2exk2gsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.