Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

CI/CD: post-deploy image variants job (template #152)

已关闭 适合新手
#214 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, gitlab, kubernetes, yaml

调研方向

阅读 content/6.deployment/3.ci-cd.md 和 7.upgrading-the-template.md 中接下来的发布章节,然后将现有的缓存预热说明与此处描述的部署后图像变体工作流进行比较。记录命令、平台特定的作业或步骤、开关、失败时的行为,以及在 API pod 中运行的原因。两页都说明新工作流并保留手动备用步骤后,即为完成。

由索引模型根据 Issue 内容生成。

描述

Template #152 (on main, next template release) adds a post-deploy job that generates missing imagine variants. content/6.deployment/3.ci-cd.md should describe it next to the cache warm (and 7.upgrading-the-template.md in the next release's section).

What it does:

  • Command: generate_image_variants [track] in bin/devops/k8s.sh runs bin/console silverback:api-components:imagine:generate -v in the API pod (bundle 2.0.0-alpha.15, docs#213). It generates every variant not stored yet, one image at a time, instead of visitors' requests doing it after a new or changed filter.
  • Purge: if anything was generated, it runs purge-http-cache so cached API responses list the new variants. With provider cloudflare, that's a purge everything at the edge.
  • Log: it lists every variant except those already stored.
  • Exit codes: 1 means a variant failed; it purges first, then fails the job. 2 means an unknown --filter/--class.

Where it runs:

  • GitLab: image variants <track> jobs (allow_failure, environment: action: verify) after each deploy job. Each warm cache <track> now needs: it (optional), so the warm requests pages whose variants exist.
  • GitHub: a continue-on-error "Generate image variants" step after fixtures and before the warm, in ci.yml and production.yml.
  • Never fails a deploy: it's a separate job/step.

Switches (per track, like the warm; not GitLab environment-scoped, since staging runs under environment: production):

  • CWA_CI_IMAGE_VARIANTS_PRODUCTION: on unless "false"
  • CWA_CI_IMAGE_VARIANTS_STAGING, _REVIEW, _CANARY: off unless "true"

Why not a Helm hook Job: purge-http-cache reaches Souin through the API pod's loopback admin API, so a Job pod would purge its own idle Caddy.

Upgrade (next release): copying the job makes the first deploy generate every image's WebP variants (#149) and purge by itself. The manual imagine:generate --dry-run / imagine:generate / purge-http-cache steps remain as the fallback without it.

主要语言
Vue
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

components-web-app/docs 的其他 Issue

查看 components-web-app/docs 的全部 Issue

相似的 Issue

更多 DevOps Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。