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

authenticationToken has been deprecated.

    Details

    • Similar Issues:

      Description

      authenticationToken has been deprecated from pipeline jobs. how can we trigger pipeline remotely? 

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Not sure what is this query about.

            Jobs are triggered via CLI or REST API, there should be nothing specific to Pipeline

            Show
            oleg_nenashev Oleg Nenashev added a comment - Not sure what is this query about. Jobs are triggered via CLI or REST API, there should be nothing specific to Pipeline
            Hide
            markus_b_b Markus Baur added a comment -

            In order to run pipeline scripts from a remote point one could write a script like this:

            curl -X POST "https://jenkins.host/job/my_cool_job/build"
            

            triggering a job on the jenkins server.
            For some good reasons this does not work without autorization, so jenkins returns "Authentication required" which is expected.

            Some time ago it was possible to add an authenticationToken to a pipelineJob, so this would essentially become

            curl -X POST "https://jenkins.host/job/my_cool_job/build" --data "token=MySuperSecretToken"
            

            So everyone in our department could trigger the job by invoking a simple script.
            There is one job for every computer in our department doing some management and thus these jobs change frequently.
            Because of this we are using jobDSL to update and configure all of those jobs. Since the token (and with it scm and concurrentBuild) are deprecated for pipelineJobs now, our infrastructure falls apart.

            So it would be nice if you could redirect us to the appropriate migration paths or reintroduce these features.

            Show
            markus_b_b Markus Baur added a comment - In order to run pipeline scripts from a remote point one could write a script like this: curl -X POST "https://jenkins.host/job/my_cool_job/build" triggering a job on the jenkins server. For some good reasons this does not work without autorization, so jenkins returns "Authentication required" which is expected. Some time ago it was possible to add an authenticationToken to a pipelineJob, so this would essentially become curl -X POST "https://jenkins.host/job/my_cool_job/build" --data "token=MySuperSecretToken" So everyone in our department could trigger the job by invoking a simple script. There is one job for every computer in our department doing some management and thus these jobs change frequently. Because of this we are using jobDSL to update and configure all of those jobs. Since the token (and with it scm and concurrentBuild) are deprecated for pipelineJobs now, our infrastructure falls apart. So it would be nice if you could redirect us to the appropriate migration paths or reintroduce these features.
            Hide
            akom Alexander Komarov added a comment - - edited

            I've confirmed that this worked in JobDSL 1.69 and stopped working in 1.70. 

            The functionality stopped having any effect on JobDSL generated PipelineJobs.

            It is still possible to edit the job by hand and have this option enabled, but regenerating the job makes it disappear despite having "authenticationToken(xxxx)" in the script.  What's worse, pipeline (ie Jenkinsfile) DSL does not permit setting this either, so there is no programmatic way of controlling this anymore.

            It would be nice to know whether this is a regression or an intentional change - I've started coding around this (creating freestyleJobs to wrap the pipeline jobs just so they can be triggered remotely), but hopefully I don't need to.

            Note: Migration claims that this functionality will be removed because Pipeline doesn't support it.  Yet it appears to be already gone even though Pipeline does support it...

            Show
            akom Alexander Komarov added a comment - - edited I've confirmed that this worked in JobDSL 1.69 and stopped working in 1.70.  The functionality stopped having any effect on JobDSL generated PipelineJobs. It is still possible to edit the job by hand and have this option enabled, but regenerating the job makes it disappear despite having "authenticationToken(xxxx)" in the script.  What's worse, pipeline (ie Jenkinsfile) DSL does not permit setting this either, so there is no programmatic way of controlling this anymore. It would be nice to know whether this is a regression or an intentional change - I've started coding around this (creating freestyleJobs to wrap the pipeline jobs just so they can be triggered remotely), but hopefully I don't need to. Note : Migration  claims that this functionality  will be removed because Pipeline doesn't support it.  Yet it appears to be already gone even though Pipeline  does support it...
            Hide
            markus_b_b Markus Baur added a comment -

            maybe comment on the linked ticket, you are much more visible there!

            Show
            markus_b_b Markus Baur added a comment - maybe comment on the linked ticket, you are much more visible there!
            Hide
            akom Alexander Komarov added a comment -

            Thanks Markus Baur, I didn't notice that link - Daniel Spilker mentions there that this functionality will be restored in the next release.  Downgraded to 1.69 and will wait for 1.71.

            Show
            akom Alexander Komarov added a comment - Thanks Markus Baur , I didn't notice that link - Daniel Spilker mentions there that this functionality will be restored in the next release.  Downgraded to 1.69 and will wait for 1.71.
            Hide
            jcrben Ben Creasy added a comment -

            The linked ticket mentioned above is the "duplicates" link https://issues.jenkins-ci.org/browse/JENKINS-31832

            Conversation also at https://groups.google.com/forum/#!topic/job-dsl-plugin/wQpbhPrafHY

            Does anyone have background on the underlying deprecation of these properties in the pipeline plugin? I left a comment here https://github.com/jenkinsci/job-dsl-plugin/pull/1131/files#r238954540

            Show
            jcrben Ben Creasy added a comment - The linked ticket mentioned above is the "duplicates" link https://issues.jenkins-ci.org/browse/JENKINS-31832 Conversation also at https://groups.google.com/forum/#!topic/job-dsl-plugin/wQpbhPrafHY Does anyone have background on the underlying deprecation of these properties in the pipeline plugin? I left a comment here https://github.com/jenkinsci/job-dsl-plugin/pull/1131/files#r238954540

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                jainsh shagun jian
              • Votes:
                6 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: