Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,998
Community Members
 
Community Events
176
Community Groups

Can't access unsecured variable in pipelines script

I'm trying to access a variable (unsecured) in a script to create a .env file before building, but the file is always created empty. The plan is to base64 decode it, but right now I'm just trying to access it at all. As far as I can read only secured variables should be restricted. What am I missing?

Screenshots below

Thanks!

 

script:
- echo $ENV_FILE > .env.local
- cat .env.local
- yarn install
- yarn build 

 Monosnap rushhourmedia _ wristcheck-next _ Deployments — Bitbucket 2022-06-14 17-54-24.pngMonosnap rushhourmedia _ wristcheck-next — Bitbucket 2022-06-14 17-55-20.png

1 answer

0 votes
Norbert C Atlassian Team Jun 15, 2022

Hi Chris,

Thanks for reaching out to Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you!

This sounds interesting, can you try to do only the "echo $ENV_FILE" command and let me know whether if it shows the environmental variable? Also, can you let me know if you're using Runners or are you running it on our Pipelines infrastructure?

Please let me know.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Hi Norbert,

I figured it out myself eventually - this was a deployment level variable which I didn't realise would not be available in non-deployment steps. I have moved it to a repository level variable which is now working.

 

Thanks for he reply

Norbert C Atlassian Team Jun 16, 2022

Hi Chris,

Thank you for your reply, I'm glad to hear your issue is resolved :).

Have a lovely weekend ahead and stay safe!

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events