Jenkins plugin not showing up - jenkins

probably a newbish question, but that's what I am. I need to run a post build script, so I installed the post-build-task plugin onto my Jenkins server (v2.5). For some reason, when I go to the job configuration page, there is no checkbox or anything for the plugin. Is there some common pitfall I am stepping into or something?
Edit: I have restarted the server.

So it was a blatantly simple issue. The job I was working in was a pipeline, and it needed to be a freestyle project.

Restarting will update the plugins..

Related

Re connect SonarQube with Jenkins

I have the next problem. We have the lastest LTS versions from Sonarqube and Jenkins. Both are connect and run without problem.
Now we want to change Sonarqube host. For example:
Before:
http://our-url:9000/sonar
Now:
http://our-url:9000
We clone the server to test if all works fine or not. Change URL from Sonarqube inside Jenkins and run a test project and everything is fine but when we wanna see the existing projects they are not linked to Sonarqube. Thats the problem.
Somebody knows how re connect that project again? Without run another test? Well, if it's possible.
Thanks.
I suggest you to create a webhook on sonar-side:
https://<your Jenkins instance>/sonarqube-webhook/
If you use pipeline you can find useful info at: https://blog.sonarsource.com/breaking-the-sonarqube-analysis-with-jenkins-pipelines/
If someone have this weird and unusual problem, you can solved it if you go to Jenkins folder > Jobs > Your Job > build > # of the builds (need to edit all) > Edit the text file. Then search the sonarqube URL and edit it.
Cheers!!

Jenkins Crashes after installing GitHub Plugin

I have a question about updating GitHub plugin.
Everytime I do an update plugin such as GitHub and restart the jenkins, Jenkins start crashing. when I try to access jenkins through URL in my browser, the error page shows up with some exception "class not found jenkins/model jenkins" . and then in order to make jenkins working again , I have to delete the plugin entirely from the plugins directory. I wish someone has an answer for this because I really need to make my github projects available to jenkins for build. Thanks
It is a very usual problem with Jenkins. My workaround was to either update the jenkins (where ever it is installed) and restarting the hudson service.
sometimes even restarting the service works.
often you might need to remove those plugins from within (/var/lib/hudson/plugins/) and restart the service.

jenkins missing jobs after removal of plugins

I have a Jenkins Server (1.510) on Win 2008 with ~100 jobs.
After installing and then uninstalling the CloudBees (Plugin_1, Plugin_2) set of plugins + restart I have the following issues:
half of the Jobs are now missing.
many plugins are not functioning well, for example the green-balls plugin is not working and also the entry to launch the backup plugin is missing
many built in Jenkins buttons such the new "Credentials" is missing from the "Jenkins Configure" Menu.
Looking at the FS, i still see all the jobs.
I already tried :
Using the reload configuration
Reinstalling the plugins
Reinstalling Jenkins with the same version once again
Still the jobs are missing
Any idea how to solve it?
Thanks,
Doron
When job is loaded, many of the related Java classes get instantiated. If instantiation fails, usually because some plugin has been removed and that class is no longer available at all, then the job is hidden.
I suspect you have accidentally removed some other plugin too.
Note: Before actually doing anything, take full backup! Easiest is to backup entire Jenkins folder, where the jobs, configuration etc reside.
Easiest solution might be to just install Jenkins from scratch, install the plugins you do need (see below for troubleshooting if you're missing some), then copy the jobs subfolder to the new Jenkins. It might be best to do any configuration under Manage Jenkins by hand, but you can also just try copying the related XML config files.
If you are missing a plugin and can't figure out which one, you should look at jenkins.out.log and jenkins.err.log log files and search for exceptions happening after Jenkins is started. That may give you a clue on what plugin you are missing.
You can also try editing the job XML files to remove build steps you identified from the exceptions (remember to take backups first!), then restart Jenkins or select Reload configuration from disk from Manage Jenkins page.
If not solved, but you find relevant-looking exceptions or something else interesting, please update the question with details.
After I upgraded Jenkins, one of my jobs disappeared. I found out that although my job directory still existed, the config.xml file inside had somehow gone missing.
I restored this file from a backup, after updating all the plugins that needed updating, and reloaded the configuration, and the job reappeared in Jenkins.

Jenkins Update Loses Old Jobs

I am on a redhat linux box. I recently updated Jenkins to version 1.509 only to find that after doing so it has "forgotten" two of my jobs/projects. The jobs can still be found on my Jenkins machine under /var/lib/jenkins/jobs, but they no longer show up in the Jenkins GUI. I attempted to re-create them based off the configuration file I have, but I am not confident I have totally re-created the functionality they had.
I also tried to copy the job and or rename it hoping that would get jenkins to see it, but no luck. I had tried cp -r /var/lib/jenkins/jobs/JOB1 /var/lib/jenkins/jobs/JOB2. I also restarted the service a number of times. Finally I updated all of my plugins on the off chance that was somehow related.
So my question is "How can I get Jenkins to notice these jobs?" or failing that "can I run these jobs from in the terminal?"
NOTE: I am not discouraging others from upgrading Jenkins. After I upgraded Jenkins did complain about a number of things which I didn't pay enough attention to which I believe got me into this mess in the first place.
If I were you, I would try the Jenkins CLI (from $JENKINS_URL/cli) and use the create-job command and feed the job configuration file to the cli's stdin.
If that does not help, I would inspect Jenkins log files (you are saving stdout and stderr of Jenkins somewhere, right?) for any errors or clues. If the job failed to load because of some tag that you can guess is provided by a plugin, try to remove that part from the config file.
If that does not help, I would upgrade Jenkins. I think there might be some fixes related to this in the LTS version changelog since 1.509.
And above all... if I were you, I would start making backups of the job configuration files.
I regularly back up the global config.xml, all the job config.xml files and all the plugins. Using these I can set up my Jenkins from scratch. And I do that to set up a test instance where I try any plugin or Jenkins core upgrade. If I see no problems after running a few of the trickiest builds, I know I can upgrade the production instance with much more confidence.

Jenkins Post build deploy

I am using Jenkins CI in my project, I am able to successfully build the project and I have no issues in deploying it in the container after every successful build. Now I have a condition that the deployment to the container has to happen only if there is a change in the release properties file. If there is no change in the release properties file then the project has to be built but no deployment should happen.
Since I am new to Jenkins I am trying out all the options, I am sure that someone must have been in the similar situation, please share your thoughts or ideas. Incase if I find something I will post it.
Highly Appreciate your help on this.
If this is still not answered!!
This can we easily done using Script Trigger plugin.
This allows you to run a shell/batch script and based on the exit code of this script the build will be executed.
You can keep track of the last modified date of the properties file and if it changed then you can go ahead and build, if not there will not be any build until the change happens.
Hope this helps (if at all required now ;)
You should install the "Post-Build Script Plug-in" in your Jenkins. The previous answer was mentioning a plugin that is no longer available.
Then you can add sub build steps, like executing a shell script
script
You can also publish a Docker container, etc.

Resources