I want to deploy my application to HEROKU when I push to master via my bitbucket repo. I have the bitbucket-pipeline.yml
file set-up which doesn't seem to have any syntax errors.
But the build fails while reading my $HEROKU_API_KEY
. This key is in my .env
file and logs to the console when I log it from the index.js
file.
The only feasible option is to copy the api-key
and paste it into that line. But I don't really don't wanna do that.
I am currently on Ubuntu 18.04 LTS
and node v10.16.3
How do I solve this puzzle?
Here is the yml file
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.3
pipelines:
default:
- step:
name: Defaults
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm test
- step:
name: create artifact
script:
- mkdir artefacts
- tar -czf artefacts/my-app-$BITBUCKET_BUILD_NUMBER.tar.gz --exclude=./artefacts .
- cp artefacts/* .
artifacts:
- my-app-*.tar.gz
- step:
name: Deploy to production
deployment: production
script:
- pipe: atlassian/heroku-deploy:1.0.1
variables:
HEROKU_API_KEY: $HEROKU_API_KEY
HEROKU_APP_NAME: "my-app"
ZIP_FILE: "my-app-$BITBUCKET_BUILD_NUMBER.tar.gz"
WAIT: "true" # Optional.
DEBUG: "false" # Optional