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

Justin Harringa asked me to open this: pipeline triggers not working using https://github.com/jenkinsci/config-driven-pipeline-plugin

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • jenkins is running on ubuntu
      version - CloudBees Jenkins Distribution 2.222.1.1-rolling
      plugin version -1.2

      this is the triggers section of my pipeline. None of these jobs are running automatically.
      triggers

      { cron( getWorkSpace() =~ 'Nightly/MP-NightlyBuilds/branches/integration_branches/int_mp_ui' ? 'H 3 * * 2-6' : getWorkSpace() =~ 'Nightly/MP-NightlyBuilds/branches/integration_branches/int_mp' ? 'H 1 * * 2-6' : getWorkSpace() =~ 'Nightly/MP-NightlyBuilds/branches/integration_branches/int_mp_cp' ? 'H 0 * * 2-6' : getWorkSpace() =~ 'WeeklyBuilds/MP_Weekly_570_Release/branches/integration_branches/int_mp_ui' ? 'H 23 * * 0' : getWorkSpace() =~ 'WeeklyBuilds/MP_Weekly_570_Release/branches/integration_branches/int_mp' ? 'H 21 * * 0' : getWorkSpace() =~ 'WeeklyBuilds/MP_Weekly_570_Release/branches/integration_branches/int_mp_cp' ? 'H 20 * * 0' : getWorkSpace() == 'Nighlty/CP-NightlyBuilds/branches/int/int_cp' ? 'H 23 * * 1-5' : '') }

      this section of the pipeline works fine in a normal pipeline type job but not in the config driven type.

          [JENKINS-62211] Justin Harringa asked me to open this: pipeline triggers not working using https://github.com/jenkinsci/config-driven-pipeline-plugin

          marlene cote added a comment -

          I noticed a typo in the line for the cp nightly build and corrected it. Here is the new line:
          getWorkSpace() == 'Nightly/CP-NightlyBuilds/branches/int/int_cp' ? 'H 20 * * 4-6' :
          but it still failed to trigger last night.

          marlene cote added a comment - I noticed a typo in the line for the cp nightly build and corrected it. Here is the new line: getWorkSpace() == 'Nightly/CP-NightlyBuilds/branches/int/int_cp' ? 'H 20 * * 4-6' : but it still failed to trigger last night.

          Thanks funeeldy! If I recall correctly, some triggers require an initial pipeline run to save (even for a raw pipeline without this plugin) but that may have been fixed. I'm also curious if this may have something to do with `getWorkSpace()`. Will take a look.

          Justin Harringa added a comment - Thanks funeeldy ! If I recall correctly, some triggers require an initial pipeline run to save (even for a raw pipeline without this plugin) but that may have been fixed. I'm also curious if this may have something to do with `getWorkSpace()`. Will take a look.

          Justin Harringa added a comment - - edited

          funeeldy ah! Actually, I believe what is going on here is that the template may not actually be in the actual job workspace since we attempt to do a lightweight checkout (so getWorkSpace() will likely return null or something unexpected - I think that's your declared method if I understand correctly). Would you be able to utilize env.BRANCH_NAME instead of getWorkSpace() or perhaps one of the other envs (JOB_NAME may be another candidate depending on whether this is a MultiBranch setup or another root job type)?

          Justin Harringa added a comment - - edited funeeldy ah! Actually, I believe what is going on here is that the template may not actually be in the actual job workspace since we attempt to do a lightweight checkout (so getWorkSpace() will likely return null or something unexpected - I think that's your declared method if I understand correctly). Would you be able to utilize env.BRANCH_NAME instead of getWorkSpace() or perhaps one of the other envs  ( JOB_NAME may be another candidate depending on whether this is a MultiBranch setup or another root job type)?

          marlene cote added a comment -

          thanks I will give this a try

          marlene cote added a comment - thanks I will give this a try

          Great! Please let us know what you find out funeeldy. Take care!

          Justin Harringa added a comment - Great! Please let us know what you find out funeeldy . Take care!

            justinharringa Justin Harringa
            funeeldy marlene cote
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: