pipeline node version not affected by settings in yml file

Guy Segal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 6, 2024

I have the following bitbucket-pipeline.yml :


image
: node:18.14.2

pipelines:

default:

- step:

name: Playwright Tests

image: mcr.microsoft.com/playwright:v1.29.2-focal

script:

- npm ci

- node -v

# - Run the test cases

- npx playwright test

artifacts:

- playwright-report/index.html

 

 

And no matter what version of node I use for the image the node -v command always shows 

v16.19.0

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 9, 2024

G'day Guy!

Welcome to the Bitbucket Cloud community! :) 

Based on the YML configuration you've shared, by defining image: node:18.14.2 at the top - this simply means that this image will be used by default for all builds unless specified otherwise in the build step.

For the Playwright Tests build step, you are explicitly defining that the mcr.microsoft.com/playwright:v1.29.2-focal image is to be used for this step, which  overrides the node image you specified earlier in your configuration.

I've checked the playwright image locally in a Docker container and can see that the same node version is reported:

# docker run -it --entrypoint=/bin/sh mcr.microsoft.com/playwright:v1.29.2-focal

# node -v
v16.19.0

You will need to either:

a) Remove the playwright image definition in the build step so that the node image is used

b) Update the node version as part of your build step

 

I hope this helps!

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events