Questions tagged [jenkins]

14884 questions
1

votes
1

answer
981

Views

Python works fine on command prompt but failed to run from Jenkins and gives error

Python works fine on command prompt but failed to run from Jenkins and gives error 'python' is not recognized as an internal or external command, operable program or batch file.
Sumer
1

votes
3

answer
2.5k

Views

Cannot parse xml file in jenkins pipeline

I have simple xml file, that I need to parse in pipeline. I need to exctract values of all servers' names into variable. So I used code below but get only 'unclassified field java.lang.string Config' exception deleteDir() stage('upload') { def inputFile = input message: 'Upload file', parameters: [...
Pavel Polushin
0

votes
0

answer
4

Views

How can I pull down a branch in a Jenkins job?

Within the job on Jenkins I chose Extended Choice Parameter ⇒ 'Groovy Script' and implemented it with the source code below, but I can not select the branch name. (Nothing can be selected now) It would be helpful if you pointed out the method of identifying the error part or the bad point. ◆ Ste...
user3732298
0

votes
0

answer
3

Views

I have to call the bat file from jenkins which is not working in some shenario

@echo on set workspace_loc=%1 set version=%2 echo installing jar db2sqlparser jar to be used in esqlxref job ... mvn install:install-file -Dfile='%workspace_loc%\abc\abc.jar' -DgroupId=com.solutions.db2sqlparser -DartifactId=db2sqlparser -Dversion=%version% -DgeneratePom=true -Dpackaging=jar EXIT...
rakesh
1

votes
2

answer
2.6k

Views

Jenkins Pipelines: How to use withCredentials() from a shared-variable script

I'd like to use a withCredentials() block in a shared-variable ('vars/') script rather than directly in the Jenkins pipeline because this is a lower-level semantic of a particular library, and also may or may not be required depending on the situation. However, withCredentials (or, at least, that si...
Dustin Oprea
1

votes
1

answer
813

Views

How to specify slave.jar compatible jdk version in Jenkins

My maven project have a hard dependency on jdk1.7. I have Jenkins(2.89.4) instance which has jdk 1.8. When I try to connect to slave which(specifying jdk 1.7 in this slave config), launch agent is failing with error below Starting slave process: cd '/jenkins' && /opt/jdk1.7.0_80/bin/java -jar slav...
abhig
1

votes
2

answer
227

Views

Script a Jenkins Pipeline Job

I'm using the Docker image: jenkins/jenkins:lts I've got a number of groovy scripts that are copied into the $JENKINS_HOME/init.groovy.d/ directory during the build of the docker image. I want to write a script that will create a new Pipeline job, but I'm struggling to find any information on how t...
GreenyMcDuff
1

votes
2

answer
199

Views

Can Jenkins build only one python package in a monorepo with multiple packages?

Suppose there is a monorepo with several independently buildable python packages in different directories, something the format shown below, where foo and bar are independently buildable. Now suppose someone pushes code to a git repository where this is hosted, and the code revisions live within onl...
Tom
1

votes
1

answer
243

Views

-bash: ./deploy.sh: Permission denied , ERROR: script returned exit code 126

I am trying to implement continuous deployment using Jenkins and that involves sending a jar file to a remote server and start the jar once its on the remote server. The problem is that i keep getting access denied error and i have tried every account i have on my remote and local server nothing se...
Erent
1

votes
2

answer
185

Views

How to use Helm Jenkins Values 'CredentialsXmlSecret'

I'm trying to deploy a Jenkins using helm. I saw that some values are set with an XML. However, I can't do it the same way with the Master.CredentialsXmlSecret field. I have tried: CredentialsXmlSecret: jenkins-credentials SecretsFilesSecret: jenkins-credentials: |- xml from credentials.xml here But...
Pau Campaña Soler
1

votes
4

answer
109

Views

Jenkins and gradle - build projects with latest versions of dependencies for CI, specific versions for production

I am working with Jenkins, Gradle and our Ivy repository. Our build scripts specify the exact version of dependencies to be used for the build. This is good practice for production. For CI it would be interesting if the project build used the latest versions of our own libraries, that way we could n...
Kevin Sadler
1

votes
2

answer
147

Views

Passing local variable to batch with returnStdout in jenkins pipeline

When i try to substitute date_append variable in batch command as shown below, its not retrieving the date exactly, instead it shows as Snapshot-${date_append}.onp where is the exact issue? stage('test') { steps { script { date_append= '${new Date().format('yyyyMMdd_hhmmss')}' echo '${date_append}'...
K-rwer
1

votes
2

answer
35

Views

Organizing Jenkins Libraries

We are using Jenkins Shared Libraries in our pipeline development. We have written quite a few libraries inside it and now we want to organize it little better. Is it possible to have folder structure within vars folder of jenkins shared libraries?
IT-Sheriff
1

votes
1

answer
63

Views

groovy.lang.MissingPropertyException: No such property:

I am trying to get my head around groovy scripting to make some changes to a jenkins pipeline and I keep getting this error: groovy.lang.MissingPropertyException: No such property: credentials for class: I have tried declaring the variable with def but I still get the exception, eclipse does not rec...
berimbolo
0

votes
0

answer
4

Views

how to access folder variables across pipeline stages?

I am trying to create multiple pipeline jobs under a folder. Under this folder I have created some folder properties. I am having a hard time to use this folder properties across multiple stages in a job. plugin used : https://wiki.jenkins.io/display/JENKINS/Folder+Properties+Plugin def region pipel...
T D
0

votes
0

answer
5

Views

Fetching jenkins build status from python script

I am trying to fetch status of all the builds for all my jobs.I have written a script it takes way too much time to execute.Is there anyway I can optimize the script? Any help will be appreciated. def jenkinsconn(): server = jenkins.Jenkins('server',username=username,password=password) jobs = server...
Miller
1

votes
0

answer
8

Views

When using declarative syntax, is there a way to avoid separate stages for each “when” condition?

Is there a way to avoid creating a separate stage for each conditional 'when' statement ? In other words, in the example below, the maven command is exactly the same for the two branches except for one parameter. So, is there an easier way to have a single stage called 'maven build' with a conditio...
user1554876
2

votes
2

answer
71

Views

Not enough memory to complete analysis

I am facing a very unusual error related with fortify scan. It started yesterday evening and I have been struggling very hard to resolve it since it has been impacting the work of whole team. I am getting following error message in Jenkins console. I tried to troublshoot by bumping the memory and ja...
dasra khadka
0

votes
0

answer
4

Views

Defining readProperties variable globally

I'm writing jenkins pipeline script and using readProperties resource to get the variables from property files. But that key value is used only under exiting stage. If I have to use that key value variable in another stage it showing null. Can you anyone guide me how to define these variable globall...
Bharath
0

votes
0

answer
5

Views

How to export a confluence page as PDF in Jenkins job?

I'm wrinting a Jenkins job iwth the the help of shell script to export a page in Confluence as PDF and store it as output after the build. How can I achieve that ?
0

votes
0

answer
5

Views

How to use `inject-passwords`in yaml for jenkins?

I am using a yaml file to configure a jenkins job, and I came across the feature inject-passwords (see here). However, this documentation neither describes on how to use the variable within the jenkins environment, nor what 'encrypted' password means (How to encrypt?). The link leading to the EnvInj...
Alex
1

votes
3

answer
1.8k

Views

jenkinsfile parameter properties not configured in jenkins server at initial branch creation

I have configured jenkinsfile with below properties, but it doesn't apply on jenkins server when creating a new branch from master branch. #!groovy properties([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [ [$class: 'StringParameterDefinition', name: 'isValid', defaultValue: 'false...
Yahwe Raj
1

votes
2

answer
1.5k

Views

How to fix Memory error in Ansible?

Now i m trying to copy the file from /Build_Artifacts/build.zip to /Build_Artifacts/. Permission was set to 777 for /Build_Artifacts/. while running the playbook it reports as Memory error!! cat deploy.yml hosts: '{{host}}' user: soundar tasks: - name: copying copy: src=/Build_Artifacts/build.zip d...
soundararajan.c
1

votes
2

answer
576

Views

Promote build with Jenkins API

Given a Jenkins build job with different promotion jobs (i.e., that promote builds to different environments), how can one trigger a specific promotion job for a specific build using the Jenkins API?
blashmet
0

votes
0

answer
2

Views

Copy explicit directory and files/subdirs

I am using the Copy to Slave plugin for Jenkins, I want to copy some artifacts back the the master node workspace. I was following the information in (Ant -- copying files and subdirectories from only one subdirectory on a tree. The problem is that it's a Node application so a lot of nested directo...
rup
1

votes
2

answer
1k

Views

Dockerfile: add npm to an existing docker image

Having a Jenkins Docker image, I would like to add the complete 'npm' environment to that image. So after building the Dockerfile I have an image with both Jenkins and the 'npm' environment. The purpose is that a Jenkins job to run the shell command 'npm'. So 'npm' should be on the $PATH (in Ubuntu...
tjm1706
1

votes
1

answer
57

Views

Jenkins setup fails - Error “Non-resolvable import POM”

I am trying to setup a Continuous Delivery pipeline using Jenkins for the address-manager application built using Java and S4/HANA Extension SDK. I have followed the instruction and tried to implement along the lines of Week 3 - Unit 2 material of this course. But upon starting Jenkins and starting...
turnip424
1

votes
1

answer
63

Views

Jenkins Error - errorWhenCurrentBuildResultIsWorseOrEqualTo.groovy

I am trying to setup a Continuous Delivery pipeline using Jenkins for the address-manager application built using Java and S4/HANA Extension SDK. But upon starting Jenkins and starting the app for pipeline build on localhost, I see that the job which I schedule as a multi branch fails. The errors I...
turnip424
1

votes
2

answer
202

Views

In nodejs, can I have sub-folders that each sub-folder host a AWS lambda function?

I am trying to implement a serverless application on AWS. I wish to know a good way to organize my codes. Let's say, I want to have multiple lambda functions to be organized under a git repo, each lambda function and it's associated codes are in its own sub-folder. This is what I have tried, separa...
GreenLake4964
1

votes
3

answer
33

Views

Jenkins Build Failing for Angular 6

I am using Jenkins for Angular 6 Project Build Purpose and getting below error: /app/apache-tomcat-8.5.34/temp/jenkins423226075999853444.sh: 27: /app/apache-tomcat-8.5.34/temp/jenkins423226075999853444.sh: ng: not found I tried to add @angular/cli but no luck. What's the solution for this issue?
poojagupta
3

votes
1

answer
51

Views

How to consume shared/common groovy methods in context of Jenkins Job DSL Plugin

using GroovyConsole I have file main.groovy with: new Helpers().test('test method called') and in the same dir have file Helpers.groovy with content def test(String str) { println 'test method called with: ' + str } Running results in results: groovy> new Helpers().test('test method called') test m...
JohnZaj
1

votes
0

answer
647

Views

Jenkins : Cannot invoke method scheduleBuild() on null object

I am using System Groovy script in Jenkins to invoke another job. Below is my code : def trigger(BRANCH) { println '$BRANCH' println 'pppppp' // Start another job def job = Hudson.instance.getJob('Step2') def anotherBuild try { def params = [ new StringParameterValue('BRANCH', BRANCH), ] def future...
Angel491
1

votes
0

answer
208

Views

How can I resolve this error from Jenkins?

I'm new to macOS. I have installed latest Jenkins LTS (2.89.2) on my machine. Now I'm getting this message on the Jenkins home URL: A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please v...
Rajasekar
1

votes
2

answer
3.4k

Views

The process cannot access the file because it is being used by another process. Jenkins Build

When we abort one of the Jenkins Job builds running on windows slave, and then try to retrigger, that new triggered build fails with below error: The process cannot access the file because it is being used by another process. while deleting the workspace.
Anurag Sharma
1

votes
0

answer
1.2k

Views

How to setup docker in Jenkins?

My question is on how to setup docker in jenkins We have one master server and 5 linux slaves and 2 windows slaves We are using artifactory to store docker images. What would be the steps to intergrate docker in jenkins ? Do I need to install docker on linux and windows slaves or any plugin installa...
devops
1

votes
1

answer
165

Views

Should selenium tests be kept in separate project

I have a Java web app (Maven) where I have some Selenium tests.The testing framework is Junit 4.x. I'm also using Jenkins for CI. Right now all my tests (integration + selenium) are kept under the src/test folder of the project.(classic maven structure) Due to the fact that Jenkins cannot run se...
Videanu Adrian
1

votes
2

answer
1.2k

Views

How to run a TestNG.xml through a Shell Script in Jenkins?

First Step: I created a BAT File with below mentioned commands and tried running it > It did successfully run the TestNG Suite with all the tests I had configured. Next Step: was to set up the Jenkins I was trying to run the bat file with the Add build setup > execute Windows bat command > cd /d %...
S K
1

votes
1

answer
175

Views

Setting envvars in Jenkins plugin

I'm trying to develop new Jenkins plugin. I've started from hello-world archetype provided by Jenkins. My plugin works fine! Bun now i want to put some environment variables from my plugin. I've used whis code to do it public void perform(Run run, FilePath workspace, Launcher launcher, TaskListener...
r1x
1

votes
1

answer
61

Views

Jenkins- How to create Jenkins jobs, build jobs with maven(build) and git(SCM) programatically using java

I'm new to Jenkins, I want to automate the Jenkins manual procedure like creating a new job, configuring job like (scm, build, post build activities), Build Now, verifying the build status. I'm a java developer so I wanted to do above all Jenkins activities through java programmatically. Please pro...
Suresh K
1

votes
0

answer
185

Views

CORS with SonarQube

I am trying to put an iframe tag inside my jenkins website from sonarqube (version 6.7) specific project. i get this error: 'refused to display 'https://...' in a frame beacuse it set X-Frame-Options to sameorigin' I added this code to the web.xml file - CorsFilter org.apache.catalina.filters.CorsF...
Noa Amir

View additional questions