Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 299470

Summary: Hudson build scripts output differences
Product: Community Reporter: Bouchet Stéphane <sbouchet>
Component: CI-JenkinsAssignee: CI Admin Inbox <ci.admin-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: d_a_carver
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Sample Build Script that keeps only latest N build, not all
none
Build script that keeps buildtype for promote, and only the latest none

Description Bouchet Stéphane CLA 2010-01-13 05:12:49 EST
Hi,

i moved the EEF nightly builds from Bach to Ant in order to have the "-incubation" flag on each generated artifacts ( zip, md5 ...) .

i followed http://wiki.eclipse.org/Common_Build_Infrastructure/Getting_Started/Build_In_Hudson/Ant_Script and http://wiki.eclipse.org/Common_Build_Infrastructure/Getting_Started/Build_In_Hudson/Ant_Job .

Everything is working great, except that the builds keeps old N artifacts over new builds. 

See : https://build.eclipse.org/hudson/view/Modeling/job/cbi-emf-eef-0.7-nightly/ws/build/

with bash script, only the current build was kept.
Comment 1 David Carver CLA 2010-01-13 12:16:50 EST
Created attachment 156010 [details]
Sample Build Script that keeps only latest N build, not all

I made some modifications to the default build.xml when running from ANT.  

The buildDir property now gets set to athena:

<property name="buildDir" value="${writableBuildRoot}/athena" />

I then added a new target called init:

	<target name="init">
		<delete dir="${buildDir}" failonerror="false"/>
	</target>

Then the run target has a dependency on init:

<target name="run" depends="init">

So what happens is that when the build executes, it will delete the Athena directory, and anything stored under it.  But it will keep the Third Party downloads and the dependency download directories.

You will want to do a clean workspace to start off with, and setup your Archive steps to make sure they get the correct files from the new location in your build configuration in hudson as well.

I've attached a sample that I use with wtp's xsl build.
Comment 2 Bouchet Stéphane CLA 2010-01-14 08:45:13 EST
Dave, 

it is working now, thank you.

i made a little modifiaction on the wiki to be sure people will not forget to modify their relang build script.
Comment 3 Bouchet Stéphane CLA 2010-01-15 05:58:39 EST
Hi,

i am reponing this because the promote script does not work since my modification.

This is due to the fact the build zip i got from hudson does not contain anymore a Nxxxx directory but a athena dir . 

the promote script from dash is based on the build type so it no longer works...

can it be possible to modify the build script to set the build dir to N or I or ... and not athena AND clean the worksapce before build ?
Comment 4 Bouchet Stéphane CLA 2010-01-15 09:26:56 EST
Created attachment 156225 [details]
Build script that keeps buildtype for promote, and only the latest

I made some modification to the build.xml to revert to default script, but keeps only one buildDir. 

i try this with promote script and will close if i succeed
Comment 5 David Carver CLA 2010-01-15 11:42:23 EST
Yes, you can keep the existing behavior, the reason I put the athena directory, is that it doesn't make the build script have to redownload all the dependencies everytime it runs.  Currently I don't use the promote script as in WTP we have a separate build and process for handling that.
Comment 6 Bouchet Stéphane CLA 2010-01-15 11:52:13 EST
(In reply to comment #5)
> Yes, you can keep the existing behavior, the reason I put the athena directory,
> is that it doesn't make the build script have to redownload all the
> dependencies everytime it runs.  Currently I don't use the promote script as in
> WTP we have a separate build and process for handling that.

The current build.xml deletes only the buildDir, and works with the promote build