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,297,835
Community Members
 
Community Events
165
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
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,218 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you