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

Manual promotion : Bad build number and project name in ext-email

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: promoted-builds-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.343, using email-ext plugin
    • Similar Issues:
      Show 5 results

      Description

      I suppose this is compatibility problem with the plugin email-ext.
      What occurs is the following :

      Mail title : 5 » promotion » Promo1 - Build # 5 - Building!
      Mail body : 5 » promotion » Promo1 5

      email-ext config title : $DEFAULT_SUBJECT
      emain-ext config body : $PROJECT_NAME $BUILD_NUMBER

      I tried to set a variable like you did with PROMOTED_URL using the following but I failed (Indeed, PROMOTED_URL is not resolved)

      In Promotion.java:67
      <code>
      @Override
      public EnvVars getEnvironment(TaskListener listener) throws IOException, InterruptedException

      { EnvVars e = super.getEnvironment(listener); String rootUrl = Hudson.getInstance().getRootUrl(); e.put("PROMOTED_NAME","nameTest"); e.put("PROMOTED_NUMBER",Integer.toString(targetBuildNumber)); if(rootUrl!=null) e.put("PROMOTED_URL",rootUrl+getTarget().getUrl()); return e; }

      </code>

        Attachments

          Activity

          Hide
          damickjj damickjj added a comment -

          Mainly using:
          JOB_NAME
          SVN_REVISION
          BUILD_NUMBER
          BUILD_ID
          BUILD_URL
          and other environment variables defined for that job.

          I want to make sure these are from the build, not the promotion job which is why i added the namespace "PROMOTED_" since the build url was link to the promotion, not the actual build. But it's been a while, maybe this works right now?

          Show
          damickjj damickjj added a comment - Mainly using: JOB_NAME SVN_REVISION BUILD_NUMBER BUILD_ID BUILD_URL and other environment variables defined for that job. I want to make sure these are from the build, not the promotion job which is why i added the namespace "PROMOTED_" since the build url was link to the promotion, not the actual build. But it's been a while, maybe this works right now?
          Hide
          svd svd added a comment -

          Making build parameters available is another great idea! I like both.
          Like damickjj mentioned, various environment variables may be needed for some people, while others may need parameter values.

          Show
          svd svd added a comment - Making build parameters available is another great idea! I like both. Like damickjj mentioned, various environment variables may be needed for some people, while others may need parameter values.
          Hide
          petehayes Peter Hayes added a comment -

          PROMOTED_URL has been there and then I also added PROMOTED_JOB_NAME and PROMOTED_NUMBER. I just added BUILD_ID. Is SVN_REVISION the revision of the build being promoted or is it the revision of the workspace at the time the build is promoted?

          Show
          petehayes Peter Hayes added a comment - PROMOTED_URL has been there and then I also added PROMOTED_JOB_NAME and PROMOTED_NUMBER. I just added BUILD_ID. Is SVN_REVISION the revision of the build being promoted or is it the revision of the workspace at the time the build is promoted?
          Hide
          petehayes Peter Hayes added a comment -

          I'm also trying to figure out how the environment that is being generated by your patch is any different than the environment that is being seeded by the promotion itself. Can you do a comparison between the PROMOTED_ variables and the others? I expect JOB_NAME, BUILD_NUMBER, BUILD_ID, BUILD_URL to be different, but I'm not sure about any others.

          Show
          petehayes Peter Hayes added a comment - I'm also trying to figure out how the environment that is being generated by your patch is any different than the environment that is being seeded by the promotion itself. Can you do a comparison between the PROMOTED_ variables and the others? I expect JOB_NAME, BUILD_NUMBER, BUILD_ID, BUILD_URL to be different, but I'm not sure about any others.
          Hide
          damickjj damickjj added a comment -

          i finally was able to come back around to this, here is more info:

          $

          {ENV,var="PROMOTED_NUMBER"}

          => 46
          $

          {ENV,var="PROMOTED_JOB_NAME"}

          => myproj
          $

          {ENV,var="BUILD_URL"}

          => http://build3.xxxx.com/job/myproj/46/promotion/myproj_to_QA/promotionBuild/10

          I'd really like to be able to get the SVN_REVISION of that used in the build that i'm promoting. The other issue is that I have some defined environment variables that are used for the build VERSION is my example, which I'd like to add to the email that is generated from the promotion.

          Show
          damickjj damickjj added a comment - i finally was able to come back around to this, here is more info: $ {ENV,var="PROMOTED_NUMBER"} => 46 $ {ENV,var="PROMOTED_JOB_NAME"} => myproj $ {ENV,var="BUILD_URL"} => http://build3.xxxx.com/job/myproj/46/promotion/myproj_to_QA/promotionBuild/10 I'd really like to be able to get the SVN_REVISION of that used in the build that i'm promoting. The other issue is that I have some defined environment variables that are used for the build VERSION is my example, which I'd like to add to the email that is generated from the promotion.

            People

            • Assignee:
              petehayes Peter Hayes
              Reporter:
              tdutreui tdutreui
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: