Reputation: 400
The Azure DevOps UI allows you to group Pipelines into folders and subfolders, but I don't see any way to read those folder names from a task in yaml. I couldn't find anything in the Microsoft Docs that looks helpful.
I'm not talking about file structure, but the pipelines themselves. The "Recent" view shows the folder path under the pipeline name, and the "All" view shows the pipelines in a tree view.
TeamCity allows you to attach variables at the folder level, which subfolders and build configurations inside inherit. Is there any way to group variable settings outside the library or to select libraries based on pipeline folder or other pipeline-specific value?
Upvotes: 0
Views: 1326
Reputation: 29
So it seems like you have two questions here:
"but I don't see any way to read those folder names from a task in yaml."
cd
into the folder and then ls -R
. If you have multiple folders you store your pipelines in that a simple find -L <directory_to_search__use_~_to_search_from_root> -type f \( -name "*.yml" -o -name "*.yaml" \) -exec sh -c 'for d; do dirname "$d"; done' sh {} +
will find all the folders containing *.yaml
or *.yml
files. If you want to pipe them to file add a | sort -u -o <filename_you_want>
to the end of that command.Is there any way to group variable settings outside the library or to select libraries based on pipeline folder or other pipeline-specific value?
grep
out the path and apply your logic to output the variable library's name based on the path.Hope this helps, but let me know if you have further questions etc.
Upvotes: 0