Hudson build notes txt file windows

I had a need to write a .txt file with build details for every build (windows). This involves using environmental variables and executing a windows batch command.

Create c:\buildinfo.bat

@echo off
echo Build number: %1
echo BUILD_ID: %2
echo JOB_NAME: %3
echo build_tag: %4
echo BUILD_URL: %5
echo WORKSPACE: %6

In your hudson job configuration select “Execute windows batch commmand” and then input the following:

c:\buildinfo.bat %BUILD_NUMBER% %BUILD_ID% %JOB_NAME% %BUILD_TAG% %BUILD_URL% %WORKSPACE% > c:\buildinfo.txt

Of course you will need to use robocopy or something to copy that in to your workspace or you could add:

copy c:\buildinfo.txt %workspace%

Leave a Reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>