jenkins-pipeline

Jenkins declarative pipeline throws org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified getAt method

戏子无情 提交于 2021-01-27 12:44:37
问题 I have defined a shared library in Jenkins: import com.codependent.jenkins.pipelines.Utils def call(List<String> mavenGoals){ def processedMavenGoals = mavenGoals.join ' ' pipeline { agent any ... } If i call this from my project's Jenkinsfile like this it works ok: #!groovy @Library('jenkins-pipeline-shared-library-example') _ buildPipeline(['clean', 'install']) However if I omit the parethesis as Groovy syntax allows: #!groovy @Library('jenkins-pipeline-shared-library-example') _

How to trigger Multibranch Pipeline Jenkins Job within regular pipeline job?

一世执手 提交于 2021-01-27 05:31:12
问题 I want to trigger a specific multibranch pipeline job ' maven-release-workflow-test ' (specific branch) within a regular pipeline job. Is there a special build() command pattern that i need to specify? The snippet generator just prints: no such job maven-release-workflow-test 回答1: Found the right pattern via trial and error: build 'maven-release-workflow-test/master' 来源: https://stackoverflow.com/questions/37322143/how-to-trigger-multibranch-pipeline-jenkins-job-within-regular-pipeline-job

How to trigger Multibranch Pipeline Jenkins Job within regular pipeline job?

久未见 提交于 2021-01-27 05:30:31
问题 I want to trigger a specific multibranch pipeline job ' maven-release-workflow-test ' (specific branch) within a regular pipeline job. Is there a special build() command pattern that i need to specify? The snippet generator just prints: no such job maven-release-workflow-test 回答1: Found the right pattern via trial and error: build 'maven-release-workflow-test/master' 来源: https://stackoverflow.com/questions/37322143/how-to-trigger-multibranch-pipeline-jenkins-job-within-regular-pipeline-job

How to Backup Jenkins using Jenkinsfile

拈花ヽ惹草 提交于 2021-01-26 03:04:50
问题 How To do Jenkins jobs configuration backup using Jenkinsfile without plugins? things to be backup : system configuration {jenkins} jobs configuration 回答1: We were not happy with the plugins backup solutions, so we have a freestyle shell step job run on master (usually a no-no, so only allow managed special task like backup to run there) with a simple tar cmd, one for system config (xmls, keys, etc), one for jobs (excluding logs 'n stuff). System backup In ${JENKINS_HOME} , you'll want to

How to Backup Jenkins using Jenkinsfile

久未见 提交于 2021-01-26 03:04:08
问题 How To do Jenkins jobs configuration backup using Jenkinsfile without plugins? things to be backup : system configuration {jenkins} jobs configuration 回答1: We were not happy with the plugins backup solutions, so we have a freestyle shell step job run on master (usually a no-no, so only allow managed special task like backup to run there) with a simple tar cmd, one for system config (xmls, keys, etc), one for jobs (excluding logs 'n stuff). System backup In ${JENKINS_HOME} , you'll want to

How to Backup Jenkins using Jenkinsfile

♀尐吖头ヾ 提交于 2021-01-26 03:04:05
问题 How To do Jenkins jobs configuration backup using Jenkinsfile without plugins? things to be backup : system configuration {jenkins} jobs configuration 回答1: We were not happy with the plugins backup solutions, so we have a freestyle shell step job run on master (usually a no-no, so only allow managed special task like backup to run there) with a simple tar cmd, one for system config (xmls, keys, etc), one for jobs (excluding logs 'n stuff). System backup In ${JENKINS_HOME} , you'll want to

Jenkins pipeline - No such DSL method 'build'

偶尔善良 提交于 2021-01-25 06:54:22
问题 I am using below Groovy Script in Jenkins Pipeline to call a Free style job but it ends up with "No such DSL method 'build'" error. node{ def branches = [:] List rows =["Test2", "Test1"] for (int i = 0; i <rows.size(); i++) { def index = i String db = rows[i] branches["branch${i}"] = { build job: 'CopyFile', parameters: [[$class: 'StringParameterValue', name: 'DatabaseName', value: db], [$class: 'StringParameterValue', name:'dummy', value: "${index}"]] } } parallel branches } 回答1: Installing

Jenkins pipeline - No such DSL method 'build'

好久不见. 提交于 2021-01-25 06:52:13
问题 I am using below Groovy Script in Jenkins Pipeline to call a Free style job but it ends up with "No such DSL method 'build'" error. node{ def branches = [:] List rows =["Test2", "Test1"] for (int i = 0; i <rows.size(); i++) { def index = i String db = rows[i] branches["branch${i}"] = { build job: 'CopyFile', parameters: [[$class: 'StringParameterValue', name: 'DatabaseName', value: db], [$class: 'StringParameterValue', name:'dummy', value: "${index}"]] } } parallel branches } 回答1: Installing

Permission denied error - jenkins (shell script)

℡╲_俬逩灬. 提交于 2021-01-23 05:33:14
问题 I'm using a jenkinsfile to test one of our instances. For this I created a bash script. Problem is that jenkins doesn't have permissions to run the script. Any idea how to fix this? Jenkinsfile: stage("Testing instances"){ if (terragruntAction == 'apply' || terragruntAction == 'test'){ echo "Testing" sh '../check_services.sh' } } output: ../check_services.sh: Permission denied I tried to do: git update-index --chmod=+x check_services.sh on the git folder that gets checkouted by Jenkins but no

Jenkins configurations gets reverted by SYSTEM user anomaly

狂风中的少年 提交于 2021-01-21 10:02:08
问题 I am running Jenkins version 2.85 on Kubernetes as pod(Affinity set to one workernode). I am creating Jobs using Salt Jenkins module by passing XML to this module. I am using Jenkins Global Library for preforming job execution. My Job config looks like this I am calling GobalLibrary with my parameters like repoURL, componet etc.., Things goes well for weeks and now I landed to a weird situation where my job configurations(config.xml) gets updated/revert automatically. Intermittently my "Build