0
votes

I'm trying to add a submodule to my Azure DevOps yaml pipeline.

I Added the step to checkout the submodule.

steps:
  - checkout: self
    submodules: true

The only side effect I'm having now is that it's moving the entire build repository to a subfolder (the name of the repository).

I'm trying to find out how to set the root back to the build directory back again. I tried setting the path below the submodule in the checkout step. I just can't seem to find where I need to set this paramter and how it's called.

I was reading about the variables over here: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml

I was reading about the azure git repos over here: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml

None of these resources say how to fix this.

Can anyone help me with this?

1

1 Answers

1
votes

If a path is specified for a checkout step, that path is used, relative to (Agent.BuildDirectory).

If you are using default paths, adding a second repository checkout step changes the default path of the code for the first repository. For example, the code for a repository named tools would be checked out to C:\agent\_work\1\s when tools is the only repository, but if a second repository is added, tools would then be checked out to C:\agent\_work\1\s\tools. If you have any steps that depend on the source code being in the original location, those steps must be updated.

See: Checkout path and Checkout for more details. Please check it and kindly let me know the result.