I am working on a Bitbucket pipeline where a zip file gets created using environment variables that are set through a .env file. Before this zip file gets generated usually a .env file is configured with variables set used to create a zip file. The zip file gets generated utilizing a Gradle wrapper (gradlew). I'm a little unsure how to set these variables in the .env file. I know Bitbucket has the option to use repository variables in order to set these values, but I am unsure if this is best practice for automating this process. Any advice on this would be appreciated. Below is how the the environment variables currently get set and how the zip is created with gradlew.
.ENV
NETWORK_NAME=network
GROVE_ZIP_PATH=./build
GROVE_ZIP_FILENAME=zipName.zip
# Configuration
HOST=host.docker.internal
PORT_MAIN=8070
PORT_SEARCH=8074
Create Zip
.\gradlew zipName
The ENV file needs to be configured before the zip file can be created. Any advice on how to do this in a pipeline would help.