I am trying to pass the variable value using cli from .env file to yml file, I tried using scripts but its not working. Its working fine when value are passed through GUI. Does anyone know if we can even pass value in bitbucket pipeline.yml file from seperate file?
Hi @Kunjan Giri ,
Welcome to the community.
In order to be able to pass environment variables via .env file, you'll follow the syntax as shown in the below example.
image: atlassian/default-image:4
pipelines:
default:
- step:
name: Build and test
script:
- source .env
- echo $var
{code}
### In the .env file
var=<variable value here>
Let me know how it goes.
Cheers,
Swetha Boyapati
I might have missed something earlier when I tried this. It's working now. thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.