Jenkins Install Packages

Please can you assist?

The task “Jenkins Install Packages” seems to be a vague task as every time I use the $PACKAGE parameter, and I failed the task. Please can you clarify this as the task has been failed twice even though I carried out the exact instructions in the task.

Much appreciated

HI @demy.adefajo,

Can you please provide us the link to the lab then we can help you better

Regard

Hi @demy.adefajo

Apparently I don’t have access to the task, it’s possible to paste here the statement of the task and how you try to achieve it

Regard

please see attached
install jenkins package.pdf (58.4 KB)

I logged into the Jenkins UI

  1. Setup the job
  2. Added the stringed parameter
  3. Installed SSH & Parameterized Remote Trigger plugins after Jenkins restart
  4. Installed Storage Server credentials then added the SSH site (storage server).
  5. Confirmed the connection which was successful.
  6. Proceeded to build the job based on the $PACKAGE parameter using the credentials stored
  7. Job indicated success however once I clicked to confirm task was done on the KodeKloud portal, it indicated I failed the tasks (twice) with error - package is not installed!

Hello,

did you find a solution to your problem ?

On my sight I failed the task because of the title which should be Install a Linux Package.
So you have to yum install a $PACKAGE.

Even without installing a package on the Storage server you will have a job successfull.

Regards

thanks Phillipe,

I will have a go at this.

the issue is that the build is actually successful however when I confirm it on the Kodekloud portal for submission, i get the error below:
Jenkins job is not configured to install the provided package on Storage server
ERROR final_chk.py - AssertionError: Jenkins job is not configured to install…

@mmkmou
the issue is that the build is actually successful however when I confirm it on the Kodekloud portal for submission, i get the error below:
Jenkins job is not configured to install the provided package on Storage server
ERROR final_chk.py - AssertionError: Jenkins job is not configured to install…

Hi,
Did you check the package you try is really installed on Sorage Server after Jenkins Job ?
Can you show your pipeline ?

yep i did, i did an install of nginx as a package and I was able to see on the storage server. I even uninstalled it and tried with httpd. Install was successful yet when I tried to submit, i got the same Jenkins error! I deleted the successful pipeline as it couldn’t be saved once the task is submitted for grading. I will redo the task again and let you know

Hi @demy.adefajo

  • Can you please give us some screenshots of the job configuration?
  • What is the content of your script?

Regard

thanks for the reply. I managed to figure this out. So setup the Jenkins job (after installing all the plugins) as normal then add the parameterized string value

so it was just a matter of doing e.g. echo password | sudo -S yum install $PACKAGE -y

where $PACKAGE is the Jenkins parameter for the Default value of the package (defined within the Jenkins job) which can be anything e.g. wget etc.

Thanks again

1 Like

Hello
For the one Who needs additional information, you can read the man page of sudo specially -S option

Regard

Hi,

I’ll appreciate if can list out all the plugins you installed for this task because i installed, ‘terminal’, ‘ssh’ and ‘ssh credentials’ but it i can’t pass the test. Below output to error i get:

Started by user admin Running as SYSTEM Building in workspace
/var/lib/jenkins/workspace/install-packages [install-packages] $ /bin/sh -xe /tmp/jenkins3087714502967318144.sh

  • echo password
  • ssh -tt natasha@ststor01 sudo -S yum install git -y
    Host key verification failed. Build step ‘Execute shell’ marked build as failure Finished: FAILURE

Hi @Horson,

You will need to install ssh etc as well as Parameterized Remote Trigger, Build With Parameters then make sure the tick “This project is parameterized” when you are setting up the package.

  1. Setup the job
  2. Add the stringed parameter (make sure to tick “This project is parameterized”)
  3. Install SSH & Parameterized Remote Trigger etc plugins after Jenkins restart
  4. Install Storage Server credentials then added the SSH site (storage server) and confirm the connection which is successful.

So setup the Jenkins job (after installing all the plugins) as normal then add the parameterized string value

so it is just a matter of doing e.g. echo password | sudo -S yum install $PACKAGE -y

where $PACKAGE is the Jenkins parameter for the Default value of the package (defined within the Jenkins job) which can be anything e.g. wget etc.

Hope the above KB helps

1 Like