jenkins-pipeline

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

Using the JUnitFlakyTestDataPublisher throws an AbstractMethodError “you must override contributeTestData”

我怕爱的太早我们不能终老 提交于 2020-05-30 06:31:36
问题 I try to use the rerunFailingTestsCount option to deal with flaky tests. In order to display these in the junit results, I use the flaky test handler plugin which would theoretically deal with displaying flaky tests In my jenkins file this looks like pipeline { stages { stage('tests') { steps{ // sh mvn verify here } post { always { junit testResults: 'target/failsafe-reports/**/*.xml', testDataPublishers: [[$class: 'JUnitFlakyTestDataPublisher']] } } } } } the test run fine, flaky ones are

Using the JUnitFlakyTestDataPublisher throws an AbstractMethodError “you must override contributeTestData”

允我心安 提交于 2020-05-30 06:31:25
问题 I try to use the rerunFailingTestsCount option to deal with flaky tests. In order to display these in the junit results, I use the flaky test handler plugin which would theoretically deal with displaying flaky tests In my jenkins file this looks like pipeline { stages { stage('tests') { steps{ // sh mvn verify here } post { always { junit testResults: 'target/failsafe-reports/**/*.xml', testDataPublishers: [[$class: 'JUnitFlakyTestDataPublisher']] } } } } } the test run fine, flaky ones are

Mark Jenkins build as success, in case of timeout on input? (declarative pipeline)

时光总嘲笑我的痴心妄想 提交于 2020-05-28 13:48:48
问题 I'm creating a declarative Jenkins pipeline, that looks like this: pipeline { agent { label 'mylabel' } stages { stage('Install dependencies') { milestone() steps { sh "yarn install" } } stage('Lint files') { steps { sh "eslint src" } } stage('Create bundle') { steps { sh "yarn run build:server" sh "yarn run build:client" } } stage('Publish') { steps { timeout(time: 15, unit: 'SECONDS') { input(message: 'Deploy this build to QA?') } // deployment steps } } } } It works great, however, if the

Mark Jenkins build as success, in case of timeout on input? (declarative pipeline)

六眼飞鱼酱① 提交于 2020-05-28 13:47:22
问题 I'm creating a declarative Jenkins pipeline, that looks like this: pipeline { agent { label 'mylabel' } stages { stage('Install dependencies') { milestone() steps { sh "yarn install" } } stage('Lint files') { steps { sh "eslint src" } } stage('Create bundle') { steps { sh "yarn run build:server" sh "yarn run build:client" } } stage('Publish') { steps { timeout(time: 15, unit: 'SECONDS') { input(message: 'Deploy this build to QA?') } // deployment steps } } } } It works great, however, if the

Mark Jenkins build as success, in case of timeout on input? (declarative pipeline)

守給你的承諾、 提交于 2020-05-28 13:45:56
问题 I'm creating a declarative Jenkins pipeline, that looks like this: pipeline { agent { label 'mylabel' } stages { stage('Install dependencies') { milestone() steps { sh "yarn install" } } stage('Lint files') { steps { sh "eslint src" } } stage('Create bundle') { steps { sh "yarn run build:server" sh "yarn run build:client" } } stage('Publish') { steps { timeout(time: 15, unit: 'SECONDS') { input(message: 'Deploy this build to QA?') } // deployment steps } } } } It works great, however, if the

Jenkins Pipeline - global pipeline library updates show up in job's list of recent changes, how to prevent this?

浪尽此生 提交于 2020-05-26 07:58:53
问题 I don't want my global pipeline changes to show up in Jenkins list of changes. Whenever a build is ran and there are global pipeline updates, the list of changes for that build include all updates made to the global pipeline. I only want the list of changes that the build picked up from the SCM branch that is being built, not any of the global pipeline updates. Is this possible? 回答1: Such option to disable the changelog exists since version 2.9 of the Pipeline Shared Groovy Libraries Plugin:

Jenkins Pipeline - global pipeline library updates show up in job's list of recent changes, how to prevent this?

北战南征 提交于 2020-05-26 07:57:48
问题 I don't want my global pipeline changes to show up in Jenkins list of changes. Whenever a build is ran and there are global pipeline updates, the list of changes for that build include all updates made to the global pipeline. I only want the list of changes that the build picked up from the SCM branch that is being built, not any of the global pipeline updates. Is this possible? 回答1: Such option to disable the changelog exists since version 2.9 of the Pipeline Shared Groovy Libraries Plugin:

can not create file via Groovy code(or java code) in jenkinsfile of a pipeline job on Jenkins

被刻印的时光 ゝ 提交于 2020-05-23 10:07:28
问题 pipeline { agent any stages { stage('Build') { steps { echo 'Building..' echo "whoami".execute().text script { File f = new File('/home/jenkins/test2.txt'); f.createNewFile(); } } } stage('Test') { steps { echo 'Testing..' } } stage('Deploy') { steps { echo 'Deploying....' } } } } Jenkins console log: (got exception: Started by user Edgar Yu Running in Durability level: MAX_SURVIVABILITY [Pipeline] node Running on Jenkins in /var/jenkins_home/workspace/test2 [Pipeline] { [Pipeline] stage

Hide command executed, only show output

前提是你 提交于 2020-05-23 08:03:47
问题 I want to hide jenkins sh execute command in pipeline pipeline { agent any stages { stage('Load Lib') { steps { sh "ls -al /" } } } } Current result: [Pipeline] { [Pipeline] stage [Pipeline] { (Load Lib) [Pipeline] sh [Test] Running shell script + ls -al / I want to hide Running shell script ls -al / command in output. Please help 回答1: This is definitely related to Echo off in Jenkins Console Output For pipeline, what this means is: pipeline { agent any stages { stage('Load Lib') { steps { sh