New answers tagged

0

Since Jenkins runs commands in a shell, you can redirect output the same way you would with any other shell command: sh('pycodestyle > myoutputfile.txt')


0

Probably you need additionalBuildArgs to tag your image as mytag: agent { dockerfile { additionalBuildArgs '-t mytag' } }


0

Try with tokenize (,) since the options were saved like a string. Save 'NAMES' into a new variable, then tokenize with a comma "," since it was configured the parameters with multiSelectDelimiter: ',' Finally, you can iterate the array with a for-loop and use the elements as desire. def arr = userInput['NAMES'].tokenize(',') arr.each { t -> ...


0

You are not building the wrong thing this is a topic that is coming up more and more frequently as people create more and more advanced pipelines. You can see people discussing the need for it here. The reason is doesn't come up a ton is most people can just trigger their tag job on any change to master. Which is much simpler to setup. I often want to tear ...


0

Check if the GIT_COMMIT is a merge commit using git rev-parse: when { branch 'master' expression { isMergeCommit(env.GIT_COMMIT) } } def isMergeCommit(String commit) { isSimpleCommit = sh(returnStdout: true, script: "set +e; git rev-parse --verify -q $commit^2 > /dev/null; echo \$?").trim() return isSimpleCommit == "0&...


1

Make B as a Pipeline job and give it some build parameters. Humans will be able to trigger this build with whatever parameters they want using the "Build With Parameters" button in the web UI. Then, in your Pipeline script for A, trigger the build using the built-in build step. This will allow job A to trigger B with whatever parameters are ...


1

Assuming I'm understanding you correctly, there's a much simpler way to do this. If you know the path to the file(s) that you need within the git repo, you can use git archive. This fetches a single file directly from a remote repository, so it always grabs the latest version. I've used this a few times from within a Jenkins Pipeline script. For instance:...


Top 50 recent answers are included