Setting environment variable via GUI doesn't work

I need to export some variables like an API key for our build, therefore I used project settings my-project/edit#env-vars on the web and defined couple of key-pair values there. However script included in the project cannot read it and even doing echo $MY_VAR doesn’t print anything (none of my defined vars is not also not listed via printenv). So I am kinda getting desperate, what could be wrong here?

machine:
java:
    version: openjdk8
compile:
override:
    - sh resources/scripts/build-project
    - sh resources/scripts/eb-deploy #this script takes env vars

general:
branches:
    only:
        - master
        - aws-integration