部署内容驱动的 Web 应用后端
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需详细了解如何在托管中部署您的 Web 应用,其中还介绍了有关在托管服务提供商上托管静态 Web 内容和其他类型的资源的其他详细信息。
考虑设置一条自动执行后端测试和部署的流水线。此类系统可以改善应用的整体运行状况和弹性。
构建流水线
后端的构建流水线涵盖应用的整个构建、测试、部署和推广生命周期。使用包含持续集成 (CI) 和持续交付 (CD) 的构建流水线,可以通过持续测试和部署新应用版本来加速发布。严格的测试执行可提高可靠性,而自动化可降低过程中手动步骤导致的总体风险。
构建流水线需要配合您的应用类型、架构和部署流水线。大多数流行的 CI/CD 系统都包含设置端到端构建流水线所需的功能。例如,Cloud Build 为 Google Cloud 上的无服务器应用提供 CI/CD 功能。但是,更高级的用例和架构可能需要额外的配置和工具。
持续交付和持续集成
持续交付 (CD) 会自动将代码发布到预演环境或生产环境。它通常是端到端构建流水线的一部分,该流水线与代码库集成以自动触发测试,包括持续集成 (CI)。如果所有测试都成功通过,则会触发 CD 系统部署新的应用版本。您可以先将应用部署到预演环境,在将该环境提升到生产环境之前对其进行其他测试。
除了应用的代码之外,这也可能应用于任何配置更改、数据库架构更改、版本升级或任何其他维护任务。
详细了解持续交付背后的原则 (CD) 以及将持续交付成果设置为流水线的一部分时要遵循的最佳实践。
部署自动化
接下来,自动将应用部署到测试、预演环境和生产环境,可以降低因手动干预而引发问题的风险,并提升应用的弹性。部署流水线的这一部分负责接收持续集成 (CI) 系统的输出并准备目标环境,运行任何特定于部署的测试,并最终部署应用。
详细了解自动执行部署背后的原则以及设置自己的流水线时要遵循的最佳实践。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eWeb applications can be deployed using hosting solutions, which also support static content and other assets.\u003c/p\u003e\n"],["\u003cp\u003eImplementing a build pipeline with continuous integration and continuous delivery (CI/CD) can enhance application resilience and release speed.\u003c/p\u003e\n"],["\u003cp\u003eContinuous delivery (CD) automates code releases to various environments, integrating with CI for automated testing and deployment triggers.\u003c/p\u003e\n"],["\u003cp\u003eAutomating application deployment minimizes risks associated with manual processes and strengthens overall application resilience.\u003c/p\u003e\n"]]],["Implement a build pipeline with continuous integration (CI) and continuous delivery (CD) to automate testing and deployment of the application. CD automates code releases to staging or production, triggered by code repository changes and successful CI tests. Automate the application deployment to testing, staging, and production environments to improve resilience. This pipeline handles code, configuration changes, database schema updates, and version upgrades. The goal is to accelerate releases, improve reliability, and reduce risks from manual processes.\n"],null,["# Deployment of content-driven web app backends\n\nLearn more about deploying your web application in the\n[hosting](/solutions/content-driven/hosting), which also covers additional\ndetails about hosting static web content and other types of assets on a hosting\nprovider.\n\nConsider setting up a pipeline that automates the testing and deployment of the\nbackend. Such a system can improve the overall health and resilience of your\napplication.\n\nBuild pipeline\n--------------\n\nThe build pipeline for your backend covers the entire build, test, deploy, and\npromote lifecycle of your application. Using a build pipeline that includes\ncontinuous integration (CI) and continuous delivery (CD) accelerates releases by\ncontinuously testing and deploying new application versions. The rigorous\nexecution of tests improves reliability, and automation reduces the overall\nrisks caused by manual steps in the process.\n\nThe build pipeline is coupled with your type of application, architecture, and\ndeployment pipeline. Most popular CI/CD systems include the functionalities\nnecessary to set up an end-to-end build pipeline. For example, [Cloud\nBuild](https://cloud.google.com/build) offers CI/CD capabilities for serverless\napplications on Google Cloud. However, more [advanced use cases and\narchitectures](https://cloud.google.com/docs/ci-cd) may require additional\nconfiguration and tooling.\n\nContinuous Delivery and Continuous Integration\n----------------------------------------------\n\nContinuous delivery (CD) automates code release to staging or production\nenvironments. It is usually part of the end-to-end build pipeline that\nintegrates with the code repository to trigger tests, including [continuous\nintegration\n(CI)](/solutions/content-driven/backend/testing#continuous_integration_and_automated_testing)\nautomatically. If all tests pass successfully, the CD system is triggered to\ndeploy a new application version. The application could be deployed to a\n[staging\nenvironment](/solutions/content-driven/backend/testing#production_and_staging_environments)\nfirst, where additional tests may be performed before it is promoted to the\nproduction environment.\n\nBeyond your application's code, this could also apply to any configuration\nchanges, database schema changes, version upgrades or any other maintenance\ntasks.\n\n[Learn more about the principles behind continuous\ndelivery](https://dora.dev/devops-capabilities/technical/continuous-delivery/)\n(CD) and the best practices to follow when setting it up as part of your\npipeline.\n\nDeployment automation\n---------------------\n\nAs a next step, automating your application deployment to the testing,staging\nand production environments can reduce the risk of issues introduced by manual\nintervention and make your application more resilient. This part of the\ndeployment pipeline taks the output of the continuous integration (CI) system\nand prepares the target environment, runs any deployment-specific tests and\nfinally deploys the application.\n\n[Learn more about the principles behind automating your\ndeployment](https://dora.dev/devops-capabilities/technical/deployment-automation/)\nand the best practices to follow when setting up your own pipeline."]]