Closed josh-endries closed 3 years ago
I was able to work around the problem by having the template check itself out and absolutely reference the file path within my PowerShell step via:
filePath: $(Agent.BuildDirectory)/s/repo/path/to/script.ps1
I am guessing that this isn't the expected/correct way to do this, though...
Hi @josh-endries yes, you can use it from other repository - please see the docs.
@josh-endries I'm closing it at the moment since it looks resolved - please feel free to ask any further questions.
In case anybody else stumbles in here, I think @josh-endries has the best approach so far. The docs that @anatolybolshakov linked has this: Repositories are resolved only once, when the pipeline starts up. After that, the same resource is used for the duration of the pipeline. Only the template files are used. Once the templates are fully expanded, the final pipeline runs as if it were defined entirely in the source repo. This means that you can't use scripts from the template repo in your pipeline. I take that to mean you can use templates in other repos, but if those templates call script files using a normal relative path, it won't work.
Hello, I'm new to using YAML pipelines, always used the UI before. Hopefully this is the right place for this question.
I am trying to set up a YAML pipeline that uses another pipeline template defined in a different repository, which in turn uses a third pipeline template in that same repository. Is this possible? E.g.:
The MyApp pipeline seems to find and run the app-build pipeline and validation pipeline. The issue I'm running into is that it can't find the
ps1
file. Is there a way to locate this file relative to its "parent" pipeline (it's in the same folder as that yaml file)?After reading stuff online my assumption is that it's looking for
validate.ps1
in theMyApp
folder, as relative paths seem to be relative to the "root"MyApp
YAML file, though I'm not sure then how it finds the validation pipeline. FWIW, using./
or an absolute path to theps1
file didn't work, either. Anyway, since I can't define resources in the templates, I don't think I could qualify theps1
file within it's pipeline as existing inrepoA
.I'm not really sure how to make this work in a portable way for other apps that should use the same build/validate steps, without duplicating lots of stuff. Is this pattern possible or supposed to work?