jenkins-plugins

Jenkins stapler requests fail with no valid crumb

女生的网名这么多〃 提交于 2021-02-07 14:44:38
问题 I'm working on a Jenkins plugin and I'm now stuck at a point where I'm trying to get the return value of a method using a JavaScript proxy as described here. I simply want to call this kotlin method: @JavaScriptMethod fun getMonitoredJobsAsJSON(): JSONArray = toJSON(getObjectMapper().writeValueAsString(getMonitoredJobs())) as JSONArray From the jelly script using this: <script> var board = <st:bind value="${it}"/> board.getMonitoredJobsAsJSON(function(data) { // }) </script> This actually

Jenkins stapler requests fail with no valid crumb

两盒软妹~` 提交于 2021-02-07 14:42:05
问题 I'm working on a Jenkins plugin and I'm now stuck at a point where I'm trying to get the return value of a method using a JavaScript proxy as described here. I simply want to call this kotlin method: @JavaScriptMethod fun getMonitoredJobsAsJSON(): JSONArray = toJSON(getObjectMapper().writeValueAsString(getMonitoredJobs())) as JSONArray From the jelly script using this: <script> var board = <st:bind value="${it}"/> board.getMonitoredJobsAsJSON(function(data) { // }) </script> This actually

how to copy files from a directory outside the workspace to workspace in Jenkins pipeline

送分小仙女□ 提交于 2021-02-07 08:12:38
问题 I'm starting with Jenkins pipelines, and I want to copy some video files from outside any jenkins directory to my job workspace directory. I'm using the File Operations Plugin to perform some file operations for other jobs I have. With that plugin, I'm able to copy files from inside my workspace to outside: fileOperations([fileCopyOperation(excludes: '', flattenFiles: false, includes: "videos\\*.MTS", targetLocation: "H:\\home\\Videos")]) With this step, for example, I can copy 4 video files

how to copy files from a directory outside the workspace to workspace in Jenkins pipeline

醉酒当歌 提交于 2021-02-07 08:11:31
问题 I'm starting with Jenkins pipelines, and I want to copy some video files from outside any jenkins directory to my job workspace directory. I'm using the File Operations Plugin to perform some file operations for other jobs I have. With that plugin, I'm able to copy files from inside my workspace to outside: fileOperations([fileCopyOperation(excludes: '', flattenFiles: false, includes: "videos\\*.MTS", targetLocation: "H:\\home\\Videos")]) With this step, for example, I can copy 4 video files

How to set environment variable from a job and use it in next job in jenkins?

百般思念 提交于 2021-02-07 06:19:07
问题 I want to have a job to set the environment variable and use these environment variables in all the next jobs. How can I set environment variable through Jenkins ? 回答1: Technically, you can't pass env variables from one job to the next, and I'm not aware of a plugin to do that out of the box. There is a technique however. The idea is to create a properties file in the first job (e.g. exported.properties), add that file to the job artifacts, and then import this file via the EnvInject plugin

JSON report for Karate Framework

大城市里の小女人 提交于 2021-02-05 08:56:30
问题 How can I produce a JSON report while using karate framework so that I can use it in JENKINS using the cucumber reports plugin. My Karate version are: karate-apache - 0.8.0 karate-junit4 - 0.8.0 回答1: You really should read the docs: https://github.com/intuit/karate/tree/master/karate-demo#example-report <dependency> <groupId>net.masterthought</groupId> <artifactId>cucumber-reporting</artifactId> <version>3.8.0</version> <scope>test</scope> </dependency> public static void generateReport

Not able to make Jenkins perforce plugin to work with ssh

狂风中的少年 提交于 2021-02-05 06:50:47
问题 I am not quite familiar with Jenkins but for some reason I am not able to make the perforce plugin to work. I will list down the problem and what I have tried so as to get a better understanding. Jenkins Version - 1.561 Perforce Plugin Version - 1.3.27 (I have perforce path configured in Jenkins) System - Ubuntu 10.04 Problem: In the Source Code Management's Project Details section ( when you try to configure a new job ) I get " Unable to check workspace against depot " error. P4PORT(hostname

Not able to make Jenkins perforce plugin to work with ssh

£可爱£侵袭症+ 提交于 2021-02-05 06:50:34
问题 I am not quite familiar with Jenkins but for some reason I am not able to make the perforce plugin to work. I will list down the problem and what I have tried so as to get a better understanding. Jenkins Version - 1.561 Perforce Plugin Version - 1.3.27 (I have perforce path configured in Jenkins) System - Ubuntu 10.04 Problem: In the Source Code Management's Project Details section ( when you try to configure a new job ) I get " Unable to check workspace against depot " error. P4PORT(hostname

Kubernetes - Jenkins slaves are offline

十年热恋 提交于 2021-02-04 08:09:14
问题 I am trying to run jenkins with kubernetes. I am able to make a successful connection to kubernetes using jenkins kubernetes plugin. Now, I am running a pipeline example, but while running, I always get an error saying: Still waiting to schedule task ‘default-amd64-cm2rx’ is offline And it hangs there. If I check pods using kubectl get pods , I see that the pod default-amd64-cm2rx was running, then state changed to completed and then it was gone. Then another pod with similar name, started

Kubernetes - Jenkins slaves are offline

半城伤御伤魂 提交于 2021-02-04 08:09:08
问题 I am trying to run jenkins with kubernetes. I am able to make a successful connection to kubernetes using jenkins kubernetes plugin. Now, I am running a pipeline example, but while running, I always get an error saying: Still waiting to schedule task ‘default-amd64-cm2rx’ is offline And it hangs there. If I check pods using kubectl get pods , I see that the pod default-amd64-cm2rx was running, then state changed to completed and then it was gone. Then another pod with similar name, started