1

dynamic variable by command curl http://test.com

I try to pass variables by this solution below but It's show as string "$(curl http://test.com)" how to solve it

.test
  variables:
     SERVER : $(curl http://test.com)

1 Answers1

2

As in here, you can try and assign the variable in a before_script step:

before_script:
  - export SERVER=$(cat .nvmrc)

Then you can use $SERVER in other steps of your pipeline.

That was also suggested in issue 34202 (Allow setting variable to a contents of a file).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250