in Technology by

How Jenkins jobs can be Triggered/Stopped/Controlled programmatically?

1 Answer

0 votes
by

Jenkins Remote Access API can be used to do things like -

  • Retrieving information about jobs, views, nodes, builds, etc. from Jenkins for programmatic consumption.
  • Trigger a build (both parameterized & non-parameterized), stop/abort a build, enable/disable a Job, group/remove jobs into/from views, etc.
  • Create/copy/modify/delete jobs.

and many other programming language-specific functionalities. It has wrappers for main programming languages like - Python, Ruby & Java. It can be triggered via CURL as below -

Jobs without parameters

Simply an HTTP POST on JENKINS_URL/job/JOBNAME/build.

Jobs with parameters

Simple example - sending "String Parameters":

curl JENKINS_URL/job/JOB_NAME/buildWithParameters  --user USER:TOKEN --data id=123 --data verbosity=high

Related questions

0 votes
    How to get the Jenkins version programmatically in Jobs/Pipelines or nodes other than master?...
asked Sep 14, 2021 in Technology by JackTerrance
0 votes
    How to download the Console log for a particular Jenkins build programmatically?...
asked Jul 17, 2021 in Technology by JackTerrance
0 votes
    In Jenkins, is there a way to restrict the user to view only certain jobs? Only through "Project-based ... allows job restriction? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    How can learning process be stopped in backpropagation rule? (a) there is convergence involved (b) no heuristic ... ) none of the mentioned Please answer the above question....
asked Sep 3, 2022 in Education by JackTerrance
0 votes
    Build can be triggered by a version control tool. (i)True (ii)False...
asked Oct 5, 2020 in Technology by Editorial Staff
0 votes
    Private builds can be triggered automatically. (i)False (ii)True...
asked Oct 5, 2020 in Technology by Editorial Staff
0 votes
    Network traffic can be controlled in _______ ways. A. 1 B. 2 C. 3 D. 4...
asked Nov 21, 2022 in Education by JackTerrance
0 votes
    I found the following piece of code from the adw launcher: Object service = launcher.getSystemService("statusbar ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    Suppose you have three Jobs of which Jobs 1 and 2 are executed parallelly. Job 3 executes only after Jobs 1 and ... can be used to set this up? tUnite tPostJob tRunJob tParallelize...
asked Mar 24, 2021 in Technology by JackTerrance
0 votes
    The HDFS components can only be used with Big Data batch or Big Data streaming Jobs. True False...
asked Mar 23, 2021 in Technology by JackTerrance
0 votes
    Can you define a variable which can be accessed from multiple Jobs?...
asked Mar 18, 2021 in Technology by JackTerrance
0 votes
    MapReduce jobs submitted from either Oozie, Pig or Hive can be used to encode, improve and sample the data sets ... of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    What command is used for remove all stopped containers, unused networks, build caches, and dangling images? docker system kill ... kill -a docker system prune docker system rm -a...
asked Jun 22, 2021 in Technology by JackTerrance
0 votes
    Functional testing can be automated using Jenkins? 1. True 2. False...
asked Mar 7, 2021 in Technology by JackTerrance
0 votes
    I have a Selenium Python automated regression test script running on our 64bit Server on IE11, Windows ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
...