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

Credentials-binding plugin is executed after pre-release build steps of release-plugin

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins 1.609.3
      release-plugin:2.5.4
      credentials-binding-plugin:1.9
    • Similar Issues:

      Description

      Problem

      Injecting credentials through the credentials-binding plugin is done too late when using the prebuild steps of the release-plugin.
      The credentials-binding plugin is executed after the prebuild steps of the release-plugin, so any injected credentials cannot be used it.

      Steps to reproduce
      • Inject a secret through the credentials-binding plugin
      • Enable 'configure a release' build wrapper
      • Configure the release-plugin with a pre-release shell step, which echoes the injected secret to build log
      • Create a normal shell build step which echoes the injected secret to build log

      See trigger-release-build.txt for an output of the above steps.
      You see that the injected secret is not available in the pre-release step of the release-plugin buildwrapper, but it is in the normal build step.

      Expected behavior

      As a user, I can inject the credentials and use them with the pre-release steps of the release-plugin.

        Attachments

          Issue Links

            Activity

            Show
            hawky4s Christian Lipphardt added a comment - Created https://github.com/jenkinsci/credentials-binding-plugin/pull/21 as fix.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christian Lipphardt
            Path:
            src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/SecretBuildWrapper.java
            src/test/java/org/jenkinsci/plugins/credentialsbinding/impl/BuildWrapperOrderCredentialsBindingTest.java
            http://jenkins-ci.org/commit/credentials-binding-plugin/ce241a4c77cf2b0098dcd39ebac7d5654b5c7d9a
            Log:
            Add ordinal 100 to Extension annotation

            • so the credentials-binding plugin is executed at the beginning of the
              BuildWrapper phase. Otherwise it is executed too late, eg. when using
              the pre-release build steps of the release-plugin and no credentials
              are injected beforehand.
            • add test case

            fixes JENKINS-37871

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christian Lipphardt Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/SecretBuildWrapper.java src/test/java/org/jenkinsci/plugins/credentialsbinding/impl/BuildWrapperOrderCredentialsBindingTest.java http://jenkins-ci.org/commit/credentials-binding-plugin/ce241a4c77cf2b0098dcd39ebac7d5654b5c7d9a Log: Add ordinal 100 to Extension annotation so the credentials-binding plugin is executed at the beginning of the BuildWrapper phase. Otherwise it is executed too late, eg. when using the pre-release build steps of the release-plugin and no credentials are injected beforehand. add test case fixes JENKINS-37871
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/SecretBuildWrapper.java
            src/test/java/org/jenkinsci/plugins/credentialsbinding/impl/BuildWrapperOrderCredentialsBindingTest.java
            http://jenkins-ci.org/commit/credentials-binding-plugin/65ce454b23d8475c9b74fcc871e7667d2c5e0b76
            Log:
            Merge pull request #21 from camunda-ci/JENKINS-37871

            JENKINS-37871 Add ordinal 100 to Extension annotation

            Compare: https://github.com/jenkinsci/credentials-binding-plugin/compare/c62a5a6dcb5c...65ce454b23d8

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/SecretBuildWrapper.java src/test/java/org/jenkinsci/plugins/credentialsbinding/impl/BuildWrapperOrderCredentialsBindingTest.java http://jenkins-ci.org/commit/credentials-binding-plugin/65ce454b23d8475c9b74fcc871e7667d2c5e0b76 Log: Merge pull request #21 from camunda-ci/ JENKINS-37871 JENKINS-37871 Add ordinal 100 to Extension annotation Compare: https://github.com/jenkinsci/credentials-binding-plugin/compare/c62a5a6dcb5c...65ce454b23d8

              People

              • Assignee:
                hawky4s Christian Lipphardt
                Reporter:
                hawky4s Christian Lipphardt
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: