$CIRCLE_BUILD_NUM is empty during build

Hi,
I have issue with ENV variable… in one case it is EMPTY…
I have in my circle.yml these 2 calls… In first variable $CIRCLE_BUILD_NUM is populated but in second call it’s empty…

FIRST CALL:
dependencies:
pre:
- grunt prepare_deploy --staticID=static-$CIRCLE_BUILD_NUM

// working, OK

SECOND CALL:
deployment:
production:
branch: master
commands:

  `- ssh user@adress 'cd ../../opt/myappdirectory && sudo -S -k forever-service install myapp --script server.js -e "SERVER=eu-1 IDENTITY=live PORT=5555 INSTANCES=5 NODE_ENV=production STATIC=static-$CIRCLE_BUILD_NUM"'`    

//not working, $CIRCLE_BUILD_NUM is empty

Can you tell if it’s bug? Or problem is that there are more quotes ("’) and your parser can’t parse it somehow?

Expected behaviour:

  • $CIRCLE_BUILD_NUM is replaced in all 2 calls in my build

Actual behaviour:

  • second call of $CIRCLE_BUILD_NUM is empty:
    ssh user@adress 'cd ../../opt/myappdirectory && sudo -S -k forever-service install myapp --script server.js -e "SERVER=eu-1 IDENTITY=live PORT=5555 INSTANCES=5 NODE_ENV=production STATIC=static-$CIRCLE_BUILD_NUM"'

I also tried to use ${CIRCLE_BUILD_NUM} but with no luck…

I’m having the same issue. Ever find a solution?