Listing RPM's in a Jenkins Job - jenkins

So I have been tasked with creating some clean up jobs in Jenkins and one of the stages is gathering a list of all the RPM's then filtering them based on the set up and deleting the appropriate RPMS's.
I of course have to script this job and have no clue where to even start or how to even attempt to get a list of the RPM's if someone could point me in the right direction of provide me with some scripts that would be great :) Struggling to find resources that could help me, so any support would be appreciated.
Kind regards,
IA

Related

Binaries result comparisons

I'm a young maths teacher and I'm introducing algorithms to my students.
They learn C basics to write their programs.
I have more 400 students and testing their programs takes me a lot of time.
Already wrote a shell script but they need to send me the binary.
So I would like to set up a platform where they can upload their binaries or their sources and test it.
The school gave me a Jenkins and a web instance.
I did read some docs about Jenkins and JUnit but I don't see how can I test output of another program.
Thanks for your answers.
You don't have to use Jenkins and JUnit necessarily. You don't need anything else than your own laptop and a bash script. They are just doing C programming...
First, gather your students code in an organized manner (send code by mail or download them from the platform). Then, prepare some input and output files (which correct results obviously) and write a tiny script which will execute your students code with these prepared inputs. The script will finally compare the results with your prepared outputs.
Some notes to make things easier because students always do things their own way:
be precise on how they have to compile their program (flags, given makefile...)
be clear on the input and output format
I tell them to give their program in a specific way (name of program with NAME or ID)
If they don't follow my guidelines they get minus points. This is so much important because they have to learn to be rigorous and in the same time you also gain tremendous time. They have to put the effort to make your correction process efficient especially when you have so much students.
But well you can also dig in Jenkins doc it might be worth it (although I do not use it personnally). And why can't you ask your school to help you for that ?
Edit: Maybe this CMake/C++ Jenkins topic might be help you.

In Travis-CI, how can I have a different matrix for pull requests?

Is there a proper way to create a build matrix specific for Pull Requests?
The idea is:
In normal builds, I want to test a few things only (code style/standards, some unit tests, some general validation). Mostly one item only in the build matrix.
In pull requests, I want to run the tests with several different environments, including different databases and versions. This is what I currently have but it demands a lot from travis (and it is slow).
I know I can achieve that in the script by checking TRAVIS_PULL_REQUEST and skipping the tests, but that will misleadingly show some environments as "passed" when they were actually not tested.
Thank you for any help / guidance,
Daniel
Interesting wish!
This is not possible at the moment. You might want to chime in on https://github.com/travis-ci/beta-features/issues/11 to bring it to the attention of the relevant people.

Jenkins dashboard for multiple pipelines

I am using jenkins with the pipeline plugin to build my microservices based application. This works basically, but there is no way to get a good overview which services have been build last for which branch and what the result was. Even the new Blue UI falls short :-(
I just want to have the name + last builds results for the pipelines to be able to see if something is going wrong somewhere.
I have searched for plugins which might help here but I had no luck.
Has someone solved this in some way already?
I don't want to spend my time writing my own visualization, but I am beginning to realize that this will be the way to go. :-/
If nothing like this exists does someone know a good source to start to use the jenkins api for this kind of visualization?
You can do that using https://wiki.jenkins-ci.org/display/JENKINS/Dashboard+View
It allows you to add a job list and specify the jobs to be included using a regular expression. Hence, new jobs for feature branches should appear automatically.
I guess, this will be a one end to end product for you. I have been using it from the last 6 Months.
This is much better than the other Dashboards.
Hygieia Dashboard

JIRA: Any way to compare summed up estimates for one release to available time?

the customer I'm working for uses JIRA. However since they have a big Enterprise license (~2k users) they will not sign off additional plugins that would only be used by a comparatively small amount of users.
However, we in lead development have to present a few figures that we have to assemble manually at the moment. We are supposed to be able to always tell for one release how many hours are already "booked". (Original) Estimates are added reliably to all issues and everything is assigned to exactly one release. Based on the amount of workers in the team I can calculate the number of hours we have for the next release.
Is there any built-in possibility to do a report for this at any time? I'm a bit lost at the moment since I wonder where I'd store or how I'd calculate the amount of hours.
Note: we're not allowed to buy plugins, but we have coders at our fingertips. :D So a hint on how to script or code this would be appreciated as well.
Thanks a lot!
I think that the easiest approach is to use JIRA REST API to extract the info you need. So this is task for your coders :-).
Please take a look on search method: https://docs.atlassian.com/jira/REST/latest/#d2e2450
I think that you can start with request like
/rest/api/2/search?jql=fixVersion=YOUR_RELEASE

Sharing configuration between jobs

I have got a few Jenkins jobs. They look very similar to each other and differ only in details. Originally they were created by copying the first job.
If something changes in one of the jobs configuration, then it has to be applied to all the other jobs configurations. This makes Jenkins maintenance more complex, longer and error-prone.
What I'd like to do is to pull up at least some common parts of jobs' configuration and keep it in one place so I don't have to apply each configuration change to all the jobs separately. Is is possible, and if so, how can this be achieved?
I would like not to create new project or change the way jobs are structured (upstream-downstream dependencies) as all these jobs are legacy.
Thank you in advance!
There are several plugins that help with that. Inheritance plugin comes to mind
You can also have a look to the Template Project plugin.
With this plugin, you can use the builders, publishers and SCM settings from a template job.
We are using this plugin in my company and it works well :)
I think Jenkins DSL Plugin can be used to solve this problem too.
Accordding to its summuary:
Jenkins is a wonderful system for managing builds, and people love
using its UI to configure jobs. Unfortunately, as the number of jobs
grows, maintaining them becomes tedious, and the paradigm of using a
UI falls apart. Additionally, the common pattern in this situation is
to copy jobs to create new ones, these "children" have a habit of
diverging from their original "template" and consequently it becomes
difficult to maintain consistency between these jobs.
It enables a programmatic creation o jobs using a Groovy Domain Specific Language.

Resources