Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29826

Cannot trigger Jenkins Workflow DSL jobs with jenkins-cli

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • cli, pipeline
    • Kubernetes, Jenkernetes docker image

      Using the list command I can see the workflow jobs returned but when I try the build or console commands an error is returned saying the job could not be found. I created a test freestyle project and that can be triggered so it only affects the workflow jobs.

      bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8 list-jobs
      workflow-job1
      freestyle-job1
      

      Error:

      bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console workflow-job1
      No such job 'workflow-job1'; perhaps you meant 'freestyle-job1'?
      java -jar jenkins-cli.jar console JOB [BUILD] [-f] [-n N]
      Produces the console output of a specific build to stdout, as if you are doing 'cat build.log'
       JOB   : Name of the job
       BUILD : Build number or permalink to point to the build. Defaults to the last
               build
       -f    : If the build is in progress, stay around and append console output as
               it comes, like 'tail -f'
       -n N  : Display the last N lines
      

      The freestyle job works correctly..

      bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console freestyle-job1
      Started from command line by ha:AAAAmx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzOEgZ+/dLi1CL9xLz8vMrc/NJiAJjzDjjEAAAAanonymous
      Building in workspace /var/jenkins_home/jobs/freestyle-job1/workspace
      [workspace] $ /bin/sh -xe /tmp/hudson1774308920514103607.sh
      + echo worked
      worked
      Finished: SUCCESS
      

            jglick Jesse Glick
            rawlingsj James Rawlings
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: