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

Allow job build variables to be used in the baseline name

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • dimensionsscm-plugin
    • None

      i tried using variable in baseline name template.

      i got below success message.
      Baseline DOCS:DOCSWF_${NEWVERSION} has been forwarded to

          [JENKINS-45013] Allow job build variables to be used in the baseline name

          David Conneely added a comment - - edited

          Currently, the baseline name pattern (I will use the word "pattern" instead of "template" to avoid confusion) can include the following "variables" (taken straight from the help for the form field) :

          • [PROJECTID] includes the name of the Dimensions CM project or stream being monitored into the baseline name.
          • [HUDSON_PROJECT] includes the name of the Jenkins project / job name into the baseline name.
          • [DM_BASELINE] includes the build variable ${DM_BASELINE} into the baseline name.
          • [BUILDNO] includes the Jenkins job build number into the baseline name.
          • [CURRENT_DATE] includes the current date in
            "yyyy.MMMMM.dd hh:mm:ss aaa z" format, e.g. "2010.May.15 12:15:01 PM BST", into the baseline name.

          For example, the baseline name pattern
              [PROJECTID]_I_[HUDSON_PROJECT]_D_[BUILDNO]_C_[CURRENT_DATE]
          might create a baseline with a name like
              QLARIUS:JAVADEV_I_JAVADEV_hudson_D_10_C_2010.May.08 11:10:11 PM BST

          If you specify a baseline name pattern that contains no variables in it, then the pattern will be used directly as the baseline name.

          Note the variables in the baseline name pattern are not specified in the standard "${VARIABLE_NAME}" format used elsewhere in Jenkins, but as "[VARIABLE_NAME]" instead, and you can only use these specific variable names.


          I believe that this new issue is asking for the above functionality to be extended to allow arbitrary build variables that have been defined on the Jenkins job to also be used in the baseline name pattern, as well as the above fixed variable names?

          If so, then that sounds like a very reasonable improvement request and should not be too hard to implement quickly. Can you confirm?

          As a workaround in the meantime, note that if you add a build variable to the job called DM_BASELINE then you can refer to this one specific build variable in the baseline name pattern using "[DM_BASELINE]".

          David Conneely added a comment - - edited Currently, the baseline name pattern (I will use the word "pattern" instead of "template" to avoid confusion) can include the following "variables" (taken straight from the help for the form field) : [PROJECTID] includes the name of the Dimensions CM project or stream being monitored into the baseline name. [HUDSON_PROJECT] includes the name of the Jenkins project / job name into the baseline name. [DM_BASELINE] includes the build variable ${DM_BASELINE } into the baseline name. [BUILDNO] includes the Jenkins job build number into the baseline name. [CURRENT_DATE] includes the current date in " yyyy.MMMMM.dd hh:mm:ss aaa z " format, e.g. " 2010.May.15 12:15:01 PM BST ", into the baseline name. For example, the baseline name pattern      [PROJECTID] _I_ [HUDSON_PROJECT] _D_ [BUILDNO] _C_ [CURRENT_DATE] might create a baseline with a name like      QLARIUS:JAVADEV_I_JAVADEV_hudson_D_10_C_2010.May.08 11:10:11 PM BST If you specify a baseline name pattern that contains no variables in it, then the pattern will be used directly as the baseline name. Note the variables in the baseline name pattern are not specified in the standard " ${VARIABLE_NAME }" format used elsewhere in Jenkins, but as " [VARIABLE_NAME] " instead, and you can only use these specific variable names. – I believe that this new issue is asking for the above functionality to be extended to allow arbitrary build variables that have been defined on the Jenkins job to also be used in the baseline name pattern, as well as the above fixed variable names? If so, then that sounds like a very reasonable improvement request and should not be too hard to implement quickly. Can you confirm? As a workaround in the meantime, note that if you add a build variable to the job called DM_BASELINE then you can refer to this one specific build variable in the baseline name pattern using " [DM_BASELINE] ".

          yes.please treat this as enhancement.thank you very much for your quick reply..i tried using DM_BASELINE but in a single build im building my app if its success then im creating baseline.its not working as while checkout its using baseline.
          also can you suggest me if there is any way to checkout created baseline and do build in same build plan ?.
          we usually deploy only baseline tar files on server.

          srikanth chikoti added a comment - yes.please treat this as enhancement.thank you very much for your quick reply..i tried using DM_BASELINE but in a single build im building my app if its success then im creating baseline.its not working as while checkout its using baseline. also can you suggest me if there is any way to checkout created baseline and do build in same build plan ?. we usually deploy only baseline tar files on server.

          OK - good point about DM_BASELINE. Sorry for misleading you with that. In that context, DM_BASELINE is really for rebuilding things.

          I don't know if it helps in your situation, but one suggestion to bear in mind is that, if you are using slave nodes, your build script can call dmcli directly (since dmcli must be available on the system path for the plugin to work) and run any Dimensions command line you'd like.

          I'll look at implementing your suggested enhancement very soon (there is a 0.8.14 release I'm about to release for another issue, but after that has been released, I can start work on using build variables in the baseline name). Thanks again for the good suggestion.

          David Conneely added a comment - OK - good point about DM_BASELINE . Sorry for misleading you with that. In that context, DM_BASELINE is really for rebuilding things. I don't know if it helps in your situation, but one suggestion to bear in mind is that, if you are using slave nodes, your build script can call dmcli directly (since dmcli must be available on the system path for the plugin to work) and run any Dimensions command line you'd like. I'll look at implementing your suggested enhancement very soon (there is a 0.8.14 release I'm about to release for another issue, but after that has been released, I can start work on using build variables in the baseline name). Thanks again for the good suggestion.

          srikanth chikoti added a comment - - edited

          how to use dmcli ? could you please send me sample checkout and check in commands.
          in my local where i installed dimensions client i am able to get some help on dmcli. How to use this with plugin.It is working only streams. But we have only projects 

          srikanth chikoti added a comment - - edited how to use dmcli ? could you please send me sample checkout and check in commands. in my local where i installed dimensions client i am able to get some help on dmcli. How to use this with plugin.It is working only streams. But we have only projects 

          The Command-Line Reference Guide documentation has all the available commands documented in more detail than I could ever manage . For checkin and checkout you probably want either RI and EI (for single files), or DELIVER and UPDATE (for changesets) - it may also depend on precisely which server version you have.

          To use dmcli, just call it from within a Batch script (or shell script if using Linux) step in your Jenkins job. There is no special integration with the Jenkins Dimensions Plugin needed - anything you can do from a normal command-prompt should also work in a Jenkins script step.

          If there is an issue with the Jenkins Dimensions Plugin that causes something to only work with streams and not with projects, please do let me know. As far as I know, it should work fine with either.

          David Conneely added a comment - The Command-Line Reference Guide documentation has all the available commands documented in more detail than I could ever manage . For checkin and checkout you probably want either RI and EI (for single files), or DELIVER and UPDATE (for changesets) - it may also depend on precisely which server version you have. To use dmcli, just call it from within a Batch script (or shell script if using Linux) step in your Jenkins job. There is no special integration with the Jenkins Dimensions Plugin needed - anything you can do from a normal command-prompt should also work in a Jenkins script step. If there is an issue with the Jenkins Dimensions Plugin that causes something to only work with streams and not with projects, please do let me know. As far as I know, it should work fine with either.

          Could you please share it. I tried a lot in google searching for it. But i didn't find it.It can be any version. Atleast i will get some idea

          srikanth chikoti added a comment - Could you please share it. I tried a lot in google searching for it. But i didn't find it.It can be any version. Atleast i will get some idea

          David Conneely added a comment - - edited

          No problem! See http://help.serena.com/doc_center/doc_center.html#dcm, select the version and then open the Documentation Portfolio link, or see https://supportline.microfocus.com/productdoc.aspx and select Dimensions CM and your version.

          If you're using version 14.3.3, then a direct link to the Command-Line Reference Guide is: http://help.serena.com/doc_center/cm/ver1433/dmcm_command-line_ref.pdf.

          David Conneely added a comment - - edited No problem! See http://help.serena.com/doc_center/doc_center.html#dcm , select the version and then open the Documentation Portfolio link, or see  https://supportline.microfocus.com/productdoc.aspx  and select Dimensions CM and your version. If you're using version 14.3.3, then a direct link to the Command-Line Reference Guide is:  http://help.serena.com/doc_center/cm/ver1433/dmcm_command-line_ref.pdf .

          Thanks a lot

          srikanth chikoti added a comment - Thanks a lot

          srikanth chikoti added a comment - - edited

          I went through document and tested all check in and check out native commands locally. in local i have client installed and hence it has path env set.
          But in jenkins it fails with command . How to set path. Thanks for help in advance
          dmcli: command not found

          srikanth chikoti added a comment - - edited I went through document and tested all check in and check out native commands locally. in local i have client installed and hence it has path env set. But in jenkins it fails with command . How to set path. Thanks for help in advance dmcli: command not found

          I tried tagging a baseline. it's creating baseline. but I think it will have items which are with baseline status in workset. I need to action all items with worked status to baseline before tagging. How to achieve this with plugin or cmd

          srikanth chikoti added a comment - I tried tagging a baseline. it's creating baseline. but I think it will have items which are with baseline status in workset. I need to action all items with worked status to baseline before tagging. How to achieve this with plugin or cmd

            Unassigned Unassigned
            sri154818 srikanth chikoti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: