Quản lý hoạt động triển khai
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Phần này cung cấp thông tin tổng quan về các phương thức Apps Script API mà bạn có thể dùng để tạo, liệt kê, đọc, sửa đổi và xoá các bản triển khai của một dự án tập lệnh.
Tổng quan về phương thức API |
Tạo một đợt triển khai |
projects.deployments.create
Kết quả: Tạo một quy trình triển khai mới cho dự án tập lệnh.
Bạn chỉ định phiên bản mã, tệp kê khai và nội dung mô tả triển khai cần dùng. Trả về một đối tượng
Deployment chứa thông tin chi tiết về cấu hình triển khai.
|
Liệt kê các hoạt động triển khai của một dự án |
projects.deployments.list
Kết quả: Trả về một mảng gồm các đối tượng
Deployment , mỗi đối tượng đại diện cho một trong các lượt triển khai của dự án tập lệnh.
|
Đọc một bản triển khai |
projects.deployments.get
Kết quả: Trả về một
Deployment đại diện cho một hoạt động triển khai cụ thể trong một dự án tập lệnh cụ thể.
|
Cập nhật đợt triển khai |
projects.deployments.update
Kết quả: Thay đổi nội dung mô tả, phiên bản mã hoặc tệp kê khai của một hoạt động triển khai, nơi hoạt động triển khai được xác định.
|
Xoá đợt triển khai |
projects.deployments.delete
Kết quả: Xoá một hoạt động triển khai.
Cảnh báo: Việc xoá một bản triển khai sẽ khiến mọi tiện ích bổ sung, ứng dụng web hoặc ứng dụng khác sử dụng bản triển khai đó mất quyền truy cập vào dự án Apps Script, thường khiến các ứng dụng đó không hoạt động. Không xoá một bản triển khai mà chưa cập nhật bất kỳ ứng dụng nào phụ thuộc vào bản triển khai đó.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eThis section explains how to manage script project deployments using the Apps Script API.\u003c/p\u003e\n"],["\u003cp\u003eYou can create new deployments with specific code versions, manifests, and descriptions.\u003c/p\u003e\n"],["\u003cp\u003eThe API allows listing, reading, updating, and deleting existing deployments for a script project.\u003c/p\u003e\n"],["\u003cp\u003eUpdating a deployment involves modifying its description, version, or manifest.\u003c/p\u003e\n"],["\u003cp\u003eDeleting deployments can cause dependent add-ons or applications to fail, requiring caution.\u003c/p\u003e\n"]]],[],null,["# Managing Deployments\n\nThis section provides an overview of the Apps Script API methods you can\nuse to create, list, read, modify, and delete a script project's\n[deployments](/apps-script/concepts/deployments).\n\n| **API method overview** ||\n|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Create a deployment** | [projects.deployments.create](/apps-script/api/reference/rest/v1/projects.deployments/create) **Results** : Create a new deployment for a script project. You specify the code [version](/apps-script/guides/versions), the [manifest](/apps-script/concepts/manifests) file, and deployment description to use. Returns a [`Deployment`](/apps-script/api/reference/rest/v1/projects.deployments#resource-deployment) object, containing the deployment configuration details. |\n| **List a project's deployments** | [projects.deployments.list](/apps-script/api/reference/rest/v1/projects.deployments/list) **Results** : Returns an array of [`Deployment`](/apps-script/api/reference/rest/v1/projects.deployments#resource-deployment) objects, each representing one of the deployments of the script project. |\n| **Read a deployment** | [projects.deployments.get](/apps-script/api/reference/rest/v1/projects.deployments/get) **Results** : Returns a [`Deployment`](/apps-script/api/reference/rest/v1/projects.deployments#resource-deployment) that represents a specific deployment in a specific script project. |\n| **Update a deployment** | [projects.deployments.update](/apps-script/api/reference/rest/v1/projects.deployments/update) **Results** : Changes a deployment's description, code [version](/apps-script/guides/versions), or the [manifest](/apps-script/concepts/manifests) where the deployment is defined. |\n| **Delete a deployment** | [projects.deployments.delete](/apps-script/api/reference/rest/v1/projects.deployments/delete) **Results**: Removes a deployment. **Warning:** Deleting a deployment causes any add-on, web app, or other application that makes use of that deployment to lose access to the Apps Script project, usually causing them to fail. Do not delete a deployment without first updating any apps that depend on it. |"]]