2

I am using one server to build the same project both continuously and nightly; however I would like the nightly build to only build if a modification exists during the day. I am hoping to achieve this with the constraint that both builds use the same working folder.

The two options I am considering are:

  1. Polling the continuous build and only build the nightly build if a continuous build has occurred - possibly using some token system (continuous build sets token, nightly clears token).

  2. Running a prebuild task to revert the source code to the Last Build Time

I am leaning towards the second option as it decouples the build scripts, but it seems to be a much harder task.

Suggestions and tips to doing this would be appreciated!

Added Information:

The CI build is a quick build of the solution in one configuration and maybe runs some fast unit tests.

The nightly build cleans the build environment, builds the software, packages into an installer, runs extended tests, labels the source code repository, deploys the installer to a server share for manual testers to pick up, and emails the test team that a testable build has been made.

I only want the nightly build to occur if there were any check-ins during the day so that testers don't get plagued with repeat emails for essentially the same build.

Community
  • 1
  • 1
Rob Hunter
  • 2,787
  • 4
  • 35
  • 52

2 Answers2

3

I might be over simplifying this task but can't you simply setup two triggers on the project? One interval trigger for the continuous builds and one schedule trigger with the IfModificationExists condition for the nightly builds.

<triggers>
  <intervalTrigger seconds="60" name="Continuous" />
  <scheduleTrigger time="23:30" buildCondition="IfModificationExists" name="Scheduled">
      <weekDays>
        <weekDay>Monday</weekDay>
      </weekDays>
  </scheduleTrigger>
</triggers>
Trevor
  • 378
  • 2
  • 7
  • 1
    That was my first thought as well, but the problem with this approach is that no modification will be detected for the scheduleTrigger. – Rob Hunter Jul 30 '09 at 13:40
  • That is correct. Which begs me to ask, what's the point of the nightly build if you're running CI? Wouldn't your code always be up to date? – Trevor Jul 30 '09 at 14:45
  • 1
    The CI build is a quick build of the solution in one configuration and maybe runs some fast unit tests. The nightly build cleans the build environment, packages into an installer, runs extended tests, labels the source code repository, deploys the installer to a server share for manual testers to pick up, and emails the test team that a testable build has been made. I only want the nightly build to occur if there were any check-ins during the day. I will modify my original question with this additional info too. – Rob Hunter Jul 30 '09 at 19:05
1

I am happy with my new solution...

I use a MultiTrigger with a scheduleTrigger and a prjectTrigger on the nightly build (better to call full build) and WriteModification/ReadModification pairs to propagate the modification history like in this question.

Community
  • 1
  • 1
Rob Hunter
  • 2,787
  • 4
  • 35
  • 52