All Questions
Tagged with jenkins-workflow or jenkins-pipeline
13,203 questions
0
votes
0
answers
45
views
Accessing to two or more Gitlab Projects in the same Jenkins pipeline file
We have the following Jenkins pipeline script.
pipeline {
agent any
stages {
stage('Run in Sandbox'){
steps {
dir('Pot') {
checkout ...
-1
votes
0
answers
42
views
File wildcard with GitHub/Groovy/Jenkinsfile - how to not have quotes added?
I have the following command in my GitHub Jenkinsfile:
steps {
sh '/bin/cp --update --recursive -f -v * /final/location'
}
In the Jenkins log file the asterisk always ends up with ...
-1
votes
0
answers
47
views
Jenkins is unable to locate the executable file after extracting the Nexus NuGet package
I attempted to execute the following command in a Jenkins batch script to run the executable named "GitFetcher.Exe," which is located within the tools directory of "IB.SO.AutoUtility.&...
0
votes
0
answers
24
views
Is it possible to run multiple Jenkins branch indexing processes at once?
Jenkins runs "branch indexing" jobs to trigger multi-branch pipeline jobs automatically; for instance a webhook connected to source control will cause a branch indexing job to scan for newly ...
0
votes
0
answers
86
views
How can I keep track of expired time in a timeout{} step?
Say I have this recursive function in a Jenkins pipeline. It's initially called by another function, but then calls itself recursively.
def recursiveFunction(final Integer timeout) {
static Integer ...
1
vote
1
answer
52
views
unable to find class for annotation @Field in jenkins pipeline script from scm
I'm encountering an issue with my pipeline script when running it from SCM. The @Field annotation isn't being recognized, even though I'm using the correct import statement (import groovy.transform....
1
vote
0
answers
38
views
Jenkins Pipeline - string parameters not being pulled into PowerShell script
Pipeline is not passing down string parameter data to the PowerShell command were trying to create a jenkins page that allows a person to create a cname on a domain. We know creds work if we bypass ...
0
votes
0
answers
48
views
Jenkins Pipelines in Docker: Failed to rm container
My setup is both Jenkins master & agent running via "Docker in Docker" scheme onto Docker Desktop for Windows with WSLv2 backend.
In my Jenkins Pipelines, I am using docker step from ...
0
votes
0
answers
75
views
PyInstaller build on Jenkins: ValueError: Invalid async_mode specified with Flask-SocketIO + gevent
I am building a Python 3.11 Flask-SocketIO project into an .exe using PyInstaller on Jenkins (Windows 10).
The project works fine when I run it locally with python runapp.py or even inside Jenkins ...
-2
votes
1
answer
68
views
How to fix a Jenkins pipeline for a 100+ flavor Flutter app? My build times are over 30 hours [closed]
I'm hoping to get some advice and validation on a pipeline strategy for a large white-label Flutter project.
The Setup
One Flutter codebase.
100+ flavors for unique customer apps (Android & iOS)
A ...
0
votes
0
answers
52
views
Jenkins Allure commandline tool issue
we are using allure command line tool to generate reports and have multiple versions 2.10.0 and 2.32.1. 2.32.1 is set as allure-latest in tools config but when we run the Jenkins pipeline its ...
0
votes
0
answers
67
views
Why does Jenkins pipeline not see git tags after checkout in a Docker/Windows agent?
I am using a Jenkins declarative pipeline with a Docker agent (Windows label).
In my pipeline, I want to get the current git tag for the commit being built, so I can use it for artifact naming.
My ...
0
votes
0
answers
68
views
Could not determine exact tip revision of master
Occasionally in Jenkins Pipelines we see the following error:
ERROR: Could not determine exact tip revision of master; falling back to nondeterministic checkout
This then results in a git checkout ...
1
vote
0
answers
48
views
Running Jenkins agent through terraform userdata script, which makes the selenium tests to execute in headless mode
I have a PowerShell script which is passed as user data script in terraform for Windows Server 2022 VM creation in AWS cloud. This PowerShell script uses Jenkins API to create the node and connect the ...
0
votes
0
answers
59
views
Run periodic job only if SVN repository has changes
I'm running Jenkins on a Windows machine, and I have a Jenkinsfile that triggers a pipeline periodically using the cron directive:
pipeline {
agent any
triggers {
cron('0 1 * * 1-5') /...
0
votes
1
answer
94
views
How can I add an optional, manually triggered, postbuild action to Jenkins
The problem
Brief
I am trying to add a GUI option to the dropdown menu available for all historical builds:
Details
I want to create an option that will lock the build, create a git tag by ...
0
votes
1
answer
49
views
Free the worker of parent pipeline during the build of child pipeline
I have a Jenkins pipeline pipeline1 that launches another one (pipeline2) on the same agent myAgent:
pipeline1:
node('myAgent') {
stage('Do some work before') {
sh(script:"sleep 5&...
0
votes
0
answers
43
views
which import for StringCredentialsImpl
This is follow up on open request - jenkins groovy update kind="secrets text" credentials store in jenkins
Trying alternative approach, and i am getting an error - unable to resolve class ...
0
votes
0
answers
106
views
Jenkins pipeline - Cannot run program "" (in directory "/var/lib/jenkins/caches/git-xxxxx"): error=2, No such file or directory
Currently I have this issue within my Jenkins pipeline. Here is the context.
I am setting the Jenkins server in EC2 instance and docker container as an build agent. within this one, I install docker ...
0
votes
0
answers
94
views
Unexpected Error when run powershell script in CI/CD
Here are some basic infos:
windows server 2016
CI/CD: jenkins running on windows server 2016
I have a msvc program, I start the building by calling a powershell script. I can run it successfully at ...
0
votes
1
answer
397
views
How to use globules correctly in a `Jenkinsfile`?
My original Jenkinsfile was something along the lines of:
DATA = [ ... ]
def Helper(def ver) {
def cfg = DATA[ver]
...
}
...
But this gets warnings in the logs to the effect of:
Did you ...
0
votes
0
answers
32
views
Declarative Jenkins Pipeline With Docker Agents only
I have the following Pipeline configuration:
pipeline {
agent {
docker {
image 'alpine:latest'
args "-v /mnt/buildfs/hudsondocker:/mnt/buildfs/hudsondocker&...
2
votes
1
answer
207
views
Jenkinsfile groovy-lint Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic CompileStatic
I am trying to commit my changes to a Jenkinsfile but I am getting the following info statement:
1 info Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @...
-1
votes
1
answer
64
views
Kubernetes Jenkins as a pod with docker pipeline error
I have a Ubuntu VM with an installed Docker engine, a K3S cluster including Jenkins 2.511, and a JDK 21 pod.
I have been struggling with this kind of error for several days:
cp: can't stat '/var/...
0
votes
1
answer
89
views
Jenkins not creating workspace folder needed for dynamic choice parameter options
this is my first time posting a question so I hope I am doing it right!
I am newer to Jenkins and Groovy, but have been working with the Jenkinsfile for quite a while now, specifically focusing on the ...
1
vote
2
answers
104
views
Jenkins - User permission by View/Pipeline
I have a requirement to give access to an external supplier and I would like to give them access to only a View with some pipelines inside. I don’t want them seeing all my pipelines created on Jenkins....
-1
votes
1
answer
57
views
What is the suggested workflow for developing the Jenkinsfile in a multibranch pipeline
What is suggested workflow for working on Jenkinsfiles in multibranch pipelines. All the tutorials I can find for multibranch pipelines supply a Jenkinsfile that is already correct and needs no ...
0
votes
0
answers
25
views
Reusable git in Jenkins stages running a docker image
I have a jenkins pipeline and I am running a Nodejs application which uses the docker image node:22.14.0-alpine3.21. I need to run git on the build and deploy stage but git is not available in the ...
0
votes
0
answers
55
views
Jenkins issue: fatal: not a git repository (or any of the parent directories): .git
We are running Jenkins on a GKE cluster and have observed a strange issue with our multibranch declarative Jenkins pipeline at the beginning of the pipeline execution.
13:27:09 + git config --global -...
0
votes
0
answers
50
views
How to propagate docker command exit status in groovy script?
I need to run a docker command from a generated shell script. The exit status of the docker command should be returned to a groovy stage. After a multiple tries I'm unable to do it. This is the code:
...
-1
votes
1
answer
53
views
How to run a top-level shell script in a Git submodule inside a Jenkins pipeline?
I have a Git submodule, and have a delete-branches.sh script at the top level. I'm able to do this on my terminal
$ git submodule foreach 'cp ../delete-branches.sh . && ./delete-branches.sh ...
1
vote
1
answer
198
views
In a Jenkins pipeline, how can I get the upstream job of an upstream job in a chain of jobs?
Say I have JobA triggering JobB which then triggers JobC. I know I can do this to get the upstream job
def obj = currentBuild.rawBuild.getCause(Cause.UpstreamCause)
String upStreamJob = obj....
0
votes
0
answers
32
views
Jenkins Terraform pipeline gives InvalidClientTokenId error
When running terraform plan, or in this case for testing, aws sts get-caller-identity via pipeline stage, I'm getting the error:
An error occurred (InvalidClientTokenId) when calling the ...
0
votes
0
answers
118
views
How to overcome TLS verification problem with Jenkins?
I am running Jenkins as a container in Docker and also trying to run Docker as cloud in Jenkins, but when I link the new image to Jenkins, this problem shows when I press test connection and I don't ...
0
votes
0
answers
107
views
Completely disable replay option
I would like to disable replay for all jobs, the matrix replay is unchecked. Yet everyone can still replay.
I've removed import hudson.model.* from all of the pipelines, and it's still there and ...
1
vote
1
answer
109
views
Jenkins pipeline operation not permitted
I'm working on a Jenkins pipeline and can't understand why one of my steps can't be executed on the target machines.
Basically, I want to deploy my new code from github repository with Jenkins agent ...
0
votes
0
answers
70
views
Jenkins steps.load can't parse a script
I'm using a Jenkins shared library (stored on git) that has a vars/loader.groovy defined as:
void load(String libName, String path) {
setVariableInGlobalBinding(libName, steps.load(path)
}
private ...
0
votes
1
answer
266
views
Masking of secret in Jenkins logs
I have a custom script which fetch the secret from vault . ( I cannot use Jenkins credentials to store the secrets )
My code
def executeCommand(def command) {
return sh(script: command, ...
0
votes
0
answers
34
views
Assistance in formatting curl command in Jenkin's pipeline to call SonarQube
In a pipeline (Jenkins Version 2.496) script block;
I have an environment params variable defined with 4 & to pass multiple values;
SET tools_params=mainBranch=%default_branch%^&...
0
votes
1
answer
49
views
Handle timeout failure in Jenkins pipeline library custom step
We use Jenkins Pipeline shared library custom steps in our build files.
We have a use case where the custom step will perform a potentially long-running operation; one that we want to ensure has '...
1
vote
1
answer
43
views
Jenkins pipeline cannot open an existing file
I have the following test code to try to open and modify the contents of a file:
private def updateTagInfoInFile(final String file) {
final String tmpFile = "tmp.txt"
sh "ls -al /...
1
vote
2
answers
568
views
Using methods from shared scripts in methods defined outside pipeline block in jenkins
In my various pipelines I have been using shared scripts like this:
@Library('SharedScripts') _
def myUtils= new shared.scripts.myUtils()
pipeline{
....
// some stage
myFunction()
}
def ...
0
votes
0
answers
86
views
Is there a way to use a shared library in Jenkins without hardcoding the branch name?
I have a jenkinsfile in git branch "my-branch" that imports a class.
@Library('my-branch') _
import foo.bar.info.stuff
However sometimes I create copies of the branch for testing e.g my-...
0
votes
0
answers
108
views
Docker Login to Nexus Fails: "Client.Timeout exceeded while awaiting headers" Message:
I'm trying to log in to my Nexus Docker registry using the following command:
bash
Copier
Modifier
docker login -u admin -p mypassword https://nexus:8083
However, I keep getting this error:
vbnet
...
0
votes
1
answer
251
views
How Can I create an HTML Trivy Report from my Jenkins Pipeline
I am deploying my application with Jenkins pipeline currently running on docker. I dont have an issue getting the Trivy json report but I wish to convert it to HTML. My issue now is, the created HTML ...
0
votes
0
answers
31
views
Jenkins pipeline for java application deployment to Oracle Weblogic server
I have to imolement jenkins pipeline where we use ansible playbooks to undeploy and then deploy 12 war files into oracle weblogic server. When we manually undeploy the war files and then try to deploy ...
0
votes
0
answers
39
views
Active Choice Reactive Parameter Issue
I am using one active choice reactive paarmeter (menifest_to_be) while running the script first time it works properly. But as I go again to build it, it runs the fallback script because it is not ...
0
votes
0
answers
37
views
Reusable Steps for Declarative Pipeline Jenkins/Groovy [duplicate]
I come from an OOP background and I want to define reusable steps inside of groovy classes. Inside my declarative jenkins pipeline I then just want to define objects of those classes and execute the ...
0
votes
0
answers
93
views
withCredentials Credential Variable Injection and Interpolation in Jenkins on Windows
I'm new to Jenkins (version 2.492.2 on Windows) and cannot seem to get access to the password from withCredentials via the shell/environment variable.
I’ve tried a few variations in the snippet below. ...
0
votes
0
answers
103
views
Tomcat 10 not available in "Deploy to container" plugin in Jenkins
I am new to Jenkins. I have a Spring Boot 3 with Java 17 project.
I am creating a pipeline in Jenkins to build & deploy on Tomcat 10 using Deploy to container plugin but Tomcat 10 is not available ...