Include Build Number and SVN URL in Release

We build our project with ant. I want to include a text file containing the current version of SVN in the batch version. My idea is to make svn infoand transfer its output to a file, which is then included in the release.

Have you done this before? Is there a standard way to do this?

+3
source share
3 answers

If you have TortoiseSVN on your computer, you can use SubWCRev .
SubWCRev can replace parts of this file with the current version of svn.

( $WCREV$) bat-file, .

+1

,

 svnversion

. svnversion . , ?

+1

I do this with a script that uses awk script to create a file called _vni that can be included. The generated file is obviously not controlled in SVN

Dorel

#!/bin/ksh
svn update
svn status
svn info | awk -f make-vers.awk

makeup vers.awk

This creates an HTML formatted file and uses the background color from the array colsto provide quick differentiation of releases. If you just want the text file to cut out the whole HTML file.

BEGIN{
cols[ci++] = "#3300FF";
cols[ci++] = "#B300FF";
}
/^Revision\:/{rev = $2}
/^Last Changed Author\:/{auth=$4}
/^Last Changed Date\:/{date=$4}


END{
    date = strftime("%d-%b-%Y")

    col = cols[rev%ci]
    vs = "<div id='vni'>\n";
    vs = vs "<p style='background-color: "col"'>BuildInfo: [PRODUCTNAME] V2.0 Product   ion: Release "
    vs = vs (rev)
    vs = vs " - " date
    vs = vs " ("auth") "
    vs = vs "</p>\n</div>"

    OF="vni"
    print vs >OF;
}
0
source

Source: https://habr.com/ru/post/1795197/


All Articles