Thanks Jan. The Envfile plugin doesn't work for me as it requires the
java property format. My version file is just 3 digits in the plain
text file.

I could go with the second option. I need the version number in
post-build action, where I'm sending the files to a remote server
using scp. I need the version number included in the remote path. Is
there a way I can run any script in post-build actions?

By build steps, you mean pre-build, build, post-build? So if I set any
environment variables using Ant (or Phing) in build step, it will not
exist in post-build actions? Thanks.

Cheers,
Pan



On Thu, Apr 5, 2012 at 1:10 AM, Jan Seidel <[email protected]> wrote:
> Hi,
>
> you could try the Jenkins Environment File Plugin
> https://wiki.jenkins-ci.org/display/JENKINS/Envfile+Plugin
>
> Else you would have to run some string manipulation to get the value
> into a file and execute it at each build step like you would assign an
> environment variable.
> In DOS it would be a content like: SET var_name=var_value.
> You have to execute it at each build step which needs the value as the
> variable is destroyed when the build step is done.
>
> Take care
> Jan
>
> On 5 Apr., 09:04, Pan Luo <[email protected]> wrote:
>> I have my version number stored in a file. I would like my jenkins job to
>> read the version from that file and store it in a variable so that I can
>> used it some publish task. Is there a way to do it? Thanks.

Reply via email to