definitie van steps.checkout

Gebruik checkout om te configureren hoe de broncode door de pijplijn wordt uitgecheckt.

steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  fetchTags: string # Set to 'true' to sync tags when fetching the repo, or 'false' to not sync tags. See remarks for the default behavior.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
  retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
  retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
steps:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
steps:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.

Definities die naar deze definitie verwijzen: stappen

Eigenschappen

checkout Tekenreeks. Vereist als eerste eigenschap.
Hiermee configureert u het uitchecken voor de opgegeven opslagplaats. Geef self, none, de naam van de opslagplaats of opslagplaatsresource op. Zie Meerdere opslagplaatsen in uw pijplijn uitchecken voor meer informatie.

Notitie

Als er geen checkout stap aanwezig is, wordt standaard ingesteld op self voor jobs.job.step.checkout en none voor jobs.deployment.steps.checkout.

checkout Tekenreeks. Vereist als eerste eigenschap.
Of de opslagplaats met deze pijplijndefinitie al dan niet moet worden uitgecheckt. Geef of noneopself.

clean Tekenreeks.
Als dit waar is, voert u git clean -ffdx uit, gevolgd door git reset --hard HEAD voordat u het ophaalt. true | Valse.

fetchDepth Tekenreeks.
Diepte van git-grafiek die moet worden opgehaald.

fetchTags Tekenreeks.
Stel in op 'true' om tags te synchroniseren bij het ophalen van de opslagplaats, of 'false' om tags niet te synchroniseren. Zie opmerkingen voor het standaardgedrag.

lfs Tekenreeks.
Stel in op 'true' om Git-LFS-bestanden te downloaden. Standaard worden ze niet gedownload.

persistCredentials Tekenreeks.
Ingesteld op 'true' om het OAuth-token in de Git-configuratie achter te laten na de eerste keer ophalen. De standaardinstelling is om deze niet te laten staan.

submodules Tekenreeks.
Stel in op 'true' voor één niveau van submodules of 'recursief' om submodules van submodules op te halen. Standaard worden geen submodules opgehaald.

path Tekenreeks.
Waar moet u de opslagplaats plaatsen. De hoofdmap is $(Pipeline.Workspace).

condition Tekenreeks.
Evalueer deze voorwaardeexpressie om te bepalen of deze taak moet worden uitgevoerd.

continueOnErrorBooleaanse waarde.
Doorgaan met uitvoeren, zelfs bij een fout?

displayName Tekenreeks.
Door mensen leesbare naam voor de taak.

targetdoel.
Omgeving waarin deze taak moet worden uitgevoerd.

enabledBooleaanse waarde.
Deze taak uitvoeren wanneer de taak wordt uitgevoerd?

env tekenreekswoordenlijst.
Variabelen die moeten worden toegewezen aan de omgeving van het proces.

name Tekenreeks.
Id van de stap. Acceptabele waarden: [-_A-Za-z0-9]*.

timeoutInMinutes Tekenreeks.
Tijd om te wachten tot deze taak is voltooid voordat de server deze beëindigt.

Notitie

Pijplijnen kunnen worden geconfigureerd met een time-out op taakniveau. Als het time-outinterval op taakniveau is verstreken voordat de stap is voltooid, wordt de actieve taak (inclusief uw stap) beëindigd, zelfs als de stap is geconfigureerd met een langer timeoutInMinutes interval. Zie Time-outs voor meer informatie.

retryCountOnTaskFailure Tekenreeks.
Aantal nieuwe pogingen als de taak mislukt.

Opmerkingen

Ondiep ophalen

Belangrijk

Voor nieuwe pijplijnen die zijn gemaakt na de Azure DevOps sprint 209-update van september 2022 is Ondiep ophalen standaard ingeschakeld en geconfigureerd met een diepte van 1. Voorheen was de standaardinstelling niet ondiep ophalen. Als u uw pijplijn wilt controleren, bekijkt u de instelling Ondiep ophalen in de gebruikersinterface van de pijplijninstellingen.

Als u ondiep ophalen wilt uitschakelen, kunt u een van de volgende twee opties uitvoeren.

Als u de ophaaldiepte voor een pijplijn wilt configureren, kunt u de fetchDepth eigenschap in de checkout stap instellen of de instelling Ondiep ophalen configureren in de gebruikersinterface met pijplijninstellingen.

Notitie

Als u expliciet in fetchDepth uw checkout stap instelt, krijgt die instelling prioriteit boven de instelling die is geconfigureerd in de gebruikersinterface van de pijplijninstellingen. De instelling fetchDepth: 0 haalt alle geschiedenis op en overschrijft de instelling Ondiep ophalen .

Eigenschap Opschonen

Als de clean eigenschap is uitgeschakeld, wordt de standaardwaarde geconfigureerd door de schone instelling in de UI-instellingen voor YAML-pijplijnen, die standaard is ingesteld op true. Naast de opschoningsoptie die beschikbaar is met checkout, kunt u ook opschonen in een werkruimte configureren. Zie het onderwerp werkruimte in Taken voor meer informatie over werkruimten en opties voor opschonen.

Tags synchroniseren

In de stap uitchecken wordt de --tags optie gebruikt bij het ophalen van de inhoud van een Git-opslagplaats. Dit zorgt ervoor dat de server alle tags en alle objecten ophaalt waarnaar door deze tags wordt verwezen. Hierdoor neemt de tijd toe om de taak in een pijplijn uit te voeren, met name als u een grote opslagplaats met een aantal tags hebt. Bovendien synchroniseert de stap uitchecken tags, zelfs wanneer u de ondiepe ophaaloptie inschakelt, waardoor het doel mogelijk wordt tenietgeklaagd. Om de hoeveelheid gegevens te verminderen die worden opgehaald of opgehaald uit een Git-opslagplaats, heeft Microsoft een nieuwe optie toegevoegd om uit te checken om het gedrag van het synchroniseren van tags te bepalen. Deze optie is beschikbaar in zowel klassieke als YAML-pijplijnen.

Of tags moeten worden gesynchroniseerd bij het uitchecken van een opslagplaats, kan worden geconfigureerd in YAML door de fetchTags eigenschap in te stellen en in de gebruikersinterface door de instelling Tags synchroniseren te configureren.

Als u de instelling in YAML wilt configureren, stelt u de fetchTags eigenschap in.

steps:
- checkout: self
  fetchTags: true

Als u de instelling in de gebruikersinterface van de pijplijn wilt configureren, bewerkt u de YAML-pijplijn en kiest u Meer acties, Triggers, YAML, Bronnen ophalen en schakelt u het selectievakje Tags synchroniseren in of uit. Zie Tags synchroniseren voor meer informatie.

Standaardgedrag

  • Voor bestaande pijplijnen die zijn gemaakt vóór de release van Azure DevOps sprint 209, uitgebracht in september 2022, blijft de standaardwaarde voor het synchroniseren van tags hetzelfde als het bestaande gedrag voordat de opties voor synchronisatietags werden toegevoegd, namelijk true.
  • Voor nieuwe pijplijnen die zijn gemaakt na Azure DevOps-sprintrelease 209, is falsede standaardinstelling voor het synchroniseren van tags .

Belangrijk

De instelling waar synchroniseren van tags in de gebruikersinterface heeft voorrang op een fetchTags: false instructie in de YAML. Als Tags synchroniseren is ingesteld op true in de gebruikersinterface, worden tags gesynchroniseerd, zelfs als fetchTags is ingesteld op false in de YAML.

Voorbeelden

Ga als volgt te werk om synchronisatie van bronnen te voorkomen:

steps:
- checkout: none

Notitie

Als u de agent uitvoert in het lokale serviceaccount en de huidige opslagplaats wilt wijzigen met behulp van git-bewerkingen of het laden van git-submodules, geeft u de juiste machtigingen aan de gebruiker van de Build-serviceaccounts voor projectverzamelingen.

- checkout: self
  submodules: true
  persistCredentials: true

Als u meerdere opslagplaatsen in uw pijplijn wilt uitchecken, voert u meerdere checkout stappen uit:

- checkout: self
- checkout: git://MyProject/MyRepo
- checkout: MyGitHubRepo # Repo declared in a repository resource

Zie Meerdere opslagplaatsen in uw pijplijn uitchecken voor meer informatie.

Zie ook