Question regarding using groovy code in Jenkins, specifically in Jenkinsfile and groovy plugins
Questions tagged [jenkins-groovy]
2809 questions
0
votes
0 answers
How to run shell script via Jenkins file?
I am creating a .war file on Jenkins and pushing it to an AWS S3 bucket.
Also, i have created a script on my EC2 instance which downloads the .war file and move it under tomcat webapps folder to finally deploy it.
I am able to run it manually but…

arjunsinghmor
- 1
- 1
0
votes
0 answers
How to trigger Downstream job concurrently with different nodes(parameters) from upstream job from Jenkins
Here is the setup.
There is an upstream Jenkins job and a downstream Jenkins job.
The ask is to trigger the same Downstream job from the upstream job concurrently on multiple different nodes(nodes here are the parameters for this downstream…

user20297318
- 1
- 1
0
votes
1 answer
Convert map to yaml file
I'm trying to create yaml file from a map with yamlBuilder but it's not in the right context that I need it to be.
For example:
Map mymap = [1: "a, b, c ,d", 2: "y, d, x"]
The yamlfile that I want to look like:
-Content:
-1:
-a
…

Saar Gamzo
- 57
- 4
0
votes
1 answer
Execute some code and if it fails execute another in Jenkins
I'm trying to download some dependencies from two different artifact repositories. I need to make it secuentially and execute the download of the second just if the code cannot download from the first. I've been trying using a try-catch but it does…

Felipe
- 174
- 5
- 16
0
votes
1 answer
Unable to return a declaratively defined stage from closure to jenkins shared library
I have been working on creating a jenkins shared library, and it works perfectly for a generalized pipeline template. Recently I had the need to pass an extra user-defined stage to my generalized pipeline. I am using closure to do so, but facing…
0
votes
0 answers
How to assign value to a Docker ARG in docker.build Jenkinsfile?
I'm trying to assign a value to a Docker ARG, using Jenkinsfile, so I can use it as a dynamic ENV variable depending on the pipeline.
The problem is that the env does not appear in the container and this warning is displayed in the job console…

phdev
- 17
- 5
0
votes
1 answer
how to save sql value in some variable in jenkinfile pipeline
I am creating a jenkins pipeline where I want to execute a sql script then store that value to some variable as below
String value = sql sql: "SELECT * FROM jobs WHERE id = ?", parameters: [1]
Getting a error at above point…

Willingtolearn
- 35
- 5
0
votes
2 answers
IS there any process to automate the jeniks nodes/slaves
We have Jenkin nodes. They occasionally lose connection. When we need to bring them back online. We're going to manually reset the nodes. Is there a method to automate it without using plugins?
0
votes
1 answer
Jenkinsfile python argument
I got a python script that I run like python3 test.py arg1 arg2
I setup a jenkins task and parametized it with 2 string parameters
how do I setup my Jenkinsfile? This is all I have right now
pipeline {
agent any
stages {
stage('version') {
…

er24rf4f
- 1
- 3
0
votes
0 answers
Jenkinsfile error: Unable to resolve class Workbook
When I build my Jenkins job, I receive the following error:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 198: unable to resolve class Workbook
@ line 198, column 42.
…

wasabiiwooman
- 1
- 2
0
votes
0 answers
Plugin Extended E-mail Notification does not see the groovy-template file in $ {JENKINS_HOME} / email-templates /
Hello recently I started using jenkins Extended E-mail Notification plugin. Based on the example groovy template, I decided to create my own template for e-mail messages. First, I created the catalog $ {JENKINS_HOME} / email-templates / and gave it…

haker146
- 61
- 5
0
votes
0 answers
Configure Github- Webhook for Every Repository
I am currently setting up a CI-Pipeline with Jenkins, Github, Sonarqube, Maven,...
Github only allows to create a webhook for single repositories so that i have to create a new webhook for every new repository which should be linked to Jenkins.
Is…

Naveen N
- 1
0
votes
1 answer
Run same Jenkins job with different parameters sequentially
I have a jenkins job A which takes let's say have param foo allowed value of foo are (1,2,3,4,5,6,7). Now I want to make a jenkins job B which runs job A with param foo with 1,2,3,4,5,6,7 sequentially. i.e Job B will be Job A 7 times with param foo…

rahulpareekyx
- 51
- 1
- 8
0
votes
1 answer
Jenkins- How to pass parameter through the jenkinfile to trigger another job
build job: 'build_Test', parameters: [validatingString(name: 'version', value: '1.0.0.1'), string(name: 'TASK', value: 'build')]
I am trying to trigger another job via jenkinfile. The above script triggers the job but can see below error in the…

Willingtolearn
- 35
- 5
0
votes
1 answer
How to run the same scripted pipeline multiple times in jenkins?
I went over the internet to find out a way to run the same pipeline multiple times but have not found an answer.
Basically, the pipeline has 5 stages and I want this pipeline to run 5 times, each iteration of the pipeline will execute the stages in…

omer tesler
- 1
- 2