Bug: templates with more than one material

Comments

3 comments

  • Avatar
    Srinivas Upadhya

    Hi Jsaon,

    When template is extracted from pipeline, material information will sit with pipeline itself.

     <pipelines group="defaultGroup">
        <pipeline name="test" template="test-template">
          <materials>
            <git url="/tmp/repo1" dest="repo1" materialName="repo1" />
            <git url="/tmp/repo2" dest="repo2" materialName="repo2" />
          </materials>
        </pipeline>
        <pipeline name="test2" template="test-template">
          <materials>
            <git url="/tmp/repo1" />
          </materials>
        </pipeline>
      </pipelines>
      <templates>
        <pipeline name="test-template">
          <stage name="defaultStage">
            <jobs>
              <job name="defaultJob">
                <tasks>
                  <exec command="ls" />
                </tasks>
              </job>
            </jobs>
          </stage>
        </pipeline>
      </templates>

    Can you please elaborate on "material is referenced in template"? Can you also provide sample config xml.

    0
    Comment actions Permalink
  • Avatar
    Jason Duff

    Let's say we have material A & B.  If these two materials are referenced in a template because of two "Fetch Artifact" tasks where one references A and the other references B, then it follows that both materials would need to be defined when extending that template.  The issue is simply that the wizard only allows you to add one material.  So, when you click "Finish" at the end of the wizard it throws a validation error because the 2nd material has not been defined though it is referenced by the template.  There is no way to add this 2nd material in the wizard so the only solution, afaik, is to create this directly in the xml.  This is a bug.

    Does this make sense?

    0
    Comment actions Permalink
  • Avatar
    Praveen Shivanagoudar

    Hi Jason,

    I see the problem you are facing here. I can suggest you a workaround apart from editing xml. Lets say we have P1, P2 and P3 pipelines. P2 and P3 are referenced in P1 via fetch artifact, later template (T1)is extracted from P1. Now I want to create P4 pipeline out of template T1, I first go ahead and create P4 without any template  with default stage and job and add P2 and P3 as dependent materials. Later I go to P4 admin setting, click on stages tab, selected use template and click on T1 template. 

    However we acknowledge this may not be the best possible way achieving this requirement. We will try to better it in upcoming releases.

    Thanks

    Praveen S

    0
    Comment actions Permalink

Please sign in to leave a comment.