Our team uses an Azure DevOps Pipeline that runs based on the code in another repository. We have a yaml file written within our repository that references the other repository for our Azure DevOps Pipeline as follows:
resources:
repositories:
- repository: e2e_fx
type: github
name: Azure/iot-sdks-e2e-fx
ref: refs/heads/master
endpoint: 'GitHub OAuth'
jobs:
- template: vsts/templates/jobs-gate-c.yaml@e2e_fx
Currently the yaml points to the head of master for the other repository, so if a new commit is added to that remote repository then it will be pointed to. I want to be able to reference a specific commit from the repository referenced. How can I do that?
For reference, I've already tried copying the specific commit I want to reference and pasting it where refs/heads/master
is right now, but that gave an error.
Specify multiple repositoriesRepositories can be specified as a repository resource, or inline with the checkout step. The following repository types are supported. Only Azure Repos Git ( git ) repositories in the same organization as the pipeline are supported for multi-repo checkout in Azure DevOps Server 2020.
To trigger a pipeline upon the completion of another pipeline, configure a pipeline resource trigger. The following example configures a pipeline resource trigger so that a pipeline named app-ci runs after any run of the security-lib-ci pipeline completes. This example has the following two pipelines.
Currently there is no option to do it out-of-the-box in the .yaml
file.
You can configure the .yaml
to not sync sources, then the build will not download the repository, and in the beginning of the build add a Command Line task to download only the commit yo want.
To tell the .yaml
not to sync sources in the steps:
add - checkout: none
:
steps:
- checkout: none # Don't sync sources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With