Is there a way to distinguish if a build is a scheduled build at the time that the build matrix runs?

mbreakey's Avatar

mbreakey

13 Jun, 2017 05:27 PM

Currently we have two different builds for our project - one that occurs whenever someone opens a pull request on GitHub and one that runs as a scheduled build every day. For the daily build we want the normal build (with Visual Studio 2015 image) to run plus our cloud builds on Azure machines, but we only want the normal build (with Visual Studio 2015 image) to run whenever a pull request is opened on GitHub.

We're using .json files to setup the different environments for our pull request build and our daily build, so if we could add the build matrix into the .json file, that would be perfect - but I'm having trouble getting that to work. If that won't work, is there any other way that we can know whether we're on the daily build or not before the build matrix starts?

  1. 1 Posted by Ilya Finkelshte... on 13 Jun, 2017 06:35 PM

    Ilya Finkelshteyn's Avatar

    Hi Mariah,

    We have environment named APPVEYOR_SCHEDULED_BUILD, it is set to true if build is scheduled. However I am not sure how it can be used to alter build matrix.
    Did you consider creating separate AppVeyor projects connected to the same repository, for scheduled builds? I understand that this leads to YAML duplication, but it looks most straightforward way.

    Could you also please clarify part related to json files?

  2. 2 Posted by mbreakey on 13 Jun, 2017 06:48 PM

    mbreakey's Avatar

    Hi Ilya,

    I think we will just go with separate YAMLs for each project, that seems like the simplest solution.

    The json files are what we use to configure the environment variables for the project, so I don't think we'll be able to use them for the build matrix, that was just one of the ideas we had had.

  3. 3 Posted by Ilya Finkelshte... on 13 Jun, 2017 07:12 PM

    Ilya Finkelshteyn's Avatar

    There is one more option, but it is bit of a hack. We have command to forcibly exit the build. So if it is scheduled build and build worker image is Azure one, you can run that command on init stage and build will be stopped. But it will happen after Azure VM created and you will have some green builds which did nothing, but exit in the beginning. I don't think you will choose this approach, but I want you to know about this option.

  4. mbreakey closed this discussion on 13 Jun, 2017 11:32 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac