drong0
drong0

Reputation: 45

Jenkins can't open make

I have recently installed Jenkins 2.89.2 on Ubuntu 17.10 and I am trying to set up my first project. So far I've managed to get Jenkins to download the source code from my repository but I'm having trouble calling make. I configured to call make in the Project > Configure > Build Environment > Build (Execute Shell) with the command make. After calling make it returns the error make: not found.

I have tried the solution to related questions below relating to adding the correct directory to the $PATH environment variable. I have tried adding it to the system settings under Manage Jenkins > Configure System > Environment variables, as well as under Project > Configure > Build Environment > Build (Execute Shell), setting PATH to $PATH:/usr/bin. I was sure that I managed to set the Path correctly, as I was echoing $PATH before calling but then tried calling make with its fully qualified path which resulted in the same error: sh: /usr/bin/make: not found. Which leads me to believe I am not calling make correctly.

I experimented calling make with the command sh make and sh /usr/bin/make and the error changed to Can't open make and Can't open /usr/bin/make

This lead me to believe the access rights to make were incorrect, but it seems that it is.

-rwxr-xr-x 1 root root 222792 Feb  1  2017 /usr/bin/make

Perhaps the jenkins user needs to be added a group?

I'm running out of ideas on what it could be and doubt if I come to the right conclusion about the way I am calling make.

Some other details: make works correctly at the command line which make returns /usr/bin/make

I hereby declare my allegiance to Koalemos and ask the gods of Jenkins to have mercy on my soul.

Upvotes: 1

Views: 4525

Answers (1)

Daniel Ram
Daniel Ram

Reputation: 352

if you are using the Jenkins docker image, note that the image provided by Jenkins does not include this (make) along with other deps you may need.

What you can do is run a docker exec against that container with the user of root, and install all the deps with apt-get and then your build will run.

docker-machine env jenkins
#paste the env to set the docker-machine context
docker exec -it --user root <container-name> /bin/bash 
#terminal session as root starts
apt-get update 
apt-get install build-essential

Upvotes: 4

Related Questions