feat: add gitea-deploy skill, tools, and sdlc foreground service rule

- skills/gitea-deploy/: new skill for Gitea deployment automation
- tools/: shared utility scripts
- skills/sdlc/SKILL.md: add Foreground Service Rule for long-running
  processes (background start + readiness polling pattern)
This commit is contained in:
Team
2026-04-25 14:11:58 +08:00
parent b6e3cef844
commit f20bc770f5
11 changed files with 455 additions and 0 deletions
@@ -0,0 +1,35 @@
@startuml gitea-deploy-architecture
skinparam componentStyle rectangle
skinparam defaultFontName Arial
skinparam backgroundColor #FAFAFA
package "gitea-deploy Skill" {
component "SKILL.md\n(instructions)" as SKILL
component "evals/evals.json" as EVALS
}
package "Local Machine" {
component "git repo\n(project)" as REPO
component "SSH private key" as KEY
}
package "VPS" {
component "Docker Engine" as DOCKER
component "docker-compose.yml" as COMPOSE
database "Gitea Data\n(~/gitea/data)" as DATA
component "Gitea Container\n(:3000, :22)" as GITEA
}
actor Developer
Developer --> SKILL : triggers skill
SKILL --> KEY : uses for SSH auth
SKILL --> DOCKER : installs if missing
SKILL --> COMPOSE : uploads & runs
COMPOSE --> GITEA : starts container
GITEA --> DATA : persists data
SKILL --> GITEA : initializes via REST API
SKILL --> REPO : git remote add + push
REPO --> GITEA : git push (SSH)
SKILL --> Developer : reports URLs
@enduml
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

+45
View File
@@ -0,0 +1,45 @@
@startuml gitea-deploy-workflow
skinparam defaultFontName Arial
skinparam backgroundColor #FAFAFA
actor Developer
participant "gitea-deploy\nSkill" as SKILL
participant "Local git" as GIT
participant "VPS (SSH)" as VPS
participant "Gitea API" as API
Developer -> SKILL : deploy gitea + push project
SKILL -> Developer : collect VPS host, SSH user, key, credentials
SKILL -> GIT : git rev-parse (check repo)
alt not a git repo
SKILL -> Developer : offer git init
Developer -> GIT : confirm → git init + initial commit
end
SKILL -> VPS : ssh echo OK (connectivity test)
alt SSH fails
SKILL -> Developer : report error, stop
end
SKILL -> VPS : docker --version
alt Docker not installed
VPS -> VPS : curl get.docker.com | sh
end
SKILL -> VPS : upload docker-compose.yml
SKILL -> VPS : docker compose up -d
loop poll every 5s (max 60s)
SKILL -> VPS : curl /api/healthz
end
SKILL -> VPS : gitea admin user create
SKILL -> API : POST /api/v1/user/repos
SKILL -> GIT : git remote add gitea ssh://...
SKILL -> GIT : git push -u gitea --all
SKILL -> API : GET /api/v1/repos/... (verify)
SKILL -> Developer : report web URL + clone URL
@enduml