Examples of modificationReader task in CC.Net?

眉间皱痕 提交于 2019-12-23 17:24:35

问题


I am trying to set up a build chain that propagates a modification history through the various build stages. My first thought was modificationWriter/modificationReader pairs, but I am having trouble getting the reader to read the results. Does anybody have any examples or tips?

I am using the latest CC.NET 1.4.4 SP1. Thanks!


回答1:


Got it after some playing.

Note that you need a recent version of CC.NET, I think version 1.4.3 or newer. This is from 1.4.4 SP1.

I had first tried on 1.4.0 but the ModificationReader task doesn't exist in older versions.

<cruisecontrol>

  <!--WATCH SANDBOX CONTINUOUS IS A TRIGGER TO CONTINUOUS BUILD AND INDIRECTLY FULL BUILD -->
  <project name="WatchSandboxContinuous" queue="TestQ" queuePriority="4">
    <triggers>
      <intervalTrigger/>
    </triggers>
    <sourcecontrol type="your_source_control_type">
      ...
    </sourcecontrol>
    <tasks>
      <modificationWriter>
        <filename>mods.xml</filename>
        <path></path>
        <appendTimeStamp>True</appendTimeStamp>
      </modificationWriter>
      <nullTask />
    </tasks>
  </project>

  <!--BUILD SANDBOX CONTINUOUS WOULD DO A FAST CONTINUOUS BUILD AND TRIGGER FULL BUILD -->
  <project name="BuildSandboxContinuous" queue="TestQ" queuePriority="3">
    <triggers>
      <projectTrigger project="WatchSandboxContinuous" />
    </triggers>
    <prebuild>
      <modificationReader>
        <filename>mods.xml</filename>
        <path>C:\Program Files\CruiseControl.NET\server\WatchSandboxContinuous\Artifacts</path>
        <deleteAfterRead>True</deleteAfterRead>
      </modificationReader>
    </prebuild>
    <tasks>
      <!--Propagate modification history to next full build-->
      <modificationWriter>
        <filename>mods.xml</filename>
        <path></path>
        <appendTimeStamp>True</appendTimeStamp>
      </modificationWriter>
      <nullTask />
    </tasks>
  </project>

  <!--BUILD SANDBOX FULL WOULD DO A FULL REBUILD AT NIGHT WITH ANY ADDITIONAL TASKS -->
      <project name="BuildSandboxFull" queue="TestQ" queuePriority="2">
        <triggers>
          <multiTrigger operator="And">
            <triggers>
              <projectTrigger project="BuildSandboxContinuous" />
              <scheduleTrigger buildCondition="ForceBuild" time="23:00" />
            </triggers>
          </multiTrigger>
        </triggers>
        <prebuild>
          <modificationReader>
            <filename>mods.xml</filename>
            <path>C:\Program Files\CruiseControl.NET\server\BuildSandboxContinuous\Artifacts</path>
            <deleteAfterRead>True</deleteAfterRead>
          </modificationReader>
        </prebuild>
        <tasks>
          <nullTask />
        </tasks>

      </project>

    </cruisecontrol>


来源:https://stackoverflow.com/questions/1302773/examples-of-modificationreader-task-in-cc-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!