How to access environment variable from CircleCI in fastfile

I have an environment variable called FIREBASE_TOKEN stored on my CircleCI account. I want to access this in my fastfile, but I’m not sure how I can do that. My initial guess it to use ENV['FIREBASE_TOKEN']. Will this work?

e.g.

desc "Distribute app"
  lane :distribute do
    build_ios_app(...)
    firebase_app_distribution(
        app: "appid",
        testers: "tester1@company.com, tester2@company.com",
        release_notes: "notes",
	    firebase_cli_token: ENV['FIREBASE_TOKEN']
    )
  end
1 Like

ENV["ENV_NAME"] is the right way to access the variables in CIRCLE CI.

2 Likes