using environment variable for commit filtering

Anand Vikram's Avatar

Anand Vikram

18 Apr, 2018 10:54 AM

I have a private Github repository which contains multiple solution files.
My plan is to create a single appveyor.yml file with custom build using powershell scripts whose path I provide using environment variable.
I am trying to setup commit filtering using commit filtering "https://www.appveyor.com/docs/how-to/filtering-commits/" by setting commit using environment variable like:

only_commits:
  files:
    - $(folder_path)

But build does not trigger on check-ins to the folder .
When I use the value directly like "folder1/folder2/" build gets triggered.
Is it possible to set up commit filtering the way i intend to use by setting value in environment variable?

Thanks
Anand Vikram

  1. 1 Posted by Ilya Finkelshte... on 18 Apr, 2018 07:00 PM

    Ilya Finkelshteyn's Avatar

    Hi Anand,

    Right, those settings are not being substituted with environment variables, but even if they do, I am not sure how the whole scenario will work. Commits filtering happens on central AppVeyor servers, before actual build is started. Therefore if you hydrate folder_path variable during the build, it is too late. If you pass this variable when you start build with API (which I doubt you do), then it is simple to pass specific solution file name and use it in your build script.

    If I understand your problem correctly, then it would be simpler to check what files were changed and have your build script to build correct solution. You can use this sample as a reference: https://gist.github.com/IlyaFinkelshteyn/1deffbd1f73dee326aceb5de88...

    Let us know if this helps and if I understood your problem correctly. If not, provide more detailed description and your current YAML configuration.

  2. 2 Posted by Anand Vikram on 19 Apr, 2018 12:37 PM

    Anand Vikram's Avatar

    Hi Ilya,
    Your reply and code led me to solution of my problem.
    Thanks for prompt reply.

  3. 3 Posted by Ilya Finkelshte... on 19 Apr, 2018 04:24 PM

    Ilya Finkelshteyn's Avatar

    Good, thanks for update!

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:28 AM.

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