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

Manage view name and workspace root for clearcase jobs

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Critical Critical
    • clearcase-plugin
    • None
    • Platform: All, OS: All

      It would greatly simplify clearcase configuration within Hudson if the clearcase
      plugin would manage the view name itself and provide Hudson a workspace path
      within the view itself.

      View name management:

      I can't think of a good reason that users should specify the name of the view
      that Hudson will create. It would be better if Hudson used a convention for
      creating the view name based on the build agent the job is running on, the name
      of the job and some unique prefix (specified in global clearcase configuration
      setup). This would prevent users from running into issues with the same named
      view on different build agents. Also, users should never need to know the view
      name in order to configure the rest of the job so why bother having them input
      it at all?

      Workspace root management:

      This may require a change to core Hudson but I think it would be very helpful.
      The clearcase plugin should by default make the workspace root the view
      directory within the standard workspace. Additionally, it should accept a
      relative path within that directory to make the "workspace" so that downstream
      configuration can be relative to that directory. This would simplify and
      standardize a lot of the non-clearcase configuration of jobs (such as always
      including the path to the pom.xml file).

          [JENKINS-3387] Manage view name and workspace root for clearcase jobs

          tla612 added a comment -

          I can not get a Maven job to work with ClearCase dynamic views, and I believe
          this issue is part of the problem.

          I am using the ClearCase plugin with freestyle jobs with no problem. I can not
          get Maven jobs to work because I can not point Maven at the POM. When I start
          the dynamic view from Hudson, the POM is located at
          M:\my_view\VOB_A\foo\pom.xml. Maven is looking for the pom.xml in the workspace
          directory, so I get the error "ERROR: No such file
          C:\hudson_data\job1\my_view\pom.xml". If I try to specify the location of the
          POM using the "Root POM" field, I get the error "ERROR: No such file
          C:\hudson_data\job1\my_view\M:\my_view\VOB_A\foo\pom.xml"

          Is there a way to do one of the following:
          1. Specify the workspace for a maven2 job
          2. Use a fully qualified path to the POM for a maven2 job
          3. Have Hudson "cd" to a given directory before running mvn as part of a maven2 job

          Thanks a lot.

          tla612 added a comment - I can not get a Maven job to work with ClearCase dynamic views, and I believe this issue is part of the problem. I am using the ClearCase plugin with freestyle jobs with no problem. I can not get Maven jobs to work because I can not point Maven at the POM. When I start the dynamic view from Hudson, the POM is located at M:\my_view\VOB_A\foo\pom.xml. Maven is looking for the pom.xml in the workspace directory, so I get the error "ERROR: No such file C:\hudson_data\job1\my_view\pom.xml". If I try to specify the location of the POM using the "Root POM" field, I get the error "ERROR: No such file C:\hudson_data\job1\my_view\M:\my_view\VOB_A\foo\pom.xml" Is there a way to do one of the following: 1. Specify the workspace for a maven2 job 2. Use a fully qualified path to the POM for a maven2 job 3. Have Hudson "cd" to a given directory before running mvn as part of a maven2 job Thanks a lot.

          tla612 added a comment -

          I am using version 1.319 for my earlier comments.

          tla612 added a comment - I am using version 1.319 for my earlier comments.

          Andrew Bayer added a comment -

          What version of the ClearCase plugin are you using?

          Andrew Bayer added a comment - What version of the ClearCase plugin are you using?

          tla612 added a comment -

          0.9-SNAPSHOT (private-04/23/2009 11:21-peter)

          tla612 added a comment - 0.9-SNAPSHOT (private-04/23/2009 11:21-peter)

          Andrew Bayer added a comment -

          Ok, I think it's fixed in 1.0 and later - if you can upgrade to 1.0.2, I'd
          suggest you do so. It will involve making some changes to your job
          configurations, but it's got a number of improvements and fixes in it.

          Andrew Bayer added a comment - Ok, I think it's fixed in 1.0 and later - if you can upgrade to 1.0.2, I'd suggest you do so. It will involve making some changes to your job configurations, but it's got a number of improvements and fixes in it.

          tla612 added a comment -

          Version 1.0.2 appears to fix my issue with not being able to find the pom. The
          new version of the plugin does not have the "VOB Path" field any more. I use
          this field a lot to limit the amount of data returned by the "lshistory" command
          when I use a dynamic view. I updated the paths I was using and put them into
          the "Load Rules" field and this appears to work. Is this the correct thing to do?

          Thanks.

          tla612 added a comment - Version 1.0.2 appears to fix my issue with not being able to find the pom. The new version of the plugin does not have the "VOB Path" field any more. I use this field a lot to limit the amount of data returned by the "lshistory" command when I use a dynamic view. I updated the paths I was using and put them into the "Load Rules" field and this appears to work. Is this the correct thing to do? Thanks.

          Andrew Bayer added a comment -

          Yup, the "Load Rules" replaced the "VOB Path".

          Andrew Bayer added a comment - Yup, the "Load Rules" replaced the "VOB Path".

          Andrew Bayer added a comment -

          Maven jobs work properly now - we're using getModuleRoot properly. And it's also now possible to specify a pattern for view names in the global configuration, rather than needing to specify it for every job.

          Andrew Bayer added a comment - Maven jobs work properly now - we're using getModuleRoot properly. And it's also now possible to specify a pattern for view names in the global configuration, rather than needing to specify it for every job.

          Peter Hayes added a comment -

          Does the clearcase plugin now set the workspace root to the view directory? The goal being that plugin configuration, like the clover or pmd plugin, would not need to have the view name in the path to the various output files.

          Peter Hayes added a comment - Does the clearcase plugin now set the workspace root to the view directory? The goal being that plugin configuration, like the clover or pmd plugin, would not need to have the view name in the path to the various output files.

          Garen Parham added a comment -

          This does not work.

          If no custom workspace is specified, artifacts can't be collected.

          If I specify a custom workspace with M:/<viewtag> or M:/${CLEARCASE_VIEWTAG} jenkins will try to change to that dir before the plugin creates the view, and fail the build.

          Garen Parham added a comment - This does not work. If no custom workspace is specified, artifacts can't be collected. If I specify a custom workspace with M:/<viewtag> or M:/${CLEARCASE_VIEWTAG} jenkins will try to change to that dir before the plugin creates the view, and fail the build.

            Unassigned Unassigned
            petehayes Peter Hayes
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: