Define variable in if loop

How to define variables in if loop.

I am trying like this but it’s not working.

before_script:

  • | # multiline yaml support
    if [ “$SEGMENT” == “GOBIG” ]; then
    variables:
    - CF_USERNAME: $CF_GCBS_NP_USER

      - CF_PASSWORD: $CF_GOBIG_NP_PWD
    

    fi

Regards,
Madhu