Questions tagged [jenkins-cli]

Jenkins has a built-in command line client that allows you to access Jenkins from a script or from your shell. This is convenient for automation of routine tasks, bulk updates, trouble diagnosis, and so on.

has a built-in command line client that allows you to access from a script or from your . This is convenient for automation of routine tasks, bulk updates, trouble diagnosis, and so on.

679 questions
79
votes
4 answers

Same workspace for multiple jobs

I have a job called "development" and another project called "code analysis". At the moment we have two different jobs and different workspaces, but same code; is there any way we could use the same workspace for multiple jobs?I checked the plugins…
Scg
  • 989
  • 1
  • 7
  • 14
41
votes
4 answers

Jenkins-Build when a change is pushed to GitHub option is not working

Jenkins is running on localhost. I have my repository in GitHub. I have the option to 'Build when a change is pushed to GitHub' checked. When I click 'Build Now', build is done successfully, no issues there. But when am committing code to my…
Anuj Balan
  • 7,629
  • 23
  • 58
  • 92
32
votes
1 answer

How do I know which stage of jenkins pipeline has failed

In my Jenkins pipelines I generally use post declarative function to send me an email incase the pipeline has failed. A simple syntax of the post function is as under: post { failure { mail to: 'team@example.com', subject:…
Yash
  • 2,944
  • 7
  • 25
  • 43
29
votes
6 answers

Check Jenkins job status after triggering a build remotely

I have a script to trigger a job on Jenkins remotely using a token. Here is my script: JENKINS_URL='http://jenkins.myserver.com/jenkins' JOB_NAME='job/utilities/job/my_job' JOB_TOKEN='my_token' curl…
Nam Nguyen
  • 5,668
  • 14
  • 56
  • 70
26
votes
5 answers

How to use Jenkins parameters in a shell script

I want to use the parameters that we define in the Jenkins job as arguments to the shell commands in the same job. I have created a parameterized build with the following parameters: high.version: 234 low.version: 220 I want to use these variables…
IMRAN SHAIK
  • 615
  • 2
  • 6
  • 11
21
votes
2 answers

Jenkins throwing error: jenkins.model.InvalidBuildsDir: ${ITEM_ROOTDIR}/builds does not exist and probably cannot be created

i updated Jenkins from apt command line on Ubuntu,i did sudo apt upgrade jenkins immediately after update i am getting this: jenkins.model.InvalidBuildsDir: ${ITEM_ROOTDIR}/builds does not exist and probably cannot be created at…
chandra
  • 693
  • 3
  • 8
  • 21
21
votes
6 answers

Jenkins command to get number of builds in queue

I am trying to get the number of builds in the Jenkins Build Queue. May I know the Jenkins command to get the number of builds running in the queue ?
Lokith
  • 211
  • 1
  • 2
  • 4
15
votes
3 answers

Upload secret file credentials to Jenkins with REST / CLI

How can I create a Jenkins Credential via REST API or Jenkins CLI? The credential should be of type "secret file", instead of a username / password combination. The question is similar to this question, but not the same or a duplicate.
Amir Hadi
  • 308
  • 2
  • 9
12
votes
3 answers

Jenkins fails to build when I use a parameterised branch: fatal: Couldn't find remote ref refs/heads/${BUILD_BRANCH}

As soon as I attempted to upgrade my Jenkins job to use a parameter for the branch rather than a hard coded value it no longer works. Have tried many other names than BUILD_BRANCH Here I've tried ${env.BUILD_BRANCH}, refs/heads${BUILD_BRANCH} and…
King
  • 827
  • 2
  • 10
  • 20
12
votes
4 answers

execute commands on remote host in a Jenkinsfile

i am trying to ssh into a remote host and then execute certain commands on the remote host's shell. Following is my pipeline code. pipeline { agent any environment { // comment added APPLICATION = 'app' ENVIRONMENT…
Shoaib Iqbal
  • 2,420
  • 4
  • 26
  • 51
12
votes
4 answers

How to restart Jenkins in Windows

Not able to restart Jenkins manually. Already tried all below ways: http://localhost:8080/safeRestart Error message: Jenkins cannot restart itself as currently configured. Manage Jenkins → Restart Safely Plugin. Error message: Jenkins cannot…
Rodger Nadal
  • 309
  • 2
  • 8
  • 21
11
votes
3 answers

jenkins-cli build on Cloudbees: "no such job"

I need to remotely trigger a Jenkins build hosted on CloudBees. Right now, I'm attempting to use jenkins-cli to no avail. Right now I am authenticating using a SSH key pair. When I do: $ java -jar jenkins-cli.jar -s https://... list-jobs All I can…
10
votes
2 answers

Which Jenkins Command to Get the List of Changed Files

In a Jenkins build I see a list of changed files: So which command Jenkins uses to get this list (I am using git for repository version control).
Men X
  • 153
  • 1
  • 2
  • 8
10
votes
3 answers

Jenkins IOS App Getting failed FATAL: No global development team or local team ID was configured

I am using Jenkins for IOS apps from long back, It was working good before, But Recently I am getting one issue, I am not able to fix the issue. What might be the issue, Does anybody fixed this issue. I am getting below error FATAL: No global…
Damodar
  • 707
  • 2
  • 10
  • 23
10
votes
3 answers

Execute Shell script from workspace on remote machine after build successful (Jenkins)

The scenario is - I have a job A which runs my ant script and packages the artifact's for me. I am also using parametrized Triggered plug in to Trigger my "Job B" which will deploy my artifact on remote machine. The job A is working fine and also…
Abhijeet Kamble
  • 3,131
  • 2
  • 30
  • 36
1
2 3
45 46