[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-17。"],[[["\u003cp\u003eThis page details how to delete Cloud Deploy resources, including delivery pipelines, targets, custom target types, and automations.\u003c/p\u003e\n"],["\u003cp\u003eDelivery pipelines can be deleted via the Google Cloud console or the gcloud CLI, but using the \u003ccode\u003e--force\u003c/code\u003e flag is required if releases or rollouts are associated with it.\u003c/p\u003e\n"],["\u003cp\u003eTargets can also be deleted using both the Google Cloud console and the gcloud CLI, where the gcloud CLI allows deletion even if the target is currently used, while the console only allows deletion if the target isn't used by a pipeline.\u003c/p\u003e\n"],["\u003cp\u003eCustom target types and automations can be deleted using the gcloud CLI, through their respective commands, specifying the resource name and the region.\u003c/p\u003e\n"],["\u003cp\u003eAutomations can be deleted in the Google Cloud console from the automations tab of their associated delivery pipeline's page.\u003c/p\u003e\n"]]],[],null,["# Delete Cloud Deploy resources\n\nThis page describes how to delete Cloud Deploy resource, including the\nfollowing:\n\n- [Delivery pipelines](#delete_a_delivery_pipeline)\n- [Targets](#delete_a_target)\n- [Custom target types](#delete_a_custom_target_type)\n- [Automations](#delete_an_automation)\n\nDelete a delivery pipeline\n--------------------------\n\nYou can delete a delivery pipeline from the Google Cloud console or using\nthe gcloud CLI.\n\n### Delete a delivery pipeline using the Google Cloud console\n\n1. In the Google Cloud console, navigate to the Cloud Deploy\n **Delivery pipelines** page to find the delivery pipeline you want to delete.\n\n \u003cbr /\u003e\n\n [Open the Delivery pipelines page](https://console.cloud.google.com/deploy/delivery-pipelines)\n\n \u003cbr /\u003e\n\n2. Click the name of the delivery pipeline you want to delete.\n\n The **Delivery pipeline details** page is shown.\n\n3. Click **Delete**.\n\n### Delete a delivery pipeline using the gcloud CLI\n\nIf you have a delivery pipeline without any subresources (releases or rollouts),\nyou can delete it by running the following command: \n\n gcloud deploy delivery-pipelines delete \u003cvar label=\"target name\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e\n\nIf the pipeline you want to delete has any releases or rollouts associated with\nit, you need to include the`--force` flag in order to delete the pipeline and\nthose subresources: \n\n gcloud deploy delivery-pipelines delete \u003cvar label=\"target name\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e --force\n\nCloud Deploy prevents you from deleting the pipeline if there's a\nrelease or rollout in a state that would cause problems if deleted. For example,\nyou can't delete a delivery pipeline if a rollout is in the `PENDING` state, but\nyou *can* delete it if the rollout is in a `PENDING_APPROVAL` state. If you\ncan't delete the pipeline, you need to reject approval, or advance or cancel the\nrollout to a terminal state (such as `SUCCEEDED` or `FAILED`).\n\nDelete a target\n---------------\n\nYou can delete a target from the Google Cloud console or using the\ngcloud CLI. These two methods are described in the sections that\nfollow.\n\n### Delete a target using the gcloud CLI\n\nWhen you delete a target using the gcloud CLI, that targets is\ndeleted whether or not it's in use by any delivery pipeline.\n\nUse the following command to delete a target from the gcloud CLI: \n\n gcloud deploy targets delete \u003cvar label=\"target name\" translate=\"no\"\u003eTARGET_NAME\u003c/var\u003e --region=\u003cvar label=\"region\" translate=\"no\"\u003eREGION\u003c/var\u003e\n\nWhere:\n\n\u003cvar label=\"target name\" translate=\"no\"\u003eTARGET_NAME\u003c/var\u003e is the name of the target you\nwant to delete. This is the same as the value for `metadata.name` in the\n[target configuration](/deploy/docs/config-files#target_definitions).\n\n\u003cvar label=\"region\" translate=\"no\"\u003eREGION_NAME\u003c/var\u003e is the name of the region in which\nthe target was created, for example `us-central1`.\n\nCloud Deploy doesn't prevent you from deleting a target that's\nactively used by other delivery pipelines.\n\n### Delete a target using the Google Cloud console\n\nYou can delete a target using the Google Cloud console, only if that target\nisn't in use by an existing delivery pipeline resource. That is, if there is a\npipeline with a stage that points to the target, then you can't delete the\ntarget from the Google Cloud console.\n\nFollow these steps to delete the target using the Google Cloud console:\n\n1. Navigate to the Cloud Deploy **Targets** page.\n\n All available targets in your current project are displayed.\n\n2. Click the\n\n menu icon for the target you want to delete.\n\n3. Click **Delete target**.\n\n If the target you're trying to delete is referenced by a delivery pipeline, you can't select **Delete target**.\n\n If the target *isn't* referenced by a delivery pipeline, the **Delete target** dialog is shown.\n\n4. Type the target name in the text field provided, and click **Confirm**.\n\nDelete a custom target type\n---------------------------\n\nFrom a command shell, use the following command to delete a\n[custom target type](/deploy/docs/custom-targets) resource: \n\n gcloud deploy custom-target-types delete \u003cvar label=\"custom-target-type\" translate=\"no\"\u003eCUSTOM_TARGET_TYPE_NAME\u003c/var\u003e \\\n --region=\u003cvar label=\"region\" translate=\"no\"\u003eREGION_NAME\u003c/var\u003e\n\nWhere:\n\n- \u003cvar label=\"automation\" translate=\"no\"\u003eCUSTOM_TARGET_TYPE_NAME\u003c/var\u003e\n\n Is the name of the custom target type you want to delete. This is the same as\n the `metadata.name` property in the\n [custom target type definition](/deploy/docs/config-files#custom_target_type_definitions).\n- \u003cvar label=\"region\" translate=\"no\"\u003eREGION_NAME\u003c/var\u003e\n\n Is the region in which you created the custom target type, for example\n `us-central1`.\n\nDelete an automation\n--------------------\n\nYou can delete any automation resource created in your project. You can delete\nthe automation using the Google Cloud console or the\ngcloud CLI:\n\n### Delete an automation using the Google Cloud console\n\n1. In the Google Cloud console, navigate to the Cloud Deploy\n **Delivery pipelines** page to find the delivery pipeline your automation is\n associated with.\n\n \u003cbr /\u003e\n\n [Open the Delivery pipelines page](https://console.cloud.google.com/deploy/delivery-pipelines)\n\n \u003cbr /\u003e\n\n2. Click the name of your delivery pipeline.\n\n3. Under **Delivery pipeline details** , select the **Automations** tab.\n\n4. Click the name of the automation you want to delete.\n\n The **Automation details** are shown.\n\n5. Click the **Delete** button, and confirm the deletion by typing the\n automation name and clicking **Confirm**.\n\n### Delete an automation using the gcloud CLI\n\nFrom a command shell, use the following command to delete an automation\nresource: \n\n gcloud deploy automations delete \u003cvar label=\"automation\" translate=\"no\"\u003eAUTOMATION_NAME\u003c/var\u003e \\\n --delivery-pipeline=\u003cvar label=\"pipeline\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e \\ --region=\u003cvar label=\"region\" translate=\"no\"\u003eREGION_NAME\u003c/var\u003e\n\nWhere:\n\n- \u003cvar label=\"automation\" translate=\"no\"\u003eAUTOMATION_NAME\u003c/var\u003e\n\n Is the name of the automation you want to delete. This is the same as the\n `metadata.name` property in the\n [automation definition](/deploy/docs/config-files#automation_definitions).\n- \u003cvar label=\"pipeline\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e\n\n Is the name of the delivery pipeline this automation is associated with. All\n automations exist only within the scope of one delivery pipeline.\n- \u003cvar label=\"region\" translate=\"no\"\u003eREGION_NAME\u003c/var\u003e\n\n Is the region in which you created the automation, for example `us-central1`.\n\nWhat's next\n-----------\n\n- Find out how to [suspend a delivery pipeline](/deploy/docs/suspend-pipeline).\n\n- Learn more about [automations](/deploy/docs/automation).\n\n- Learn how to [use service notifications](/deploy/docs/subscribe-deploy-notifications)"]]