0
votes

I have template which have two build steps:

  1. Maven
  2. Command line

Command line steps sets current datetime in variable which i want to use in Build Feature.

I am getting proper Current datetime as follows via Command Line step:

#!/bin/bash
export current_build_date_format="+%%d%%m%%Y_%%H%%M%%S"
export current_build_date="$(date $current_build_date_format)"
##teamcity[setParameter name='current_build_date' value='$current_build_date']

When i am trying to refer it in Build Feature, its not able to identify parameter via "%current_build_date%"

It shows paramter as undefined in Configuration Parameter section

enter image description here

Anything missing? I have defined that parameter via command line, how will teamcity features use that

Parameter error:

enter image description here

Error while reading user defined parameter first:

Initialization
[05:42:27][Initialization] - Build Details Validator
[05:42:27][ Build Details Validator] Error: Conversion = 'm'
[05:42:27][Initialization] Build validation failed
1

1 Answers

1
votes

You need to echo TeamCity service message to let TeamCity parse and use it, e.g.:

echo "##teamcity[setParameter name='current_build_date' value='$current_build_date']"