Jenkins redirect plugin? - jenkins

I am not super familiar with Jenkins. I just searched the web for "Jenkins Redirect Plugin" but no luck. I renamed a bunch of jobs and turns out it broke all the link names to the previous jobs. So now when one clicks a link in Github they get a 404.
My two options that I can see are:
1. Rename the jobs so they are named incorrectly again. Restoring the old links.
2. Install/write some redirect functionality
Really would like a #2 out there. Any such thing or does this need to be written or maybe there is a #3 out there?

Related

How to solve Dashboard showing "[user] is missing the Overall/Administer permission" after jenkins.war upgrade to 2.263.3

I was about to ask this question - but have managed to find a solution.
Adding question anyway in the hope that it might help others.
AND because I was initially scared to do anything with wizard in case jenkins config got wiped .. or something. So despite seeing the wizard I went all around the houses moving config files, editing different settings before finally finding the very easy solution!
Upgrade from jenkins.war 2.263.3 to 2.375.1 gave some trouble.
Jenkins with workflow and pipelines.
PROBLEM:
Dashboard shows "[user] is missing the Overall/Administer permission"
You can actually use menus and see jobs to some extent but various parts of GUI are not working.
SOLUTION:
Try to login as admin user.
Instead of Dashboard showing the jenkins setup wizard was showing.
Click in the wizard to skip setup and get rid of it.
After that Dashboard shows ok for the admin user and also for other users.
Another thing to watch with this jump upgrade - ssl library has changed and jenkins internal .ssh/config had to have some changes to control legacy ssh keys.
Login as admin user.
Instead of Dashboard showing the jenkins setup wizard was showing.
SOLUTION:
Click in the wizard to skip setup and get rid of it.
After that Dashboard shows ok for the admin user and also for other users.

How to get Jenkins lastBuild API working with multi-branch pipelines?

I've had no problems getting last build details out of Jenkins in the past, but I've struck a weirdly-configured corporate environment, where the API urls are structured like this:
https://example.com/job/group-name/job/project-name/api/json
I can find the last build for a specific branch in this heirarchy:
https://example.com/job/group-name/job/project-name/job/branch-name/lastBuild/api/json
But how to get the last build of a project regardless of branch has defied all my efforts so far.
I can tell you that the obvious (and all non-obvious variations that I've tried) truly, seriously don't work. For instance, this is a complete failure:
https://example.com/job/group-name/job/project-name/lastBuild/api/json
And returns "This page isn’t working example.com redirected you too many times."
I'm guessing that the multiple copies of /job/ in the working URLs are a symptom of an unusual structure, so if anyone has any ideas I'm all ears!

How to start a build via a phrase in Jenkins Pipelines

I am switching from the github pull request builder plugin (for security reasons) and am trying to get the same functionality from Pipelines (using different plugin). I think I have just about everything, however I can't seem to find a way to re-trigger a build simply by a trigger phrase like in github pull request builder plugin. Is that possible via pipelines?
By trigger phrase, I mean that a user can make a comment on the PR saying "Jenkins re-test" and it will kick off the build again.
You can put a condition at the top of the build script to check for the message. You can access the changesets using currentBuild.ChangeSets. The last changeset is at the end of the array. Then you need to access the last element of that changeset. Finally you can access the message via message property. You can then search for your keyword.
I am doing the opposite (not triggering the build with a phrase) but never tried for pullrequests though.
Another idea is to use the "ignore builds with specific message" property and setting this message to be a regex with look ahead that accepts everything except the keyword. I don't really recall the syntax though :/

Jenkins email-ext plugin "ghost" configuration issue

We have an old install of Hudson (ver. 1.379, yes that old...) that hasn't been upgraded yet (and I am not quite sure when and if it will be by the people responsible for it).
There seems to be some place, apparently unaccessible from the web interface, were additional recipients for the email-ext plugin were added...
Problem is, those recipients no longer exist and quite a few people (mostly unrelated to the people who use Hudson) get spammed by bounces from those emails...
For email-ext I get this in the plugin page:
version: 2.12 installed: 2.8
I have looked at the configs and I believe email-ext config should be under "Editable Email Notification" of that job...
I see some of the recipients of those emails but not the person who left, it looks like this was configured elsewhere, maybe manually in some sort of config file.
Where can I look for this?
Thank you!
Puzzled!
There is global configuration. Go to Manage Hudson, then Configure System (the wording my be different based on your version, but you should end up here http://<hudsonurl>/configure. You need to have global administrative permissions to access this, but based on what you are saying, it sound like you do not.
Based on your version of the plugin, under Extended E-mail Notification, you will see Default Recipients. Older versions of the plugin did not have that feature.
Also, under the job configuration itself, there are several places to override/add to the list of recipients, the most buried of which is under the Triggers
Click Advanced... button under Editable Email Notification
For each trigger, click Expand link.
Lastly, it is possible that people are included on the emails cause they were Culprits. In Hudson's terms, these are people who committed to SCM since the last successful build. If the build has been failing since then for a long time, they are just there as culprits. The only way to "reset" the culprits is to let the job build successfully

How can I persist Jenkins status page?

I would like to persist the status page of a Jenkins build job's build (the one which contains commits as well as why the build was triggered).
This should happen in order to get a changelog file.
How am I able to do this?
For being a bit more precise, I would like to persist the content which is shown from
<jenkins-build-server-address>/job/<job-identifier>/<build-number>/api/json?pretty=true
as a file. A separate buildstep inside the buildjob which takes care of this, would be perfect!
If I'm understanding your question correctly, this earlier StackOverflow question "Jenkins: how to save changelog for build" may have the answer.

Resources