How to install EB CLI to Jenkins on AWS

Hi! In this post, I'm gonna show you how to install EB CLI to your ec2 instance, so you can call it from your Jenkins pipeline. Let's get to it!

Step 1: Switch to root user You can achieve this with the following Linux command:

sudo su

Step 2: Install pip3

yum -y install python3

Step 3: Install EB CLI:

pip3 install awsebcli

Step 4: Add EB CLI to Jenkins path

environment {
        PATH="/usr/local/bin:$PATH"
}

Step 5: Call EB CLI from the pipeline:

eb --version

eb-cli-2.png

And that should be it!

Note: I did the process on a fresh ec2 instance.

Note2: You should install only pip3 on your instance. If you have any other python version, it can mess up your path, and it will result in a ModuleNotFound exception