Jenkins

Preserve Jenkins workspace

我怕爱的太早我们不能终老 提交于 2020-06-12 04:40:26
问题 I have Jenkins set up to run concurrent builds, so I end up with workspace, workspace@2, workspace@3, etc. If Jenkins thinks the build is finished, a new build will overwrite the workspace. Is there a way of occasionally preventing that? E.g. Don't overwrite workspace@3 until I say. We have various scenarios where this would be very useful. 回答1: You could simply archive the complete workspace at the end of a build. It would then get deleted when the job is deleted. To do this: Add post-build

Preserve Jenkins workspace

泄露秘密 提交于 2020-06-12 04:40:09
问题 I have Jenkins set up to run concurrent builds, so I end up with workspace, workspace@2, workspace@3, etc. If Jenkins thinks the build is finished, a new build will overwrite the workspace. Is there a way of occasionally preventing that? E.g. Don't overwrite workspace@3 until I say. We have various scenarios where this would be very useful. 回答1: You could simply archive the complete workspace at the end of a build. It would then get deleted when the job is deleted. To do this: Add post-build

Skipping JaCoCo execution due to missing execution data error

↘锁芯ラ 提交于 2020-06-11 17:02:29
问题 I am getting Skipping JaCoCo execution due to missing execution data file:/scratch/jenkins/workspace/sonar-test/target/jacoco.exec error My pom profile is: <profile> <id>test-coverage</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven.surefire.plugin.version}</version> <configuration combine.self="override"> <redirectTestOutputToFile>true</redirectTestOutputToFile> <testFailureIgnore>true<

Using failFast with closure map breaks “parallel” step

梦想的初衷 提交于 2020-06-10 07:36:02
问题 Not sure if it's my limited knowledge of Groovy or a quirk in Pipeline parallel step. I can't make it accept failFast if I use map instead of passing each closure individually: def map = [:] map['spam'] = { node { echo 'spam' } } map['eggs'] = { node { echo 'eggs' } } parallel map // Works. parallel spam: map['spam'], eggs: map['eggs'], failFast: true // Works. parallel map, failFast: true // Fails with exception. The exception with failFast is: java.lang.IllegalArgumentException: Expected

Jenkins Pipeline docker.build() gives error '“docker build” requires exactly 1 argument(s)'

五迷三道 提交于 2020-06-09 16:43:28
问题 With this minimal Jenkins Pipeline script node { docker.build("foo", "--build-arg x=y") } I'm getting a confusing error "docker build" requires exactly 1 argument(s). But as per the documentation, the signature of docker.build() is build(image[, args]) (from Jenkins /job/dockerbug/pipeline-syntax/globals#docker ) build(image[, args]) Runs docker build to create and tag the specified image from a Dockerfile in the current directory. Additional args may be added, such as '-f Dockerfile.other -

kill iOS Simulator from terminal

倖福魔咒の 提交于 2020-06-09 12:14:59
问题 I'm trying to terminate the iOS Simulator from the terminal console (needed for integrating automatic UI Testing in Jenkins),but every time I try the command: killall SimulatorBridge a prompt waiting for action gets displayed: The problem is that the simulator doesn't get dismissed until an action on the prompt is taken. How to get rid of it? 回答1: Use killall "iPhone Simulator" With XCode 6, use killall "iOS Simulator" (thanks @gempewsaw) With XCode 7, use killall "Simulator" (thanks

kill iOS Simulator from terminal

瘦欲@ 提交于 2020-06-09 12:14:30
问题 I'm trying to terminate the iOS Simulator from the terminal console (needed for integrating automatic UI Testing in Jenkins),but every time I try the command: killall SimulatorBridge a prompt waiting for action gets displayed: The problem is that the simulator doesn't get dismissed until an action on the prompt is taken. How to get rid of it? 回答1: Use killall "iPhone Simulator" With XCode 6, use killall "iOS Simulator" (thanks @gempewsaw) With XCode 7, use killall "Simulator" (thanks

Auto-increment release version Jenkins

我是研究僧i 提交于 2020-06-09 11:38:48
问题 I have an application that builds in Jenkins and that I want to deploy to Octopus. When I am doing this I have to create a release version that is send to Octopus. For this release version I have to give a number (ex: "C:\Octopus\Octo.exe" create-release --project APP --version 4.8 --packageversion=4.8 ) How can I make so that version number will be auto-incremented ? (ex: I have build the application and created in Octopus the release version number 4.8, the next time I build the application

Jenkins - Is there a way to remove all offline nodes (slaves) / batch remove nodes / delete all nodes?

旧时模样 提交于 2020-06-09 08:47:08
问题 While using the Jenkins Docker Plugin, probably because of an error, swarms cannot be launched. I didn't pay attention and at the moment I have thousands of offline nodes, that were failed to launch. BOTTOM LINE - Is there a way to batch remove nodes (slaves) in Jenkin, clean all offline nodes or even delete all nodes? Restating the Jenkins server didn't help, and I couldn't find a way in the Jenkins API. Will appreciate any idea, before I'm starting to write a Selenium script or something...

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