Monday, 15 March 2010

Set Bamboo variable in batch file -



Set Bamboo variable in batch file -

i'm trying set bamboo global variable in script contained in batch file. here batch file:

@echo off echo initial date: %bamboo_releasedate% /f "tokens=1-4 delims=/ " %%i in ("%date%") ( set dow=%%i set month=%%j set day=%%k set year=%%l ) set mydate=%month%_%day%_%year% echo %mydate% set bamboo_releasedate = %mydate% echo set date: %bamboo_releasedate%

and here output:

initial date: 140617 06_19_2014 set date: 140617

as can see, variable %bamboo_releasedate% didn't alter @ all. thought if it's possible, , how can ?

my end goal utilize variable in naming of folders containing nightly builds (using standard 'artifact download' provided bamboo).

thanks help ! christophe

update: fixed batch issue, updated value isn't available after script. thought how ?

set bamboo_releasedate = %mydate% ^ ^

the spaces included in name of variable , in value. so, assigning value new variable (that includes space in name), not existing 1 (without space). replace

set "bamboo_releasedate=%mydate%"

now, there no spaces not in name of variable nor in value, , quoting ensures there no aditional ending space in variable content.

variables batch-file bamboo atlassian

No comments:

Post a Comment