Jenkins

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: pass multiple “Extended Choice Parameter” values using a URL

流过昼夜 提交于 2020-06-24 11:48:25
问题 One of the parameters in my Jenkins build is an Extended Choice Parameter which is submitted as a selection of comma separated values when invoking the build from the build webpage. However, I also need to invoke the build using wget + URL . So, in the format: wget "${JENKINS_URL}/job/buildname/buildWithParameters?ECP_LIST=blah1&token=token" Say my Extended Choice Parameter ECP_LIST has possible values: blah1, blah2, blah3, blah4. if I invoke, for example: wget "${JENKINS_URL}/job/buildname

Jenkins + Docker: How to control docker user when using Image.inside command

自古美人都是妖i 提交于 2020-06-24 07:04:50
问题 Dear Stackoverflow Community, I am trying to setup a Jenkins CI pipeline using docker images as containers for my build processes. I am defining a Jenkinsfile to have a build pipeline as code. I am doing something like this: node { docker.withRegistry('http://my.registry.com', 'docker-credentials') { def buildimage = docker.image('buildimage:latest'); buildimage.pull(); buildimage.inside("") { stage('Checkout sources') { git url: '...', credentialsId: '...' } stage('Run Build and Publish') {

Error env: ruby_executable_hooks: No such file or directory while running Slather on Jenkins

随声附和 提交于 2020-06-18 20:25:41
问题 I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server. Here is the script I am running through slather slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home

Error env: ruby_executable_hooks: No such file or directory while running Slather on Jenkins

不想你离开。 提交于 2020-06-18 20:24:06
问题 I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server. Here is the script I am running through slather slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home

Jenkins Agent Cannot run program “docker”: error=2, No such file or directory

浪尽此生 提交于 2020-06-17 15:03:33
问题 I have a strange behaviour with my jenkins agent. i have a master and a seperate build agent, which has access to docker. while i'm running the following pipeline script on the build agent: node { sh "id" sh "echo $PATH" sh "docker ps" docker.image("node:latest").inside("") { sh "npm --version" } } i get the following output: Running on docker-agent in /home/jenkins/workspace/test [Pipeline] { [Pipeline] sh [test] Running shell script + id uid=1000(jenkins) gid=1000(jenkins) groups=900(docker

Adding a “Are you sure …” dialog in GCP cloudbuild.yaml

二次信任 提交于 2020-06-17 09:50:08
问题 Basically, I want to add a "Are you sure you want to run unit tests ?" dialog before step 2(run_test_test-coverage) in my cloudbuild.yaml . How can I do that ? This can be done in jenkins but don't know how to do the same in GCP cloudbuild. cloudbuild.yaml steps: - name: 'node:10.10.0' id: installing_npm args: ['npm', 'install'] dir: 'API/system_performance' - name: 'node:10.10.0' id: run_test_test-coverage args: ['npm', 'run', 'coverage'] dir: 'API/system_performance' Edit: Below is my

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

SCP from Windows to Linux using Jenkins pipeline script

跟風遠走 提交于 2020-06-16 19:13:12
问题 I want to do SCP from Windows Jenkins node to Linux server. In this set up, Windows machine is a Jenkins slave and the target server where i want to copy is Linux. Below is my Jenkins pipeline script. Before the below script runs, i am cloning the repository and then building the project which finally creates a .jar file. I want to copy this file to Linux server. stage('SCP JAR file') { steps { bat 'scp /c/Jenkins/workspace/migration/test-project/build/libs/ssupservice-0.0.1-SNAPSHOT.jar

Calling internal methods of Jenkins plugin (thinBackup)

谁说我不能喝 提交于 2020-06-16 05:57:11
问题 I need to call internal functions of some Jenkins plugins that do not seem to be exposed via Jenkins CLI or remote api. For example, one of them is thinBackup and I'd like to call restore method avialable at https://github.com/jenkinsci/thin-backup-plugin/blob/master/src/main/java/org/jvnet/hudson/plugins/thinbackup/restore/HudsonRestore.java . Is this possible using Java or Groovy (or any other method really, the simpler, the better)? 回答1: You can set up dependencies between plugins as