Re: Workflow and ArtifactArchiver?

2015-01-15 Thread Les Mikesell
On Thu, Jan 15, 2015 at 2:06 PM, Jesse Glick  wrote:
> On Thursday, January 8, 2015 at 4:06:34 PM UTC-5, LesMikesell wrote:
>>
>> b1=build( "some_job")
>> b2=build( "some_other_job", REVISION:
>> b1.build.properties.envVars["SVN_REVISION"] )
>> (where REVISION is a job parameter, expanded in the svn URL)
>
>
> Well you can certainly expand variables in the ‘url’ passed to an ‘svn’ step
> in Workflow. As I mentioned, there is not yet support for picking up
> $SVN_REVISION after an initial checkout (would require API changes in
> Jenkins core, followed by matching changes in the Subversion plugin; or a
> new feature in Workflow to use scm-api-plugin); but at worst you can run
> ‘svn info’ to get this in the meantime.
>
> (Whether it will correctly detect the checkout as being of the same
> repository from build to build, despite having a different @123 in the URL,
> is another question. This is up to SubversionSCM.getKey.)

Not sure what you mean here - the @123 would be the revision, and
being able to specify it is absolutely necessary if you want to be
sure different operations are working with the same code versions.
Does this need yet another way to control whether you do updates,
clean checkouts, or revert, then update when you have an existing
workspace?

> As a separate matter, for those flows which _do_ wish to continue using the
> ‘build’ step rather than inlining all steps directly into the flow, it would
> be useful to be able to pick up build variables from the downstream
> freestyle build. I made a note of that in JENKINS-25851.

I guess I don't understand the disconnect between build_flow and
workflow operations.

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


Re: Workflow and ArtifactArchiver?

2015-01-15 Thread Jesse Glick
On Thursday, January 8, 2015 at 4:06:34 PM UTC-5, LesMikesell wrote:
>
> b1=build( "some_job") 
> b2=build( "some_other_job", REVISION: 
> b1.build.properties.envVars["SVN_REVISION"] ) 
> (where REVISION is a job parameter, expanded in the svn URL) 
>

Well you can certainly expand variables in the ‘url’ passed to an ‘svn’ 
step in Workflow. As I mentioned, there is not yet support for picking up 
$SVN_REVISION after an initial checkout (would require API changes in 
Jenkins core, followed by matching changes in the Subversion plugin; or a 
new feature in Workflow to use scm-api-plugin); but at worst you can run 
‘svn info’ to get this in the meantime.

(Whether it will correctly detect the checkout as being of the same 
repository from build to build, despite having a different @123 in the URL, 
is another question. This is up to SubversionSCM.getKey.)

As a separate matter, for those flows which _do_ wish to continue using the 
‘build’ step rather than inlining all steps directly into the flow, it 
would be useful to be able to pick up build variables from the downstream 
freestyle build. I made a note of that in JENKINS-25851.

-- 
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/3ada0a6c-e77b-4bd7-81c4-a5c678332e57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2015-01-08 Thread Les Mikesell
On Thu, Jan 8, 2015 at 2:37 PM, Jesse Glick  wrote:
>>
>> Does this have to be different from build-flow where you could pick up
>> SVN_REVISION and pass it into subsequent builds
>
>
> I am not very familiar with the build-flow plugin and have not heard of such
> an idiom. subversion-plugin *sets* $SVN_REVISION on the current build but
> does not automatically check out that revision if such a variable is set
> ahead of time.

With build-flow you pretty much have to create separate jenkins jobs
for each step which is klunky in some ways but it lets you pass
parameters and subsequently access data from other build objects:

b1=build( "some_job")
b2=build( "some_other_job", REVISION:
b1.build.properties.envVars["SVN_REVISION"] )
(where REVISION is a job parameter, expanded in the svn URL)
and then you could run yet another job, passing those build numbers to
b3=build( "my_artcollector_job", REVISION:
b1.build.properties.envVars["SVN_REVISION"], BUILD_SELECTOR1:
b1.build.number, BUILD_SELECTOR2: b2.build.number )
And those parameters are expanded for the copy artifact plugin to
assemble the layout you want, with the final job archiving the include
tree from its own svn checkout and the binaries copied from the
previous build jobs.

>
> In the meantime, as a workaround you could run ‘svn info’ on the master
> workspace to determine the current revision, keep this in a Groovy variable,
> and update slave workspaces to that.

I think the big picture is that if we want to eliminate the klunky
separate job definitions for every step we need a generic mechanism to
replace what you can pass into parameterized jobs and get back from
the build objects.  Or does that already exist?   In this scenario I'm
looking for something like a matrix build but more programatically
controlled and with a different final layout for the build artifacts.

-- 
   Les Mikesell
 lesmikes...@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/CAOAgVpzaa-%3DCKD3NmN3ZLJO6bZpS3ymzK9hUdm7CKXOz9TgcVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2015-01-08 Thread Jesse Glick
On Thursday, January 8, 2015 at 12:38:30 PM UTC-5, LesMikesell wrote:
>
> Does this have to be different from build-flow where you could pick up 
> SVN_REVISION and pass it into subsequent builds
>

I am not very familiar with the build-flow plugin and have not heard of 
such an idiom. subversion-plugin *sets* $SVN_REVISION on the current build 
but does not automatically check out that revision if such a variable is 
set ahead of time.

https://issues.jenkins-ci.org/browse/JENKINS-24141 notes that the current 
Jenkins core API does not permit an SCM to define environment variables 
(such as $SVN_REVISION) in a workflow. If that were changed, it would be 
one possible solution to JENKINS-26100 (for example you could access 
env.SVN_REVISION 
after checkout). But there is another possible solution that I think may be 
more attractive, using scm-api. Still TBD.

In the meantime, as a workaround you could run ‘svn info’ on the master 
workspace to determine the current revision, keep this in a Groovy 
variable, and update slave workspaces to that.

-- 
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/4962dca7-143a-4c76-98e3-f4d72bb25919%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2015-01-08 Thread Les Mikesell
On Thu, Jan 8, 2015 at 9:43 AM, Jesse Glick  wrote:
> On Wednesday, January 7, 2015 7:16:10 PM UTC-5, LesMikesell wrote:
>>
>> A likely scenario would be to trigger a build from polling svn, then
>> building that same svn revision on several types of nodes - even if
>> subsequent commits are done to the repository
>
>
> Covered by: https://issues.jenkins-ci.org/browse/JENKINS-26100
>

Does this have to be different from build-flow where you could pick up
SVN_REVISION and pass it into subsequent builds and picking up those
build numbers from the respective build objects for the eventual
aggregation of the artifacts into the layout you want?

I was sort-of hoping that workflow would have the same capabilities
but maintain the master job workspace to track scm polling and collect
artifacts, and permit more arbitrary groovy operations.

-- 
   Les Mikesell
 lesmikes...@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/CAOAgVpzgFkSk1YfYp6o%3D2qjv5xfEyyPXsQmcgsaRTSKzr3AXtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2015-01-08 Thread Jesse Glick
On Wednesday, January 7, 2015 7:16:10 PM UTC-5, LesMikesell wrote:
>
> A likely scenario would be to trigger a build from polling svn, then 
> building that same svn revision on several types of nodes - even if 
> subsequent commits are done to the repository
>

Covered by: https://issues.jenkins-ci.org/browse/JENKINS-26100 

-- 
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/ca42315a-36b7-42fd-84d4-158841127173%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2015-01-07 Thread Les Mikesell
On Wed, Jan 7, 2015 at 6:01 PM, Jesse Glick  wrote:
> On Friday, December 19, 2014 1:06:56 PM UTC-5, LesMikesell wrote:
>>
>> Is there a way to make [unartifact] address artifacts from build
>> (other_job) steps
>
>
> https://issues.jenkins-ci.org/browse/JENKINS-24887
>
>>
>> or track their svn revisions and build numbers?
>
>
> Not quite sure what you are getting at here.

A likely scenario would be to trigger a build from polling svn, then
building that same svn revision on several types of nodes - even if
subsequent commits are done to the repository, then pulling all the
build artifacts for that revision into the parent job's artifact
archive on the master - so from the one jenkins job page.you could
grab binaries built on all the different node types and ensure that
they were built from the same source.   For library components you
might construct an include tree along with the binaries for different
architectures.

-- 
   Les Mikesell
 lesmikes...@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/CAOAgVpx4bYnCeK8Ju5FqHx2gDL8gy6jWtzL-7Bdj994_9yvb6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2015-01-07 Thread Jesse Glick
On Friday, December 19, 2014 1:06:56 PM UTC-5, LesMikesell wrote:
>
> Is there a way to make [unartifact] address artifacts from build 
> (other_job) steps


https://issues.jenkins-ci.org/browse/JENKINS-24887
 

> or track their svn revisions and build numbers?
>

Not quite sure what you are getting at here.

Does the snippet generator only deal with the workflow [DSL] functions?
>

Maybe I am not understanding the question, but: the snippet generator 
offers all Workflow steps defined in any loaded plugin.
 

> I'm still fairly confused about how workflow relates to other plugins


https://github.com/jenkinsci/workflow-plugin/blob/master/COMPATIBILITY.md
 

> how to pass things among them
>

In general you can just use Groovy local variables to carry information 
around in a script, with ‘readFile’/‘writeFile’ as needed to deal with 
files in the workspace and so on. 
(https://issues.jenkins-ci.org/browse/JENKINS-26133 would be a helpful 
addition.)

-- 
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/4533f70f-1123-434c-9388-00a65fe01483%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2014-12-19 Thread Les Mikesell
On Fri, Dec 19, 2014 at 10:56 AM, James Nord  wrote:
>
>>> Also, is there a way for subsequent node{} operations to
>>> retrieve the artifacts already archived by previous other nodes within
>>> the same workflow build?
>>>
>>
>> unarchive is your friend.
>>   - although that name does make it sound like you are removing an
>> artifact from the list that will be archived rather than retrieving a copy.
>
>
> For future reference this is in the tutorial
>
> https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md#multiple-threads

Thanks - now I see that the Snippet Generator shows it too - at least
if you already knew what you were looking for. Is there a way to make
it address artifacts from build(other_job) steps or track their svn
revisions and build numbers?

Does the snippet generator only deal with the workflow DLS functions?
 I'm still fairly confused about how workflow relates to other
plugins, what things are global from the top level, what runs on the
node, and how to pass things among them (and likewise with external
processes).

-- 
   Les Mikesell
lesmikes...@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/CAOAgVpz%3DP0NFR9gs_51%2BxZx3H4%2BoSWbUwKHnW9kUdqf7P2p-oQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2014-12-19 Thread James Nord

On 19/12/2014 16:53, James Nord wrote:

On 19/12/2014 16:47, Les Mikesell wrote:

If I create a workflow with multiple node {}  operations and have
step([$class: 'ArtifactArchiver', artifacts:
'**/something/*.something', fingerprint: true])
inside more than one, what is supposed to happen to duplicates?


No idea - I suggest a suck it and see and let everyone know :)


I suppose I should try this myself instead of asking, but I haven't
gotten that far yet and it does seem like something that should be
documented.   Also, is there a way for subsequent node{} operations to
retrieve the artifacts already archived by previous other nodes within
the same workflow build?



unarchive is your friend.
  - although that name does make it sound like you are removing an 
artifact from the list that will be archived rather than retrieving a 
copy. 


For future reference this is in the tutorial
 
https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md#multiple-threads

--
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/549458BC.3040101%40teilo.net.
For more options, visit https://groups.google.com/d/optout.


Re: Workflow and ArtifactArchiver?

2014-12-19 Thread James Nord

On 19/12/2014 16:47, Les Mikesell wrote:

If I create a workflow with multiple node {}  operations and have
step([$class: 'ArtifactArchiver', artifacts:
'**/something/*.something', fingerprint: true])
inside more than one, what is supposed to happen to duplicates?


No idea - I suggest a suck it and see and let everyone know :)


I suppose I should try this myself instead of asking, but I haven't
gotten that far yet and it does seem like something that should be
documented.   Also, is there a way for subsequent node{} operations to
retrieve the artifacts already archived by previous other nodes within
the same workflow build?



unarchive is your friend.
  - although that name does make it sound like you are removing an 
artifact from the list that will be archived rather than retrieving a copy.


/James

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