Makelore 2.0 initial clean snapshot
This commit is contained in:
15
resources/project-templates/works-compose/.dockerignore
Normal file
15
resources/project-templates/works-compose/.dockerignore
Normal file
@@ -0,0 +1,15 @@
|
||||
.git
|
||||
.gitignore
|
||||
.niancode
|
||||
.opencode
|
||||
node_modules
|
||||
dist
|
||||
build
|
||||
coverage
|
||||
*.log
|
||||
.env*
|
||||
!.env.example
|
||||
works-publish.json
|
||||
works-deploy-check.json
|
||||
部署报告.md
|
||||
*.zip
|
||||
12
resources/project-templates/works-compose/Dockerfile
Normal file
12
resources/project-templates/works-compose/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 8080
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"status": "BLOCKED",
|
||||
"checked_at": "1970-01-01T00:00:00.000Z",
|
||||
"zip_file_path": "replace-with-generated-package.zip",
|
||||
"zip_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"checks": {
|
||||
"compose_config": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未检查 Compose 配置",
|
||||
"command": "docker compose -f docker-compose.yml config"
|
||||
},
|
||||
"compose_build": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未构建镜像",
|
||||
"command": "docker compose -p works-square-smoke -f docker-compose.yml build --pull=false"
|
||||
},
|
||||
"compose_up": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未启动 Compose 服务",
|
||||
"command": "docker compose -p works-square-smoke -f docker-compose.yml up -d"
|
||||
},
|
||||
"container_port": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未读取容器动态端口",
|
||||
"command": "docker compose -p works-square-smoke port frontend 8080"
|
||||
},
|
||||
"http_smoke": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未执行 HTTP smoke",
|
||||
"command": "curl --fail --show-error http://127.0.0.1:<dynamic-port>/"
|
||||
},
|
||||
"fresh_directory_smoke": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未在全新目录重复构建和启动",
|
||||
"command": "extract package into a fresh directory and repeat compose config/build/up/http smoke"
|
||||
},
|
||||
"sandbox_browser_smoke": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未执行 sandbox iframe 浏览器检查",
|
||||
"command": "playwright sandbox iframe smoke without allow-same-origin"
|
||||
},
|
||||
"game_canvas_smoke": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未执行桌面、移动和 resize 浏览器检查",
|
||||
"command": "playwright desktop/mobile viewport and resize smoke",
|
||||
"canvas_evidence": {
|
||||
"logical_resolution": { "width": 960, "height": 540 },
|
||||
"desktop_viewport": { "width": 1280, "height": 720 },
|
||||
"mobile_viewport": { "width": 390, "height": 844 },
|
||||
"desktop_canvas": { "width": 1280, "height": 720 },
|
||||
"mobile_canvas": { "width": 390, "height": 219.375 },
|
||||
"expected_max_canvas": {
|
||||
"desktop": { "width": 1280, "height": 720 },
|
||||
"mobile": { "width": 390, "height": 219.375 }
|
||||
},
|
||||
"resize_verified": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"status": "BLOCKED",
|
||||
"checked_at": "1970-01-01T00:00:00.000Z",
|
||||
"zip_file_path": "replace-with-generated-package.zip",
|
||||
"zip_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"checks": {
|
||||
"compose_config": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未检查 Compose 配置",
|
||||
"command": "docker compose -f docker-compose.yml config"
|
||||
},
|
||||
"compose_build": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未构建镜像",
|
||||
"command": "docker compose -p works-square-smoke -f docker-compose.yml build --pull=false"
|
||||
},
|
||||
"compose_up": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未启动 Compose 服务",
|
||||
"command": "docker compose -p works-square-smoke -f docker-compose.yml up -d"
|
||||
},
|
||||
"container_port": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未读取容器动态端口",
|
||||
"command": "docker compose -p works-square-smoke port frontend 8080"
|
||||
},
|
||||
"http_smoke": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未执行 HTTP smoke",
|
||||
"command": "curl --fail --show-error http://127.0.0.1:<dynamic-port>/"
|
||||
},
|
||||
"fresh_directory_smoke": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未在全新目录重复构建和启动",
|
||||
"command": "extract package into a fresh directory and repeat compose config/build/up/http smoke"
|
||||
},
|
||||
"sandbox_browser_smoke": {
|
||||
"status": "BLOCKED",
|
||||
"detail": "示例数据;尚未执行 sandbox iframe 浏览器检查",
|
||||
"command": "playwright sandbox iframe smoke without allow-same-origin"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://niancode.local/schemas/works-deploy-check.schema.json",
|
||||
"title": "Works Square deployment check",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["schema_version", "status", "checked_at", "zip_file_path", "zip_sha256", "checks"],
|
||||
"properties": {
|
||||
"schema_version": { "const": 1 },
|
||||
"status": { "$ref": "#/$defs/status" },
|
||||
"checked_at": { "type": "string", "format": "date-time" },
|
||||
"zip_file_path": { "type": "string", "minLength": 1 },
|
||||
"zip_sha256": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" },
|
||||
"checks": {
|
||||
"type": "object",
|
||||
"required": ["compose_config", "compose_build", "compose_up", "container_port", "http_smoke", "fresh_directory_smoke", "sandbox_browser_smoke"],
|
||||
"properties": {
|
||||
"compose_config": { "$ref": "#/$defs/check" },
|
||||
"compose_build": { "$ref": "#/$defs/check" },
|
||||
"compose_up": { "$ref": "#/$defs/check" },
|
||||
"container_port": { "$ref": "#/$defs/check" },
|
||||
"http_smoke": { "$ref": "#/$defs/check" },
|
||||
"fresh_directory_smoke": { "$ref": "#/$defs/check" },
|
||||
"sandbox_browser_smoke": { "$ref": "#/$defs/check" },
|
||||
"game_canvas_smoke": { "$ref": "#/$defs/gameCanvasCheck" }
|
||||
},
|
||||
"additionalProperties": { "$ref": "#/$defs/check" }
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"status": { "enum": ["PASS", "BLOCKED"] },
|
||||
"measurement": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["width", "height"],
|
||||
"properties": {
|
||||
"width": { "type": "number", "exclusiveMinimum": 0 },
|
||||
"height": { "type": "number", "exclusiveMinimum": 0 }
|
||||
}
|
||||
},
|
||||
"canvasEvidence": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["logical_resolution", "desktop_viewport", "mobile_viewport", "desktop_canvas", "mobile_canvas", "expected_max_canvas", "resize_verified"],
|
||||
"properties": {
|
||||
"logical_resolution": { "$ref": "#/$defs/measurement" },
|
||||
"desktop_viewport": { "$ref": "#/$defs/measurement" },
|
||||
"mobile_viewport": { "$ref": "#/$defs/measurement" },
|
||||
"desktop_canvas": { "$ref": "#/$defs/measurement" },
|
||||
"mobile_canvas": { "$ref": "#/$defs/measurement" },
|
||||
"expected_max_canvas": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["desktop", "mobile"],
|
||||
"properties": {
|
||||
"desktop": { "$ref": "#/$defs/measurement" },
|
||||
"mobile": { "$ref": "#/$defs/measurement" }
|
||||
}
|
||||
},
|
||||
"resize_verified": { "type": "boolean" }
|
||||
}
|
||||
},
|
||||
"check": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["status", "detail", "command"],
|
||||
"properties": {
|
||||
"status": { "$ref": "#/$defs/status" },
|
||||
"detail": { "type": "string", "minLength": 1 },
|
||||
"command": { "type": "string", "minLength": 1 },
|
||||
"checked_at": { "type": "string", "format": "date-time" }
|
||||
}
|
||||
},
|
||||
"gameCanvasCheck": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["status", "detail", "command", "canvas_evidence"],
|
||||
"properties": {
|
||||
"status": { "$ref": "#/$defs/status" },
|
||||
"detail": { "type": "string", "minLength": 1 },
|
||||
"command": { "type": "string", "minLength": 1 },
|
||||
"checked_at": { "type": "string", "format": "date-time" },
|
||||
"canvas_evidence": { "$ref": "#/$defs/canvasEvidence" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
resources/project-templates/works-compose/deploy/部署报告模板.md
Normal file
48
resources/project-templates/works-compose/deploy/部署报告模板.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# 部署报告模板
|
||||
|
||||
> 这是填写指南,不是已经执行的部署报告。完成真实检查后,把结果写入项目根目录 `部署报告.md`;没有执行的检查必须写 `BLOCKED`。
|
||||
|
||||
## 1. 发布目标与授权
|
||||
|
||||
- 发布目标:
|
||||
- 用户授权:
|
||||
- 项目版本:
|
||||
|
||||
## 2. 程序包
|
||||
|
||||
- ZIP 路径:
|
||||
- ZIP SHA-256:
|
||||
- 根目录文件检查:
|
||||
|
||||
## 3. Compose 检查
|
||||
|
||||
- `docker compose config`:
|
||||
- `docker compose build --pull=false`:
|
||||
- `docker compose up -d`:
|
||||
- 容器内监听 `0.0.0.0:8080`:
|
||||
- 动态宿主机端口:
|
||||
|
||||
## 4. 运行检查
|
||||
|
||||
- HTTP smoke:
|
||||
- 全新目录重复 smoke:
|
||||
- sandbox iframe 浏览器 smoke:
|
||||
- 浏览器控制台:
|
||||
|
||||
## 5. 游戏或画布项目附加检查
|
||||
|
||||
- 逻辑分辨率:
|
||||
- 桌面 viewport / canvas / 最大等比预期:
|
||||
- 移动 viewport / canvas / 最大等比预期:
|
||||
- resize 或全屏复测:
|
||||
|
||||
## 6. 清理、风险与回滚
|
||||
|
||||
- 容器和临时目录清理:
|
||||
- 已知风险:
|
||||
- 回滚步骤:
|
||||
|
||||
## 7. 最终结果
|
||||
|
||||
- 状态:`PASS` 或 `BLOCKED`
|
||||
- 阻塞项:
|
||||
@@ -0,0 +1,7 @@
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "127.0.0.1::8080"
|
||||
10
resources/project-templates/works-compose/nginx.conf
Normal file
10
resources/project-templates/works-compose/nginx.conf
Normal file
@@ -0,0 +1,10 @@
|
||||
server {
|
||||
listen 0.0.0.0:8080;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
5
resources/project-templates/works-compose/niancode.yml
Normal file
5
resources/project-templates/works-compose/niancode.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
runtime: compose
|
||||
compose:
|
||||
file: docker-compose.yml
|
||||
public_service: frontend
|
||||
public_port: 8080
|
||||
Reference in New Issue
Block a user