Release Automation

Expand all | Collapse all

find files action include pattern

Jump to Best Answer
  • 1.  find files action include pattern

    Posted 09-20-2018 07:50 AM

    I have a configuration zip file which contains subfolder, one for each environment + one common folder for configurations which apply to all envs. 

     

    dev

    int

    common

     

     

    When running the process, i want to find from the extracted zip the files from matching environment folder + the common stuff

    Using Find files or folders action:

     

    Path:  /tmp/67418/zip/

    Recursive: true

    Included File types: Files_And_Folders

    Include pattern    <Environment Name>/*.yaml;common/*.yaml

     

    But that fails to find any files. If i change the Include pattern to simply  *.yaml, then it does find every file but for all folders .. but thats not what i want to..

     

    i have tried with following Include pattern variations.. tested with hardcoded environment name.. no luck

     

    ./dev/*.yaml

    /tmp/67418/zip/dev/*.yaml

    *dev*.yaml

     

    How to use this correctly?



  • 2.  Re: find files action include pattern
    Best Answer

    Posted 09-20-2018 09:34 AM

    Hello,

     

    How about adding the environment name to the path? If not that then you'll probably need to put all of found files into either a file or array and then search that output result and only get the subset you want based on the environment name filter. I am pretty sure that the pattern is only taking into account the filename, not path or directory names. 

     

    Regards,

    Gregg



  • 3.  Re: find files action include pattern

    Posted 09-20-2018 09:41 AM

    ok... was just thinking i misunderstood how to use it, based on description in tooltip:  "The wildcard or regular expression that defines which files or folders are included. Can be either wildcard or regular expression, according to the chosen pattern type. You can place several patterns using the ';' delimiter - files or folders matching at least one of the patterns will be included."

     

    Regards Jan