7

Here is my infrastructure:

  • M1 is Jenkins master, running OS X (Mountain Lion)
  • M2 is Jenkins slave, running OS X (Mountain Lion)
  • J is a Jenkins job, running on M2

On M2, I have installed AWC CLI using pip, and run aws command manually successfully.

I set up the J job to run that aws command. But when J runs, it fails and the error message is:

... aws: command not found

Do you have any idea this happens and how to fix it?

Thank you.

4 Answers 4

15

Not so tough though: I should have given the full path to aws tool. In my case, the correct command should be:

/usr/local/bin/aws <other sub-command and options>

This solves the problem. Hope this will save someone few hours struggling.

Sign up to request clarification or add additional context in comments.

4 Comments

I caouldn't locate aws in my jenkins. So no command worked for me. Any thoughts ?
@PrabhuKhannaMahadevan your Jenkins server probably doesn't have the AWS CLI installed. You'll need to install it.
Facing similar issue when appended with /usr/local/bin it says No such file or directory
@Rizwan It looks like your awscli installation is not in /usr/local/bin. In this case you'll need to locate the binary first (by running the command "which aws", I guess? Or consult the installation documentation you followed).
2

on your jenkins server 'sudo -i -u jenkins' install aws cli under the jenkins user.

Comments

1

If the solution by Nguyen doesn't work try this path, My Jenkins build [with EnvInject] was setup to install AWS in /home/jenkins/.local/bin/aws

2 Comments

Verified with which aws -> /home/jenkins/.local/bin/aws added this in script part of jenkin job but giving error as No Such file or directory
@Rizwan What is the output when you run "/home/jenkins/.local/bin/aws --version" manually in your shell session?
1

To provide a general working solution you could execute which aws which will provide the exact path of aws binary, or even: $(which aws) which is equivalent to executing aws

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.