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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,580
Community Members
 
Community Events
184
Community Groups

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
AUG Leaders

Atlassian Community Events