Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I can't use pm2 commands in bitbucket pipeline

İbrahim Sayar August 1, 2024

I have a bitbucket-pipeline file as below but i get a 'pm2: not found' error when pipeline worked. Thanks for now help and comments.


 

image: node:18

pipelines:
branches:
development:
- parallel:
- step:
name: Development Build & Deploy
caches:
- node
script:
- pm2 reload 0

3 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2024

Hi İbrahim and welcome to the community!

Pipelines builds that run on Atlassian's infrastructure run in Docker containers. For every step of your build, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. The step you have posted here will run in a Docker container based on the following Dockerhub image with the tag 18:

Any tools you want to use during a step must be either preinstalled in the Docker image you use as a build container, or you will need to install them during the build by adding the necessary commands in your yml file's script for that step.

The Dockerhub image node:18 doesn't have pm2 preinstalled. You can add a command to install it in that step (you can check this doc, in case this is the tool you are referring to), or you can create a custom Docker image with this and other tools you need, and then use that as a build container in your Pipelines build:

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

0 votes
İbrahim Sayar August 1, 2024

Because our test app stand up with pm2. Pm2 installed our server. You can see in the picture below.

 

0 votes
marc -Collabello--Phase Locked-
Community Champion
August 1, 2024

Pm2 not found indicates that pm2 might not be installed.

However, why do you need pm2 in a build pipeline?  Usually pm2 is used as a process supervisor for long-running node processes.

 

İbrahim Sayar August 1, 2024

Because our test app stand up with pm2. Pm2 installed our server. You can see in the picture below. My problem is why I can't use pm2 commands in pipeline.

Screenshot 2024-08-02 at 09.30.50.png

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