部署内容驱动的 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):2024-07-10。
[null,null,["最后更新时间 (UTC):2024-07-10。"],[[["Web applications can be deployed using hosting solutions, which also support static content and other assets."],["Implementing a build pipeline with continuous integration and continuous delivery (CI/CD) can enhance application resilience and release speed."],["Continuous delivery (CD) automates code releases to various environments, integrating with CI for automated testing and deployment triggers."],["Automating application deployment minimizes risks associated with manual processes and strengthens overall application resilience."]]],["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"]]