drupal-update-deploy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDrupal Update and Deploy Workflow
Drupal 更新与部署工作流
Use when:
- Applying Drupal dependency updates and deploying to an Acquia environment
- Running the full cycle: update packages → push code → deploy → trigger pipeline
Prerequisites: The following skill sets must be loaded:,drupal-maintenance,acli.pipelines-cli
适用场景:
- 应用Drupal依赖项更新并部署到Acquia环境
- 执行完整流程:更新包 → 推送代码 → 部署 → 触发流水线
前提条件: 必须加载以下技能集:、drupal-maintenance、acli。pipelines-cli
Workflow
工作流
Step 1 — Apply dependency updates
步骤1 — 应用依赖项更新
Ask the user: "Do you need to apply dependency updates first, or are updates already done?"
- If updates are needed → follow Security Updates or Dependency Updates depending on the use case, then return here.
- If updates are already applied → proceed to Step 2.
询问用户:"您需要先应用依赖项更新,还是已经完成更新?"
- 如果需要更新 → 根据使用场景遵循 安全更新 或 依赖项更新,然后返回此处。
- 如果已完成更新 → 进入步骤2。
Step 2 — Fetch application and environments
步骤2 — 获取应用程序与环境信息
Always run these before asking the user where to deploy. This ensures the correct application and environment IDs are used.
bash
undefined在询问用户部署目标前,务必先执行以下操作,确保使用正确的应用程序和环境ID。
bash
undefinedList available applications and note the UUID
列出可用应用程序并记录UUID
acli api:applications:list
Output shows application names and UUIDs. Ask the user: **"Which application do you want to deploy to?"** and confirm the UUID.
```bashacli api:applications:list
输出会显示应用程序名称和UUID。询问用户:**"您要部署到哪个应用程序?"** 并确认UUID。
```bashList environments for the selected application
列出所选应用程序的环境
acli api:environments:list <app-uuid>
Output shows environment labels (dev, stage, prod, CDEs), IDs, and the currently deployed branch. Ask the user: **"Which environment do you want to deploy to?"**
---acli api:environments:list <app-uuid>
输出会显示环境标签(dev、stage、prod、CDEs)、ID以及当前部署的分支。询问用户:**"您要部署到哪个环境?"**
---Step 3 — Commit code changes
步骤3 — 提交代码更改
Before pushing, check for uncommitted changes:
bash
git statusIf there are uncommitted changes, ask the user: "Do you want to commit these changes before deploying?"
- If yes — ask for a commit message, then commit:
bash
git add -A git commit -m "<user-provided message>" - If no — warn the user that uncommitted changes will not be included in the deployment and confirm they want to proceed.
推送前,检查是否有未提交的更改:
bash
git status如果存在未提交的更改,询问用户:"您是否要在部署前提交这些更改?"
- 如果是 — 请求提交信息,然后执行提交:
bash
git add -A git commit -m "<用户提供的信息>" - 如果否 — 提醒用户未提交的更改不会包含在部署中,并确认他们是否要继续。
Step 4 — Push code to Acquia Cloud
步骤4 — 将代码推送到Acquia Cloud
Push the committed code to the selected environment:
bash
acli push:codeFollow Pull & Push for full options (selecting environments, handling conflicts).
将已提交的代码推送到所选环境:
bash
acli push:code如需完整选项(选择环境、处理冲突),请遵循 拉取与推送。
Step 5 — Switch code on the environment
步骤5 — 切换环境代码
After pushing, switch the environment to the updated branch using the environment ID from Step 2:
bash
acli api:environments:switchCode <environment-id> --branch=<branch-name>Follow Environment Management for deploy options.
推送完成后,使用步骤2中的环境ID将环境切换到更新后的分支:
bash
acli api:environments:switchCode <environment-id> --branch=<branch-name>如需部署选项,请遵循 环境管理。
Step 6 — Trigger a pipeline build (optional)
步骤6 — 触发流水线构建(可选)
Ask the user: "Do you want to trigger a pipeline build for the deployed branch?"
- If yes → follow Pipeline Operations to start the build and stream logs:
bash
pipelines start --application-id=<app-id> --vcs-path=<branch> --tail- If no → workflow complete.
询问用户:"您是否要为已部署的分支触发流水线构建?"
- 如果是 → 遵循 流水线操作 启动构建并流式传输日志:
bash
pipelines start --application-id=<app-id> --vcs-path=<branch> --tail- 如果否 → 工作流完成。
Step 7 — Verify deployment
步骤7 — 验证部署
After the pipeline completes (or if skipping pipelines), confirm the environment is running the expected code:
bash
acli api:environments:list <app-uuid>Check the field of the target environment to confirm the branch matches.
vcs流水线完成后(或跳过流水线时),确认环境正在运行预期的代码:
bash
acli api:environments:list <app-uuid>检查目标环境的字段,确认分支是否匹配。
vcsQuick Reference
快速参考
| Step | Tool | Skill |
|---|---|---|
| Update packages | composer | |
| Fetch application + environments | acli | |
| Commit code changes | git | — |
| Push code | acli | |
| Deploy to environment | acli | |
| Trigger pipeline | pipelines-cli | |
| 步骤 | 工具 | 技能 |
|---|---|---|
| 更新包 | composer | |
| 获取应用程序+环境信息 | acli | |
| 提交代码更改 | git | — |
| 推送代码 | acli | |
| 部署到环境 | acli | |
| 触发流水线 | pipelines-cli | |