Accessing archived artifacts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
mmr
Reply | Threaded
Open this post in threaded view
|

Accessing archived artifacts

mmr
Is there a way for a build to access the archived artifacts of a
previous build? (using the 'archive artifacts' post build action)

Thank you

--
Marcio Ribeiro

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Accessing archived artifacts

Sami Tikka
2009/6/14 Marcio Ribeiro <[hidden email]>:
> Is there a way for a build to access the archived artifacts of a
> previous build? (using the 'archive artifacts' post build action)

Yes, by downloading the artifacts using previous build's permalinks,
which you can find on the web page Hudson creates for each build.
There are also links which do not require you to know the build
number, like lastSuccessfulBuild and lastStableBuild.

-- Sami

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

mmr
Reply | Threaded
Open this post in threaded view
|

Re: Accessing archived artifacts

mmr
Links? I am not sure what do you mean. I am in a shell script build step...

On Sun, Jun 14, 2009 at 5:28 PM, Sami Tikka<[hidden email]> wrote:

> 2009/6/14 Marcio Ribeiro <[hidden email]>:
>> Is there a way for a build to access the archived artifacts of a
>> previous build? (using the 'archive artifacts' post build action)
>
> Yes, by downloading the artifacts using previous build's permalinks,
> which you can find on the web page Hudson creates for each build.
> There are also links which do not require you to know the build
> number, like lastSuccessfulBuild and lastStableBuild.
>
> -- Sami
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
Marcio Ribeiro

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

mmr
Reply | Threaded
Open this post in threaded view
|

Re: Accessing archived artifacts

mmr
My build have this 'Execute Shell' command:
mvn foo:bar -DoutputFile=out.txt

Where foo:bar is a maven plugin I wrote that does some processing and
writes to outputFile.
Then I added a post build action 'archive artifacts' to save out.txt
in this build.

I want to compare the current build out.txt with the previous build
out.txt and see what is different. That is all.

What I did:
Added another 'Execute Shell' command to build (after the mvn foo:bar)
that does this:
cd ../builds
i=$(( ${BUILD_NUMBER} - 1 ))
while [ ! -d $i  ]; do
  i=$(( $i - 1 ))
done

if [ $i -eq 0 ]; then
  echo No previous build found, aborting
  return
fi

cur=../workspace/${JOB_NAME}/out.txt
prev=$i/archive/${JOB_NAME}/out.txt

echo "CUR=$cur, PREV=$prev"
diff -Naur $cur $prev > diff.txt


I want to archive diff.txt as well.

On Sun, Jun 14, 2009 at 5:48 PM, Marcio Ribeiro<[hidden email]> wrote:

> Links? I am not sure what do you mean. I am in a shell script build step...
>
> On Sun, Jun 14, 2009 at 5:28 PM, Sami Tikka<[hidden email]> wrote:
>> 2009/6/14 Marcio Ribeiro <[hidden email]>:
>>> Is there a way for a build to access the archived artifacts of a
>>> previous build? (using the 'archive artifacts' post build action)
>>
>> Yes, by downloading the artifacts using previous build's permalinks,
>> which you can find on the web page Hudson creates for each build.
>> There are also links which do not require you to know the build
>> number, like lastSuccessfulBuild and lastStableBuild.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> --
> Marcio Ribeiro
>



--
Marcio Ribeiro

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Accessing archived artifacts

Sami Tikka
In reply to this post by mmr
With "links", I meant URLs. If JobA makes ArtifactA, then JobB can
download it in a shell script build step with a command like this:

wget http://YOURHUDSON/job/JobA/lastSuccessfulBuild/artifact/ArtifactA

Replace "wget" with "curl -O" if you are on OS X. You may also want to
replace "lastSuccessfulBuild" with "lastStableBuild" or maybe even
with a specific build number (of course, then the question becomes:
"How does my build script know the correct build number", but that's a
whole different can of worms... :)

-- Sami

2009/6/14 Marcio Ribeiro <[hidden email]>:

> Links? I am not sure what do you mean. I am in a shell script build step...
>
> On Sun, Jun 14, 2009 at 5:28 PM, Sami Tikka<[hidden email]> wrote:
>> 2009/6/14 Marcio Ribeiro <[hidden email]>:
>>> Is there a way for a build to access the archived artifacts of a
>>> previous build? (using the 'archive artifacts' post build action)
>>
>> Yes, by downloading the artifacts using previous build's permalinks,
>> which you can find on the web page Hudson creates for each build.
>> There are also links which do not require you to know the build
>> number, like lastSuccessfulBuild and lastStableBuild.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> --
> Marcio Ribeiro
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

mmr
Reply | Threaded
Open this post in threaded view
|

Re: Accessing archived artifacts

mmr
Ok, I understand what you are suggesting.
I sent another email explaining what I did (the same but  with HTTP set aside).

On Sun, Jun 14, 2009 at 6:04 PM, Sami Tikka<[hidden email]> wrote:

> With "links", I meant URLs. If JobA makes ArtifactA, then JobB can
> download it in a shell script build step with a command like this:
>
> wget http://YOURHUDSON/job/JobA/lastSuccessfulBuild/artifact/ArtifactA
>
> Replace "wget" with "curl -O" if you are on OS X. You may also want to
> replace "lastSuccessfulBuild" with "lastStableBuild" or maybe even
> with a specific build number (of course, then the question becomes:
> "How does my build script know the correct build number", but that's a
> whole different can of worms... :)
>
> -- Sami
>
> 2009/6/14 Marcio Ribeiro <[hidden email]>:
>> Links? I am not sure what do you mean. I am in a shell script build step...
>>
>> On Sun, Jun 14, 2009 at 5:28 PM, Sami Tikka<[hidden email]> wrote:
>>> 2009/6/14 Marcio Ribeiro <[hidden email]>:
>>>> Is there a way for a build to access the archived artifacts of a
>>>> previous build? (using the 'archive artifacts' post build action)
>>>
>>> Yes, by downloading the artifacts using previous build's permalinks,
>>> which you can find on the web page Hudson creates for each build.
>>> There are also links which do not require you to know the build
>>> number, like lastSuccessfulBuild and lastStableBuild.
>>>
>>> -- Sami
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>>
>> --
>> Marcio Ribeiro
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
Marcio Ribeiro

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]