zeabur-template-backup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zeabur Template Backup

Zeabur 模板备份

Always use
npx zeabur@latest
to invoke Zeabur CLI.
Never use
zeabur
directly or any other installation method. If
npx
is not available, install Node.js first.
Backup an online Zeabur template to the local git repository with standardized naming.
请始终使用
npx zeabur@latest
调用Zeabur CLI。
切勿直接使用
zeabur
或其他任何安装方式。如果没有
npx
,请先安装Node.js。
将在线Zeabur模板备份到本地Git仓库,并采用标准化命名规则。

When to Use

使用场景

  • User provides a Zeabur template URL (e.g.,
    https://zeabur.com/templates/85IQXQ
    )
  • User asks to backup/save a Zeabur template
  • User wants to create a local copy of an online Zeabur template
  • 用户提供Zeabur模板URL(例如:
    https://zeabur.com/templates/85IQXQ
  • 用户要求备份/保存Zeabur模板
  • 用户希望创建在线Zeabur模板的本地副本

Repository Location

仓库位置

The backup repository path depends on your setup. Look for a
zeabur-template
directory in the user's workspace, or ask the user where to save templates. A common default:
~/Documents/zeabur/zeabur-template/
备份仓库的路径取决于你的配置。请在用户工作区中查找
zeabur-template
目录,或询问用户希望将模板保存到何处。常见默认路径:
~/Documents/zeabur/zeabur-template/

Naming Convention

命名规范

{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yaml
Examples:
  • elasticsearch-kibana/zeabur-template-elasticsearch-kibana-85IQXQ.yaml
  • dify/zeabur-template-dify-1D4DOW.yaml
  • postiz/zeabur-template-postiz-v2.12-X2L3BE.yaml
{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yaml
示例:
  • elasticsearch-kibana/zeabur-template-elasticsearch-kibana-85IQXQ.yaml
  • dify/zeabur-template-dify-1D4DOW.yaml
  • postiz/zeabur-template-postiz-v2.12-X2L3BE.yaml

How to Download Template YAML

如何下载模板YAML

Zeabur templates can be directly downloaded by appending
.yaml
to the template URL:
https://zeabur.com/templates/{TEMPLATE_CODE}.yaml
Example:
  • Template page:
    https://zeabur.com/templates/1D4DOW
  • YAML download:
    https://zeabur.com/templates/1D4DOW.yaml
Use
curl
to download:
bash
curl -sL https://zeabur.com/templates/{TEMPLATE_CODE}.yaml -o output.yaml
Zeabur模板可通过在模板URL后追加
.yaml
直接下载:
https://zeabur.com/templates/{TEMPLATE_CODE}.yaml
示例:
  • 模板页面:
    https://zeabur.com/templates/1D4DOW
  • YAML下载地址:
    https://zeabur.com/templates/1D4DOW.yaml
使用
curl
命令下载:
bash
curl -sL https://zeabur.com/templates/{TEMPLATE_CODE}.yaml -o output.yaml

Step-by-Step

步骤指南

For template YAML reference and editing, use the
zeabur-template
skill.
如需参考或编辑模板YAML,请使用
zeabur-template
技能。

1. Extract Template Code from URL

1. 从URL中提取模板代码

URL format:
https://zeabur.com/templates/{TEMPLATE_CODE}
Example:
https://zeabur.com/templates/85IQXQ
→ Code is
85IQXQ
URL格式:
https://zeabur.com/templates/{TEMPLATE_CODE}
示例:
https://zeabur.com/templates/85IQXQ
→ 代码为
85IQXQ

2. Download YAML and Extract Template Name

2. 下载YAML并提取模板名称

bash
undefined
bash
undefined

Download YAML

下载YAML

Extract template name from YAML metadata.name field

从YAML的metadata.name字段中提取模板名称

grep -A1 'metadata:' /tmp/template.yaml | grep 'name:' | head -1
undefined
grep -A1 'metadata:' /tmp/template.yaml | grep 'name:' | head -1
undefined

3. Derive Service Name

3. 生成服务名称

  • Convert template name to lowercase kebab-case
  • Example: "Elasticsearch Single Node with Kibana" →
    elasticsearch-kibana
  • Keep it short and descriptive
  • 将模板名称转换为小写短横线分隔格式(kebab-case)
  • 示例:"Elasticsearch Single Node with Kibana" →
    elasticsearch-kibana
  • 保持名称简短且具有描述性

4. Create Directory and Save

4. 创建目录并保存文件

bash
REPO=~/Documents/zeabur/zeabur-template  # adjust to your actual path
bash
REPO=~/Documents/zeabur/zeabur-template  # 根据实际路径调整

Create directory

创建目录

mkdir -p $REPO/{service-name}
mkdir -p $REPO/{service-name}

Move YAML with naming pattern

按照命名规则移动YAML文件

mv /tmp/template.yaml $REPO/{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yaml
undefined
mv /tmp/template.yaml $REPO/{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yaml
undefined

5. Git Commit

5. Git提交

bash
cd $REPO
git add {service-name}/
git commit -m "feat({service-name}): add {Template Name} template"
bash
cd $REPO
git add {service-name}/
git commit -m "feat({service-name}): add {Template Name} template"

6. Push (if requested)

6. 推送(如果用户要求)

bash
git push
bash
git push

Quick Reference

快速参考

StepAction
1Extract template code from URL
2Download YAML via
curl -sL .../{CODE}.yaml
3Read template name from YAML
metadata.name
4Derive kebab-case service name
5Save to
{service-name}/zeabur-template-{service-name}-{CODE}.yaml
6Git commit with conventional format
7Push if user requests
步骤操作
1从URL中提取模板代码
2通过
curl -sL .../{CODE}.yaml
下载YAML
3从YAML的
metadata.name
中读取模板名称
4生成kebab-case格式的服务名称
5保存到
{service-name}/zeabur-template-{service-name}-{CODE}.yaml
6使用规范格式进行Git提交
7如果用户要求则推送

Common Issues

常见问题

IssueSolution
curl returns HTML instead of YAMLVerify the template code is correct
Template name has special charsUse simple kebab-case for directory
Already existsCompare with existing file, update if needed
问题解决方案
curl返回HTML而非YAML验证模板代码是否正确
模板名称包含特殊字符为目录使用简单的kebab-case格式
文件已存在与现有文件对比,如有需要则更新