Quantcast

How to include post build steps before archiving artifacts

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to include post build steps before archiving artifacts

Tony P
Archiving artifacts is almost what I want except when it comes to
failed builds.

My problem is that I have a diagnostic directoy where I keep various
logs and diagnostic info. This is particularly important when a build
fails and we are trying to figure out what went wrong.

As far as I can tell archiving artifacts happens immediately after a
build. So if a build fails there is no opportunity to massage the
artifacts.

It would be really great if the artifact process could happen AFTER
the post-build steps. Alternatively is there some process or step I
can use between build failure and archiving.
Bap
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to include post build steps before archiving artifacts

Bap
Quoting Tony P <[hidden email]>:

> Archiving artifacts is almost what I want except when it comes to
> failed builds.
>
> My problem is that I have a diagnostic directoy where I keep various
> logs and diagnostic info. This is particularly important when a build
> fails and we are trying to figure out what went wrong.
>
> As far as I can tell archiving artifacts happens immediately after a
> build. So if a build fails there is no opportunity to massage the
> artifacts.
>
> It would be really great if the artifact process could happen AFTER
> the post-build steps. Alternatively is there some process or step I
> can use between build failure and archiving.

Hi Tony,
Have a look at [Flexible Publish Plugin][1] which will enable you to  
position the post-build steps in the order that you want.
In addition, it will give you the ability to only run the actions when  
certain [Conditions][2] are met - such as the status of the build or  
files being available. (The File run conditions are in the most recent  
release and will take a little while to hit the update center)

Bap


[1]: https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin
[2]: https://wiki.jenkins-ci.org/display/JENKINS/Run+Condition+Plugin

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to include post build steps before archiving artifacts

Tony P
Bap,

Far as I can tell this plugin doesn't solve my problem.

Yes it allows some ordering of post build actions but is quite
restrictive and only applies to publishing tasks.

What I need is to be able to run some scripts, ant, vbs or similar
after a failed build but before archiving artifacts. Any other
suggestions are much appreciated.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to include post build steps before archiving artifacts

Gregory Boissinot
In reply to this post by Tony P
Tony,

Does your diagnostic directory have a specific location?
I'm asking you because you want to use 'Archive the artifacts' Jenkins feature where the location is not modifiable.


On Thu, Nov 10, 2011 at 7:55 PM, Tony P <[hidden email]> wrote:
Archiving artifacts is almost what I want except when it comes to
failed builds.

My problem is that I have a diagnostic directoy where I keep various
logs and diagnostic info. This is particularly important when a build
fails and we are trying to figure out what went wrong.

As far as I can tell archiving artifacts happens immediately after a
build. So if a build fails there is no opportunity to massage the
artifacts.

It would be really great if the artifact process could happen AFTER
the post-build steps. Alternatively is there some process or step I
can use between build failure and archiving.

Bap
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to include post build steps before archiving artifacts

Bap
In reply to this post by Tony P
Quoting Tony P <[hidden email]>:

> Bap,
>
> Far as I can tell this plugin doesn't solve my problem.
>
> Yes it allows some ordering of post build actions but is quite
> restrictive and only applies to publishing tasks.
>
> What I need is to be able to run some scripts, ant, vbs or similar
> after a failed build but before archiving artifacts. Any other
> suggestions are much appreciated.
>
> Thanks

Tony,

Try this one :-) [Any Build Step Plugin][1]

It has only just been released so will take a while to get to the  
update centres.
Hope this does it for you.
Bap.

[1]: https://wiki.jenkins-ci.org/display/JENKINS/Any+Build+Step+Plugin

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to include post build steps before archiving artifacts

Tony P
Bap,

I tried the "Any Build" plugin but can't see it anywhere in either the
global config or the job config. Can you give me some more detail
about how to set this up. I have just updated to 1.438.

In regards to Georges question about if the diagnostic directory is
static. Yes it is static but after a failed build I would want to move
more content into it and also after a failed build I need to delete
any password info in some of the diagnostic files before archiving.

Cheers
Bap
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to include post build steps before archiving artifacts

Bap
Quoting Tony P <[hidden email]>:

> Bap,
>
> I tried the "Any Build" plugin but can't see it anywhere in either the
> global config or the job config. Can you give me some more detail
> about how to set this up. I have just updated to 1.438.

The Any Build Step Plugin enables options in Flexible publish and  
Conditional buildstep sections of the global config (Manage Jenkins ->  
Configure System)
In the Flexible publish section, select "Any build step" for the  
"Allowed build steps", then when you configure the Flexible publish,  
you should be able to select Builders for the Action.

Let me know how you get on.
Cheers,
Bap.

>
> In regards to Georges question about if the diagnostic directory is
> static. Yes it is static but after a failed build I would want to move
> more content into it and also after a failed build I need to delete
> any password info in some of the diagnostic files before archiving.
>
> Cheers



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to include post build steps before archiving artifacts

Tony P
Bap,

I thought I had replied to your post, but obviously I didn't :-(

I couldn't see Flexible Publish in the configuration section of
Jenkins. However when I reviewed my plugins I saw that there was an
update for Flexible publish from 0.2 to 0.7 I believe. A little
strange given I am sure I updated the plugins just the other day.

Anyways now I can see all the stuff you talked about so I will give it
a shot.

Thanks
Loading...