[[["易于理解","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-18。"],[[["\u003cp\u003eThis page outlines the process of scheduling builds on a pre-defined schedule using the Google Cloud console, by using manual triggers and Cloud Scheduler.\u003c/p\u003e\n"],["\u003cp\u003eTo schedule builds, you must first create a manual trigger and enable both the Cloud Build API and the Cloud Scheduler API.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating a manual trigger, you can access the 'Run on schedule' option in the Triggers page to set up a recurring build schedule with frequency and time zone using Cloud Scheduler.\u003c/p\u003e\n"],["\u003cp\u003eUpdating the revision field in a manual trigger requires manually updating the corresponding Cloud Scheduler job with the new revision.\u003c/p\u003e\n"],["\u003cp\u003eDeleting or disabling a trigger does not automatically delete associated Cloud Scheduler jobs, so these jobs must be manually removed to stop scheduled builds.\u003c/p\u003e\n"]]],[],null,["# Schedule builds\n\nThis page explains how to run builds on a pre-defined schedule using the\nGoogle Cloud console. To schedule builds, you must [create a manual trigger](/build/docs/automating-builds/create-manual-triggers#creating_manual_triggers) and then invoke the trigger using Cloud Scheduler.\n\nBefore you begin\n----------------\n\n-\n\n\n Enable the Cloud Build API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com&redirect=https://cloud.google.com/build/docs/automating-builds/create-scheduled-triggers)\n\n\u003c!-- --\u003e\n\n- Have your source code ready.\n- If you have not already, [create a manual trigger](https://cloud.google.com/build/docs/automating-builds/create-manual-triggers). **You can only schedule builds if your trigger is a manual trigger.**\n\nScheduling builds\n-----------------\n\nAfter you have [created a manual trigger](https://cloud.google.com/build/docs/automating-builds/create-manual-triggers), you are ready to schedule your build.\n\nTo schedule your build:\n\n1. Open the **Triggers** page:\n\n \u003cbr /\u003e\n\n [Open the Triggers page](https://console.cloud.google.com/cloud-build/triggers)\n\n \u003cbr /\u003e\n\n2. Locate the row containing the name of the manual trigger you want to run\n on schedule.\n\n3. Click on the menu (vertical ellipses) located at the right end of the row\n containing your trigger.\n\n4. Click **Run on schedule** to schedule your build.\n\n You will see the **Run trigger on schedule** panel on the right side.\n5. Enable the **Cloud Scheduler** API.\n\n You will only be prompted to enable the **Cloud Scheduler** API the first\n time you schedule a build.\n6. Select the service account you want Cloud Scheduler to use\n when invoking your trigger.\n\n We recommend selecting the default scheduling service account, which\n has the following format where \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the project ID for your project: \n\n cloud-build-trigger-scheduler@\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e.iam.gserviceaccount.com\n\n When you select the default scheduling service account, it will\n automatically be created for you with the\n **Cloud Build Editor** IAM role granted.\n We recommend you don't delete this service account since it is used by Cloud Scheduler to schedule builds. If you accidentally delete this service account,\n or revoke any of its IAM permissions,\n you can navigate to the [IAM page](https://console.cloud.google.com/iam-admin/iam) to manually add the service account\n and grant it the **Cloud Build Editor** role. You may need to\n wait up to an hour for any existing Cloud Scheduler jobs\n to resume after recreating the service account.\n7. Click **Continue**.\n\n If you do not have a region selected, you may be prompted to select\n a region for your Cloud Scheduler jobs before proceeding to the\n next step. When you select a region, an App Engine application\n will be automatically created in your project. You **cannot** change the region for your\n project later on. To learn more, see [Supported regions](/../scheduler/docs#supported_regions).\n8. Enter the following Cloud Scheduler job settings:\n\n - **Name**: A name for your Cloud Scheduler job.\n - **Description** (Optional): A description for your Cloud Scheduler job.\n - **Frequency** : Select how frequently you would like your trigger to run. You can choose a frequency from the drop-down menu or enter a custom value using cron syntax. For example, if you want your manual trigger to run everyday at 6 AM, you can specify your frequency in cron syntax as `0 6 * * *`. To learn more about cron syntax, see [Configuring cron job schedules](/../scheduler/docs/configuring/cron-job-schedules).\n - **Time Zone**: Select your time zone.\n9. Click **Create** to create your Cloud Scheduler job.\n\n You can create multiple scheduler jobs for each manual trigger.\n10. If you would like to view your Cloud Scheduler job, click\n **View** . Otherwise, click **Done** to close the panel.\n\nUpdating your Cloud Scheduler job\n---------------------------------\n\nIf you update the [**Revision** field in your manual trigger](/build/docs/automating-builds/create-manual-triggers), you'll need to manually update the Cloud Scheduler\njob associated with your trigger. For example, if you update the branch name\nfor your manual trigger, you will need to manually update the name of the\nbranch in your job.\n\nTo update your Cloud Scheduler job:\n\n1. Open the **Cloud Scheduler** page:\n\n \u003cbr /\u003e\n\n [Open the Cloud Scheduler page](https://console.cloud.google.com/cloudscheduler)\n\n \u003cbr /\u003e\n\n You will see a list of your Cloud Scheduler jobs.\n2. \\[Optional\\] Identify the Cloud Scheduler job associated with your trigger:\n\n 1. Obtain your trigger ID by running the following command, where\n where \u003cvar translate=\"no\"\u003eTRIGGER_NAME\u003c/var\u003e is the name of your trigger:\n\n gcloud builds triggers describe \u003cvar translate=\"no\"\u003eTRIGGER_NAME\u003c/var\u003e\n\n 2. Take note of your trigger ID.\n\n 3. Enter your trigger ID into the filter bar at the top of the table.\n\n You will see the list of your Cloud Scheduler jobs associated\n with your trigger.\n3. Click on the row containing the name of the job you want to update.\n\n4. Click **Edit** at the top of the page.\n\n You will see a form to update your Cloud Scheduler job.\n5. In the **Body** field, update your revision.\n\n6. Click **Update**.\n\nYou have now updated the revision associated with your trigger for your\nCloud Scheduler job.\n\nRemoving your Cloud Scheduler job\n---------------------------------\n\n[Deleting](/build/docs/automating-builds/create-manage-triggers#deleting_a_build_trigger) or [disabling](/build/docs/automating-builds/create-manage-triggers#disabling_a_build_trigger)\nyour trigger will **not** automatically delete or disable all Cloud Scheduler\njobs that were automatically created when you scheduled the trigger. Your jobs will\nexist and builds may continue to be invoked.\n\nTo make sure your trigger will no longer run at a specified time,\n[delete your Cloud Scheduler job](/../scheduler/docs/creating#console_1).\n\nNext steps\n----------\n\n- Learn how to [start builds manually](/build/docs/running-builds/start-build-manually) using `gcloud` commands or the Cloud Build API.\n- Learn how to [create and manage triggers](/build/docs/automating-builds/create-manage-triggers).\n- Learn how to [view build results](/build/docs/view-build-results)."]]