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

CI/CD Pipeline Issue: Plugin Installed in last step, its command is not available in the next step.

Milanjeet Singh
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!
April 25, 2024

I have below .yml and there is no compiling issues:

It's giving an error as pip3: command not found. I have installed in the above step already.

image: salesforce/cli:latest-slim

definitions:
steps:
- step: &install-build
name: Plugin Installation
script:
- apt update
- apt -y install python3-pip
artifacts:
- target**

pipelines:
branches:
master:
- step:
name: Runing for master branch
script:
- echo 'Runing For master branch'
feature/*:
- step:
name: Running For feature and validation for QA
script:
- pip3 install yq
- apt -y install jq

Error as below:

+ pip3 install yq

2
bash: pip3: command not found

 


Does anyone know how to fix it? Need urgent help.

1 answer

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

Hi @Milanjeet Singh and welcome to the community!

Every step in a Pipelines build runs in a separate Docker container. 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 repo is cloned in the build container, and then the commands of the step's script are executed. When the step finishes that Docker container gets destroyed.

Tools you install in one step will not be available in other steps, since these other steps will run in a new Docker container. You will need to install tools in the step that needs them.

Please also note that the step &install-build you are defining in a YAML anchor is not used by any pipeline. This is not relevant to the error you get since you are still using a command in a step where you have not installed it. If you want to make use of YAML anchors, please check our documentation below for info on how to reference these steps:

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events