jenkins-plugins

Rest API in Jenkins to get the Pipeline (stages) information

可紊 提交于 2020-07-20 08:42:04
问题 I'm exploring the options to get the pipeline (stages) information in Jenkins through Rest API. We had a pipeline plug-in installed on Jenkins. Any help on same is highly appreciated. 回答1: You can use this endpoint to get the pipeline runs: https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api#get-jobjob-namewfapiruns Each run blob should contain the corresponding stages, so you can extract the stages of the latest run. 来源: https://stackoverflow.com/questions/50594486

Where does the jenkins shared library files get stored?

﹥>﹥吖頭↗ 提交于 2020-07-06 09:47:29
问题 The shared library files in jenkins are loaded at the beginning of the job, where does it get stored? I am trying to access the dockerfile stored in the shared library, I need the path to give in the docker build command. Is there a way I can find out the place where the shared library files are loaded in jenkins? 回答1: If the shared library is loaded from SCM and your workspace path is jenkins/workspaces/jobName , then a copy is checked out to jenkins/workspaces/jobName@libs or similar (might

Trigger build only on pushes to master

大兔子大兔子 提交于 2020-06-25 08:21:27
问题 I am using Jenkins with the Github Plugin I have integrated it using GitHub's webhooks and it works like a charm, except that builds get triggered everytime something is pushed to the repository. Is there a way to limit builds only when a change to the remote branch master has been made? 回答1: Action Plan Open the Jenkins job Configuration Go to the section Source Code Managment In the Git section For the field Branches to build add the value */master This tells this Jenkins Job, to only

Trigger build only on pushes to master

只愿长相守 提交于 2020-06-25 08:20:47
问题 I am using Jenkins with the Github Plugin I have integrated it using GitHub's webhooks and it works like a charm, except that builds get triggered everytime something is pushed to the repository. Is there a way to limit builds only when a change to the remote branch master has been made? 回答1: Action Plan Open the Jenkins job Configuration Go to the section Source Code Managment In the Git section For the field Branches to build add the value */master This tells this Jenkins Job, to only

Programmatically getting Jenkins configuration for a plugin

旧城冷巷雨未停 提交于 2020-06-24 12:53:16
问题 I'm trying to get (and hopefully change) the Jenkins configuration for a plugin with a Groovy script inside the Groovy console. My specific example is to try to change multiple IP addresses for the publish-over-ssh plugin. It's pretty easy to do via the command line (editing the xml), but after hours of struggling with it, I'd still like to find how it would be done via the groovy console, for no other reason than the enlightenment. I've looked through the Jenkins API javadoc, but to no avail

jenkins failed to install plugins - docker image

こ雲淡風輕ζ 提交于 2020-06-17 02:36:45
问题 Below is the relevant snippet from jenkins image(2.190.2 version) for installation of plugins: FROM jenkins/jenkins:2.190.2 #...... # ...... # Add jenkins plugin COPY plugins.txt /usr/share/jenkins/plugins.txt RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt where below plugins.txt list was prepared at the time of jenkins 1.642.1 version: git:latest git-client:latest git-server:latest github:latest github-api:latest github-branch-source:latest docker-commons:latest docker-workflow

Auto-increment release version Jenkins

我是研究僧i 提交于 2020-06-09 11:38:48
问题 I have an application that builds in Jenkins and that I want to deploy to Octopus. When I am doing this I have to create a release version that is send to Octopus. For this release version I have to give a number (ex: "C:\Octopus\Octo.exe" create-release --project APP --version 4.8 --packageversion=4.8 ) How can I make so that version number will be auto-incremented ? (ex: I have build the application and created in Octopus the release version number 4.8, the next time I build the application

Jenkins - Is there a way to remove all offline nodes (slaves) / batch remove nodes / delete all nodes?

旧时模样 提交于 2020-06-09 08:47:08
问题 While using the Jenkins Docker Plugin, probably because of an error, swarms cannot be launched. I didn't pay attention and at the moment I have thousands of offline nodes, that were failed to launch. BOTTOM LINE - Is there a way to batch remove nodes (slaves) in Jenkin, clean all offline nodes or even delete all nodes? Restating the Jenkins server didn't help, and I couldn't find a way in the Jenkins API. Will appreciate any idea, before I'm starting to write a Selenium script or something...

unzip file is not working in jenkins pipeline script

帅比萌擦擦* 提交于 2020-06-09 07:05:28
问题 i am trying to unzip files in my Jenkins pipeline script.but t dint work.Below is my jenkins pipeline code stage('unzip') { steps{ script { unzip dir: 'E:\\package', glob: '', zipFile: 'test.zip' } } } i am getting error while running the code in my pipeline.How to resolve the issue. I am getting error "java.io.IOException" file not found 来源: https://stackoverflow.com/questions/61862780/unzip-file-is-not-working-in-jenkins-pipeline-script

How to pass dynamic values to an environment block during the pipeline execution in Jenkins?

人盡茶涼 提交于 2020-05-17 07:12:05
问题 This is related to one question I asked before: Using groovy to parse JSON object in shell scripts for Jenkin basically I will need to pass a dynamic value as returned from sh scripts to an environment block, so that the following stage can re-use that value and pass the version as a label to JIRA plugin called Xray. But I aware that I cannot pass dynamic values to an environment block during the pipeline execution. So, I think I am going to need try a different route for that, not sure if