Questions tagged [jenkins-pipeline]
Questions about the Jenkins “Pipeline” plugin suite (formerly “Workflow”). Not about pipelines in Jenkins in general (e.g. using downstream jobs).
12,359
questions
0
votes
2
answers
23
views
How to use Github Webhooks in Jenkins CI\CD
I'm trying to find out the best way to do the following:
Let's say we have 2 branches - develop and master
after a push in 'develop' I want to trigger a CI\CD job, and it's working fine
but the ...
1
vote
0
answers
15
views
Use Jenkins conditionals outside of when{} block
I would like to utilize the built-in Jenkins conditionals that control when a stage is executed in a pipeline. Specifically, I would like to utilize the changeset conditional outside of a when{} block ...
-1
votes
1
answer
14
views
How to set up access to a Linode Kubernetes Engine cluster in a Jenkins pipeline?
so I have this main.tf
terraform {
required_providers {
linode = {
source = "linode/linode"
}
}
}
provider "linode" {
token = var.api_token
}
resource "...
0
votes
1
answer
10
views
choice vs booleanparam (Both not working)
I am creating a jenkins/groovy setup for creating a dashboard (Build with Parameters - in Jenkins) for users to input the values.
So fat I am good with the setups. The script I am using is:
parameters(...
-2
votes
0
answers
20
views
Jenkins Pipeline Build Approval By Email
I have a Jenkins Pipeline which has several stages. I want that when I click build it will send an email to specific admin person in which have two options of "Approve" and "Abort"....
0
votes
0
answers
26
views
url is not intercepted during curl call inside bash script called by jenkins pipeline
Team,
I have no clue why am i not getting the url shown as shown in logs. if we see below url is being echoed well but during curl call it is not getting picked in jenkins logs. is my syntax or quotes ...
0
votes
0
answers
10
views
Jenkins Blue Ocean how to connect to private repo in GitHub
I was able to successfully connect Jenkins' Blue Ocean to a public repo in GitHub. Now I am trying to connect to a private repo. I have already provided a personal access token to Blue Ocean with the ...
1
vote
0
answers
17
views
Jenkins Declarative Pipeline is exiting with ERROR: script returned exit code 123
Intent: I am writing a Jenkins Declarative pipeline to integrate JMeter test suite with JenkinsCore. At a point, jmeter.sh script is called and I generate jmeter.jtl file in xml format.
From the ...
0
votes
0
answers
8
views
No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.bat() is applicable for argument types: (java.lang.String) values
I have a Job DSL script that creates a new Freestyle job. The job should have active choice parameters for selecting options and batch commands need to be executed as part of the job and create a txt ...
1
vote
0
answers
12
views
Get a pipeline bytecode size
We have a lot of complex pipelines using 'mixed' syntax. We distribute them as a shared library based on open-source MPL project.
I called this 'mixed' syntax because we have some logic prior ...
0
votes
0
answers
16
views
Build jar files using jar version or use increment version
I have configured 2 Jenkins jobs which build and deploy docker images using aws ecr:
1-st job
package spring boot microservice into docker image
push the image to aws ecr registry
2-nd job
download ...
-1
votes
0
answers
21
views
Backup Jenkins jobs configuration
I have a test Jenkins server where I configure multiple jobs with parameters and build values. Is it possible to quickly backup and restore into another Jenkins server only jenkins job configuration?
0
votes
1
answer
29
views
Input in the Groovy parameters to output as a json
I am trying to setupa Jenkins/Groovy setup where we input certain va;ues to our Jenkins pipeline, I am trying my Groovy to output as a json.
My current script is as shown below:
parameters([
...
-3
votes
0
answers
19
views
how can read json file present in jenkins workspace using java [closed]
I am developing custom jenkins plugin, required to read the json file from the workspace.
found solution where it existed using groovy script only
0
votes
2
answers
35
views
Jenkins sudo: a terminal is required to read the password
I have a FastAPI app for which I have configured Jenkins pipeline. When I execute unit tests with the code coverage enabled they are failing with the following error :
Started by user gold
Obtained ...
0
votes
1
answer
18
views
How to implement rerun on skipped Robot Framework test cases in jenkins
How to implement rerun on failed Robot Framework test cases in jenkins
Failed cases are rerun using below argument declared in the jenkins pipeline, however the dependent cases which were skipped in ...
0
votes
1
answer
19
views
Getting "unexpected token: String" in Jenkins pipeline
I am trying to upload package(zip file) by downloading from my instance and uploading to artifactory, but when I run the jenkins job for the same, I get below error :
*WorkflowScript: 32: unexpected ...
1
vote
1
answer
28
views
Weird stage behaviour while parallel call is present
There are some stages in my pipeline that may fail by themselves but not fail the build process. I wanted this stages to be indicated as failed so a wrapped them in try-catch blocks. However some of ...
0
votes
1
answer
46
views
How do I get stage output in a Jenkins pipeline?
This seems like an odd issue, because I'm unable to find any hints that other people are having the same problem - in fact there are more questions asked about suppressing output. So I'm probably ...
0
votes
1
answer
31
views
Jenkins: Reading branches from Git repository using Jenkinsfile
I am trying to modify an existing Jenkinsfile, so that while using "Build with parameters", it properly displays currently existing branches on Git repository. As of now, the code generates ...
1
vote
0
answers
22
views
add cypress component test in jenkins pipeline
I want to add a new stage to run Cypress component tests in a Jenkins pipeline. I have installed Cypress 12.7 and added it to the package.json file of my Angular project to run Cypress like this:
&...
0
votes
0
answers
20
views
How to display Coverage number in Jenkins pipeline
I have a Jenkins multi branch pipeline.
stage('Run tests') {
steps {
sh 'npm run-script test -- --coverage --testResultsProcessor=jest-junit --outputFile=test-results.xml'
...
1
vote
0
answers
20
views
No such DSL method 'AWS' found among steps error in jenkins pipeline
Getting the below error while running withAWS command on jenkins inbound-agent docker container.
Requesting assume role
Assuming role ARN is arn:aws:iam::xxxxxxxxxxxxxxxxx:role/cross-account-...
0
votes
1
answer
24
views
Jenkins(Docker) - PipeLine Error - Unable to deploy application using Docker Compose
I am new to devops and i was trying to created a jenkins pipeline for one my projects.
Error:
Details:
Jenkins: Started using following command
sudo docker run -d -v jenkins_home:/var/jenkins_home -p ...
0
votes
0
answers
15
views
Intellij and jenkins shared libraries - browsable vars files?
Is it possible to make shared pipeline code in intellij browsable? That means, that I can click on the setParameters() method in generalPipeline.groovy and intellij leads me to the call()-method of ...
0
votes
1
answer
14
views
Jenkinsfile symbolic linked from another folder
My Jenkins is configured by administrators to use Jenkinsfile in my project folder.
Can this Jenkinsfile be a symbolic link to another file in the same repo?
I have many projects in this repo and ...
0
votes
0
answers
10
views
Is there any way to check the merge request status in git lab through jenkins declarative pipeline and trigger next stage through CI
Through jenkins declarative pipeline I am checking out a new repository and creating a merge request to target branch.
1 .I would like pito automate the peline to wait till the merge request is been ...
0
votes
1
answer
27
views
How to send an event from Jenkins to AWS EventBridge?
I am looking to achieve something like this.
Jenkins --(json event)--> AWS eventbride event---> multiple targets(cross account EventBridge event bus)
Then every consumer account for this event ...
2
votes
1
answer
20
views
How can I prevent users from aborting a Pipeline Input Step?
In the Input step, I want only users with sufficient permissions to be able to do it. But users with build permission can do it
I just searched the internet and didn't get any answer for my case
0
votes
0
answers
9
views
Append data to excel using jenkinsfile groovy
I created a script where I extract data that came from SonarQube web api extracted to a JSON data.
In my script I have 2 if statements that used to extract the data correctly for group permission and ...
-1
votes
0
answers
8
views
drawbacks of two docker agent in jenkinsfile
I am trying to integrate two types of testing with the use of single jenkinsfile.
I would like to understand use of two docker images as a agent in single jenkinsfile can be considered as a good ...
1
vote
0
answers
26
views
@nrwl/angular dependency of webpack is causing vulnerability issues
I am using "@nrwl/angular": "15.8.7" version and this particular version is internally using "webpack": "^5.75.0". At the time of build this is causing issue ...
0
votes
0
answers
8
views
Jenkins-mac AWS
After BUILD_AND_ARCHIVE, an .xcarchive folder will be created. Inside this folder, we have another folder called dSYMs, we need to extract this folder and make it as a zip file and return it somewhere ...
0
votes
2
answers
37
views
Jenkinsfile Syntax error for shell script
I tried to append an sh script inside my jenkinsfile, however I'm getting this kind of syntax error even though ( are properly encoded. Below is my if-else block script:
// Display Users with ...
0
votes
0
answers
25
views
Getting 'No such file or directory' in Jenkins
I'm new to jenkins can you guys please help me out. Facing below error in Jenkins.
Earlier it was executing perfectly but suddenly it started throwing this error
java.io.FileNotFoundException: /opt/...
-1
votes
1
answer
21
views
Enable Trigger builds remotely (e.g., from scripts) option via Jenkinsfile.groovy
I am trying to enable "Enable Trigger builds remotely (e.g., from scripts)" option and add Authentication Token via Jenkinsfile.groovy. Tried pipelineTriggers([authenticationToken('jenkins')]...
2
votes
2
answers
32
views
How to add groovy variable in jenkins groovy email template
I'm using a custom variable in my jenkins pipeline and I'm trying to add it to email by modifying groovy-html.template. But I'm getting an error in my email.
steps {
script {
...
0
votes
0
answers
29
views
delete aws ecr image with select option
I want to implement jenkins job which can delete docker image in aws ecr using drop down menu:
pipeline {
agent any
environment {
AWS_ACCOUNT_ID="123456"
...
0
votes
1
answer
34
views
Getting error pipeline@tmp/durable-81eb936b/script.sh: line 5: command not found
I'm creating a pipeline in jenkins to build a binary using ANT. After creating I'm using some shell commands to store md5sum of the generated war file. But when using the shell commands I'm getting ...
0
votes
1
answer
25
views
Get all branches in multibranch pipeline and get all active pipeline job which exclude disabled multibranch pipelines and its branches
I'm working on the groovy script to get all active multibranch pipelines and disabled multibranch pipeline list
Below is the groovy script and I was able to get this
To get the list of multibranch ...
0
votes
0
answers
20
views
Framing Jenkins parameters with some text [closed]
is it possible to frame parameters in Jenkins with text. For example:
Active choice parameter, I wish to add it in this way:
PARAMETER_PREFIX+DROP_DOWN_LIST+SOME_SUFFIX_TEXT
I'm trying to develop a ...
0
votes
0
answers
12
views
how to add post request in java for jenkins plugin development [closed]
I am developing custom jenkins plugin in java, so I want to pass data from jenkins variables (input taken) to the database.
checked with @RequirePOST annotation, unable to understand the usage of url ...
1
vote
0
answers
18
views
Using Jenkins EMail-ext plugin how to send the content of a file
Using the EMail-ext plugin, how can we send the content of a file which is stored in a variable using def fileContent = readFile "filePath"
pipeline {
agent {
label 'test'
}
...
1
vote
1
answer
50
views
How to run jenkins pipeline jobs in parallel which call the same downstream job?
I am a beginner to jenkins and making groovy scripts for pipelines, I want to trigger a downstream pipeline in parallel for all the files inside a folder given by the user... below is the sample code ...
0
votes
2
answers
32
views
Jenkins Error - java.io.NotSerializableException: groovy.json.JsonSlurperClassic
I am using Groovy trying to do an API call in a Jenkinsfile and trying to get a JSON response back. Here’s my code:
def url = “some url link”
def connection = new URL(url).openConnection()
...
0
votes
1
answer
31
views
What credentialType is "Secret Text"?
I'm trying to create a pipeline script for a parametrized job which accepts a "Secret Text" type credential as an input.
I tried:
credentials(name: 'API_TOKEN', description: 'API Access ...
0
votes
0
answers
16
views
Create custom error message when using OIDC plugin in jenkins after authentication
I use the oidc-auth@2.5 plugin in my jenkins and after configuration and authentication I get this error message in the browser:
is there a possibility to personalize this error message for example &...
0
votes
0
answers
17
views
Extract a tar symlink in jenkins file
I have file.tar.gz of which I made a symlink using ln -sf file.tar.gz link.
I want to use this link as a general pointer to what I will be working with later, where I want to extract this file.tar.gz ...
1
vote
0
answers
20
views
Use keypass vault into jenkinsfile
I have keypass vault credentials where I have stored the different credentials.
I need to integrate it into my jenkinsfile where I can use the credentials for performing different acitons. Can anybody ...
0
votes
0
answers
46
views
script.sh: 2: Syntax error: word unexpected (expecting ")")
I am running a shell script inside the Jenkinsfile but it is giving me the following error:
script.sh: 2: Syntax error: word unexpected (expecting ")")
When I am running the same shell ...