如需其他來源代管選項,請使用 Secure Source Manager。這項服務是在區域部署的單一租戶管理型原始碼存放區,代管於 Google Cloud。這項服務支援 Git 版本管控,並與 Cloud Build、Cloud Deploy 和 Artifact Registry 整合。
自 2024 年 6 月 17 日起,新客戶無法使用 Cloud Source Repositories。如果貴機構先前未使用過 Cloud Source Repositories,您就無法啟用 API 或使用 Cloud Source Repositories。未連結至機構的新專案無法啟用 Cloud Source Repositories API。在 2024 年 6 月 17 日前使用 Cloud Source Repositories 的機構不會受到這項異動影響。
從 Cloud Source Repositories 部署至 Google App Engine
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本主題說明如何整合 Cloud Source Repositories 與 App Engine。
App Engine 是一種網路架構和雲端運算平台,可使用 Google Cloud開發及代管網路應用程式。
您可以將程式碼從 Cloud Source Repositories 部署至 App Engine,與您使用本機檔案的方式相同。本主題中的步驟會為您說明方式。
複製存放區
如果您還沒這麼做,請使用 gcloud source repos clone
指令將 Google Cloud存放區的內容複製到本機 Git 存放區:
gcloud source repos clone hello-world
部署應用程式
從終端機視窗前往存放區。在下列指令中,將 path_to_repository 替換為包含應用程式的存放區路徑。
cd path_to_repository
部署應用程式:
gcloud app deploy app.yaml
按照提示部署及測試應用程式。
若要納入新的變更,例如將更新推送至存放區,請重新執行 gcloud app deploy app.yaml
指令。
確認應用程式是否正在執行:
gcloud app browse
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-10-19 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-10-19 (世界標準時間)。"],[],[]]