Tcl script starting with jenkins turns the command to lowercase

I have a strange problem when running the tcl command in jenkins.

The tcl script has the following lines ( note the uppercase i in Id ):

foreach name $docker_names {
  set name "TestName"
  puts $name
  set command "docker inspect --format='{{.Id}}' ${name} > /home/temp/id.txt"
  send -- "$command\n"
  expect "$"
}

In the jeknins log, I see that the job fails because the one sent in the second iteration of the loop is the command above, but in lower case. I need me to be uppercase in Id .

This is what is sent to the second iteration of the loop :

docker inspect --format='{{.id}}' testname > /home/temp/id.txt

NOTE. . At the first iteration, everything is sent correctly.

Does anyone have an idea why this is happening?

Thank!

+4
source share
1 answer

TCL. TCL Jenkins: , , script -TCL. 2 : -, TCL :

foreach name $docker_names {
  set name "TestName"
  puts $name
  set command [concat {docker inspect --format='{{.Id}}'} $name { > /home/temp/id.txt} "\n"]
  send -- $command
  expect "$"
}

, curlybraces, :

foreach name $docker_names {
  set name "TestName"
  puts $name
  set command "docker inspect --format='\{\{.Id\}\}' ${name} > /home/temp/id.txt"
  send -- "$command\n"
  expect "$"
}
0

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


All Articles