How do I use set parameters from within a build.


I'm trying set a version parameter with the following command line build step:

VERSION=$(./mvnw exec:exec -Dexec.executable=echo '-Dexec.args=${project.version}' -q --non-recursive)
echo "##teamcity[setParameter name='env.PROJECT_VERSION' VALUE ='$VERSION']"

I'm then trying to read it in a following command line build step:

echo "Calculating RPM Version and Release numbers from Maven Version : $version"

However the version is always an empty string.

I also noticed that adding the 2nd build step created an implicit agent requirement that env.PROJECT_VERSION was set. To get around this I set env.PROJECT_VERSION to 'A' in the build parameters.

What am I doing wrong here?

1 comment
Comment actions Permalink

The problem was the capital VALUE. Thanks for looking. =)


Please sign in to leave a comment.