Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come eseguire il rollback di un target Cloud Deploy a una release precedente.
Quando esegui il rollback di una destinazione, Cloud Deploy crea una nuova risorsa rollout
in base a una release precedente.
Esegui il rollback di una destinazione a una release precedente
Interfaccia a riga di comando gcloud
Per impostazione predefinita, il rollback utilizza l'ultima release con un'implementazione riuscita per il target indicato, ma puoi sceglierne un'altra utilizzando --release.
Per eseguire il rollback, esegui il seguente comando dalla directory contenente la pipeline di importazione:
In questo comando, --release e --rollout-id sono facoltativi.
Utilizza --release per identificare una release specifica a cui eseguire il rollback. Se ometti questa opzione, Cloud Deploy utilizza l'ultima release valida nota per la destinazione specificata.
Utilizza --rollout-id per assegnare un identificatore al rollout generato. Se lo ometti, Cloud Deploy genera un ID per il rolloutgenerato.
Fai clic sulla pipeline indicata nell'elenco delle pipeline di importazione.
La pagina Dettagli pipeline di distribuzione mostra una rappresentazione grafica dello stato di avanzamento della pipeline di distribuzione.
Fai clic sul menu Altro
e seleziona Ripristina release.
Viene visualizzato il modulo di rollback:
Seleziona la release dal campo Release.
Questa è la release a cui vuoi eseguire il rollback. Il campo Nome implementazione viene compilato in base alla release selezionata.
Se vuoi, puoi modificare il nome e la descrizione dell'implementazione rispetto ai valori predefiniti.
Fai clic su Ripristino dei dati precedenti.
Viene creato un nuovo implementazione dalla release scelta e viene eseguito il deployment nello stesso target.
Eseguire un rollback ancora più indietro
Puoi eseguire il rollback manualmente a una release precedente all'ultima di cui è stato eseguito il deployment.
Basta eseguire gcloud deploy releases promote con la release precedente e includere l'opzione --to-target impostata sul target in cui vuoi eseguire il rollback della release.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-03 UTC."],[[["\u003cp\u003eThis page provides instructions on how to roll back a Cloud Deploy target to a previous release, creating a new rollout based on that earlier release.\u003c/p\u003e\n"],["\u003cp\u003eYou can roll back using the gcloud CLI, specifying the target, delivery pipeline, and optionally the release and rollout ID, with the CLI defaulting to the last successful release if one isn't specified.\u003c/p\u003e\n"],["\u003cp\u003eThe console offers a UI method for rollback, allowing you to select a specific release to roll back to, with the option to customize the rollout name and description.\u003c/p\u003e\n"],["\u003cp\u003eYou can manually rollback to any earlier release by running \u003ccode\u003egcloud deploy releases promote\u003c/code\u003e with the desired release, and the \u003ccode\u003e--to-target\u003c/code\u003e option set to the desired target.\u003c/p\u003e\n"]]],[],null,["# Roll back a target\n\nThis page describes how to roll back a Cloud Deploy target to an earlier\nrelease.\n\nWhen you roll back a target, Cloud Deploy creates a new `rollout`\nresource based on a previous release.\n\nRoll back a target to an earlier release\n----------------------------------------\n\n### gcloud CLI\n\nBy default, the rollback uses the last release with a successful rollout to\nthe indicated target, but you can choose a different one, using `--release`.\n\nTo roll back, run the following command from the directory containing your\ndelivery pipeline: \n\n gcloud deploy targets rollback \u003cvar label=\"target name\" translate=\"no\"\u003eTARGET_NAME\u003c/var\u003e \\\n --delivery-pipeline=\u003cvar label=\"pipeline name\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e \\\n --release=\u003cvar label=\"release name\" translate=\"no\"\u003eRELEASE_NAME\u003c/var\u003e \\\n --rollout-id=\u003cvar label=\"rollout id\" translate=\"no\"\u003eROLLOUT_ID\u003c/var\u003e\n\nIn this command, `--release` and `--rollout-id` are optional.\nUse `--release` to identify a specific release to roll back to. If you omit\nthis option, then Cloud Deploy uses the last known good release\nto the specified target.\n\nUse `--rollout-id` to assign an identifier to the generated `rollout`. If\nyou omit this, Cloud Deploy generates an ID for the generated\n`rollout`.\n\n### Console\n\n1. [Open the Delivery\n pipelines page](https://console.cloud.google.com/deploy/delivery-pipelines).\n\n2. Click your pipeline shown in the list of delivery pipelines.\n\n The Delivery pipeline details page shows a graphical representation of\n the progress of your delivery pipeline.\n3. Click the more menu\n and select **Roll back release**.\n\n The rollback form is displayed:\n\n4. Select the release from the **Release** field.\n\n This release is the one which you're rolling back to. The **Rollout name**\n is populated based on the selected release.\n5. If you want, you can change the rollout name and rollout description\n from the default.\n\n6. Click **Roll back**.\n\n A new rollout is created from the chosen release, and deployed into the\n same target.\n\n### Roll back even further\n\nYou can roll back *manually* to an earlier release than the last successfully\ndeployed one.\n\nSimply run `gcloud deploy releases promote` with the earlier release and\ninclude the`--to-target` option set to the target in which you want to roll back\nyour release."]]