Unable to access Environment Variables in a Forked PR iOS Build

ios

#1

Hi,

I have defined a few project environment variables for my project, and then try to use them in my circle.yml file like this:

- run:
    name: Invoke curl command
    command: curl -X POST $ENDPOINT

But this doesn’t work at all. Is there any problem with the project env vars at the moment? I am seeing the same project with android builds as well.


#2

Env vars are not supported everywhere in a YAML file, but they should be OK in a command line. Try echoing this var to see if that works? Also, would you show a screenshot of the env var panel, in case you have mispelled the one there or in your config?


#3

@halfer Thanks for the reply. I did check the env var again and it is the correct value.

I did a few more tests and it looks like the project env vars are completely broken for my project for some reason. No matter what I tried (echo the env var to a file via bash, try access the env var from a script), I always end up with empty values for the env vars. It looks like they are not set at all to the container (I am using 2.0 BTW).

This is not only broken for ios, but I can’t get env var working for android builds as well.

Any idea?


#4

@halfer I figured out what’s wrong now. I was building the PR from a fork and apparently by default I won’t be able to get all the env vars set.

I wish the “using env var” doc should really mention it there somewhere…


#5

Ah, I didn’t know this either. Good work!

I believe you can fork the docs on GitHub, make a change to your copy, and then raise it as a suggested change via a PR.


#6

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.