I've learned about pipelines with bitbucket and I want to make a new one to upload my react application (bootstrapped with create-react-app) and uploaded to an Amazon S3 bucket.
I made a bitbucket-pipelines.yml
file like this one
image: node:10.15.3
pipelines:
default:
- step:
name: Installing dependencies
caches:
- node
script: # Modify the commands below to build your repository.
- rm -rf package-lock.json
- rm -f node_modules
- yarn add
- step:
name: Build
script:
- yarn build
When Bitbucket runs it, it shows me the next error message
env-cmd -f .env.production.local react-scripts build
Error: Unable to locate env file at location (.env.production.local)
This is it because in my package.json I use env-cmd to read my environment variables for the building script.
"scripts": {
"start": "env-cmd -f .env.development.local react-scripts start",
"build": "env-cmd -f .env.production.local react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
But I don't know how to read that environment variables (localized inside of my .env files) in my bitbucket-pipelines.yml file
How can I get that?