jenkins-pipeline

Fetching binary or zipped uploaded files in Jenkins - Windows cannot open the folder . The Compressed(zipped) Folder is invalid

谁都会走 提交于 2020-02-26 04:00:10
问题 This is same/similar question as : Fetching uploaded files in Jenkins But with solution followed per this : Upload file in Jenkins input step to workspace , it is resulting in ' Can not open file 'file1.zip' as archive' Since bytes are manipulated as part of upload process, think may be it is resulting in problem. Tried alternative solution per https://github.com/janvrany/jenkinsci-unstashParam-library - its not helping either as it results in error ''ERROR: unstashParam: No file parameter

Jenkins Pipeline - Run job on parallel on multiple remote hosts

橙三吉。 提交于 2020-02-25 04:00:09
问题 I have a Jenkins job with string parameter Name = "HOST". I am trying to run one script remotely by connecting to the HOST. It works fine. Similarly, if I enter multiple host names in the HOST parameter, the job has to run on those multiple machines on parallel. How to achieve this? If anybody has any code for this, please do share. Appreciate this help! 回答1: An easy way to run a job on different machines in parallel is to use the declarative Matrix Pipeline example: pipeline { agent none

Jenkins Pipeline Step withEnv does not work without BASH

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-24 17:01:45
问题 I've trouble setting an environment variable for a container in an Jenkins pipeline. It seems, that "withEnv" does not work nicely with machines without bash. Can you confirm that? I cannot find an official statement ;-) When I run the following snippet on the Jenkins slave it works. But when it is executed in a docker container without BASH "$test" isn't set. withEnv(["test='asd'"]){ sh 'echo $test' } https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-withenv-code-set

Required context class hudson.FilePath is missing Perhaps you forgot to surroundsuch ..as: node on Jenkins Pipeline

…衆ロ難τιáo~ 提交于 2020-02-23 07:47:10
问题 Error Message [Pipeline] Start of Pipeline [Pipeline] sh [Pipeline] End of Pipeline org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing Perhaps you forgot to surround the code with a step that provides this, such as: node My file Android SDK path on my Mac /Users/bhanukaisuru/Library/Android/sdk I also download android sdk tool only. Path is: /Users/bhanukaisuru/Library Environment Variable Config Jenkins > Configure System

Required context class hudson.FilePath is missing Perhaps you forgot to surroundsuch ..as: node on Jenkins Pipeline

泪湿孤枕 提交于 2020-02-23 07:47:09
问题 Error Message [Pipeline] Start of Pipeline [Pipeline] sh [Pipeline] End of Pipeline org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing Perhaps you forgot to surround the code with a step that provides this, such as: node My file Android SDK path on my Mac /Users/bhanukaisuru/Library/Android/sdk I also download android sdk tool only. Path is: /Users/bhanukaisuru/Library Environment Variable Config Jenkins > Configure System

Jenkins pipeline - Remove @tmp folder

我是研究僧i 提交于 2020-02-22 08:10:26
问题 I am using "Workspace Cleanup Plugin" to clean workspace after the job finishes. But still @tmp directory is not deleted. Any way we can delete this @tmp folder using pipeline script. It looks like a known issue as far as I see in Jira: https://issues.jenkins-ci.org/browse/JENKINS-44909 https://issues.jenkins-ci.org/browse/JENKINS-41805 回答1: I used custom workspace in Jenkins then deleteDir() will not delete @tmp folder. So to delete @tmp along with workspace use following pipeline { agent {

Jenkins pipeline - Remove @tmp folder

≡放荡痞女 提交于 2020-02-22 08:08:59
问题 I am using "Workspace Cleanup Plugin" to clean workspace after the job finishes. But still @tmp directory is not deleted. Any way we can delete this @tmp folder using pipeline script. It looks like a known issue as far as I see in Jira: https://issues.jenkins-ci.org/browse/JENKINS-44909 https://issues.jenkins-ci.org/browse/JENKINS-41805 回答1: I used custom workspace in Jenkins then deleteDir() will not delete @tmp folder. So to delete @tmp along with workspace use following pipeline { agent {

Jenkins pipeline - Remove @tmp folder

天大地大妈咪最大 提交于 2020-02-22 08:06:34
问题 I am using "Workspace Cleanup Plugin" to clean workspace after the job finishes. But still @tmp directory is not deleted. Any way we can delete this @tmp folder using pipeline script. It looks like a known issue as far as I see in Jira: https://issues.jenkins-ci.org/browse/JENKINS-44909 https://issues.jenkins-ci.org/browse/JENKINS-41805 回答1: I used custom workspace in Jenkins then deleteDir() will not delete @tmp folder. So to delete @tmp along with workspace use following pipeline { agent {

Jenkins pipeline - Remove @tmp folder

风流意气都作罢 提交于 2020-02-22 08:06:21
问题 I am using "Workspace Cleanup Plugin" to clean workspace after the job finishes. But still @tmp directory is not deleted. Any way we can delete this @tmp folder using pipeline script. It looks like a known issue as far as I see in Jira: https://issues.jenkins-ci.org/browse/JENKINS-44909 https://issues.jenkins-ci.org/browse/JENKINS-41805 回答1: I used custom workspace in Jenkins then deleteDir() will not delete @tmp folder. So to delete @tmp along with workspace use following pipeline { agent {

How do I know which stage of jenkins pipeline has failed

淺唱寂寞╮ 提交于 2020-02-18 08:10:30
问题 In my Jenkins pipelines I generally use post declarative function to send me an email incase the pipeline has failed. A simple syntax of the post function is as under: post { failure { mail to: 'team@example.com', subject: "Failed Pipeline: ${currentBuild.fullDisplayName}", body: "Something is wrong with ${env.BUILD_URL}" } } In the above email, I also want to mention which stage (lets say the pipeline has 5 to 6 stages) of the pipeline has failed. How can I do that? Any help is much