Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

Could not run npm script in bitbucket pipeline when setting Deployment environments Edited

I have a ReactJs web app that is deployed to two environments: staging and production

Each environment uses different firebase api key and some custom parameters.

So i setup those params as environment variables in two Deployment environments: Staging and Production. As guide: https://confluence.atlassian.com/bitbucket/set-up-bitbucket-deployments-968683907.html

When running the webpack build command, it will read those environment variables from bitbucket deployment environment base on the environment i want to deploy to.

My problem is: if i specify the `deployment` in my bitbucket pipeline configuration, the webpack build command (`webpack --config webpack.prod.js`) won't work, it says: `/bin/sh: webpack: not found`. If i remove the deployment line, the pipeline run successfully.

It looks like the bitbucket deployment environment had made some changes to the environment variable that npm script couldn't find the webpack executable in `node_module` directory

My `bitbucket-pipelines.yml` is as follow (sorry, i couldn't find a way to indent it):

image: node:10.16-alpine

pipelines:
custom:
# Deploy to staging
deploy-to-staging:
- step:
name: Deploy to staging
deployment: Staging
script:
- yarn && yarn build

 

0 comments

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,154 views 0 7
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