Template
fix(template): parameterize scaffold with __PROJECT_NAME__/__MODULE_PATH__ (gitea-mcp#44)
template-go-web was seeded from the real `hostexecutor` project and never parameterized: go.mod hardcoded `module gitea.d-ma.be/mathias/hostexecutor` and `hostexecutor` appeared throughout (cmd dir, Dockerfile, Taskfile, CI, context docs). create_project_from_template therefore substituted nothing and returned a "no placeholders" partial_failure on the zero-config default path. Replaced the full module path with __MODULE_PATH__ and the bare project name with __PROJECT_NAME__ (incl. renaming cmd/hostexecutor → cmd/__PROJECT_NAME__), matching the substitution the tool performs. Also drops the stale gitea.d-ma.be host (the placeholder resolves to git.d-ma.be/<owner>/<name>). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
# hostexecutor
|
# __PROJECT_NAME__
|
||||||
|
|
||||||
## Identity
|
## Identity
|
||||||
|
|
||||||
- **Name**: hostexecutor
|
- **Name**: __PROJECT_NAME__
|
||||||
- **Owner**: Mathias
|
- **Owner**: Mathias
|
||||||
- **Client**: personal
|
- **Client**: personal
|
||||||
- **Repo**: gitea.d-ma.be/mathias/hostexecutor
|
- **Repo**: __MODULE_PATH__
|
||||||
- **Status**: active
|
- **Status**: active
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
# hostexecutor
|
# __PROJECT_NAME__
|
||||||
|
|
||||||
## Identity
|
## Identity
|
||||||
|
|
||||||
- **Name**: hostexecutor
|
- **Name**: __PROJECT_NAME__
|
||||||
- **Owner**: Mathias
|
- **Owner**: Mathias
|
||||||
- **Client**: personal
|
- **Client**: personal
|
||||||
- **Repo**: gitea.d-ma.be/mathias/hostexecutor
|
- **Repo**: __MODULE_PATH__
|
||||||
- **Status**: active
|
- **Status**: active
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ Follow all conventions from both the root agent context and project context.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# hostexecutor
|
# __PROJECT_NAME__
|
||||||
|
|
||||||
## Identity
|
## Identity
|
||||||
|
|
||||||
- **Name**: hostexecutor
|
- **Name**: __PROJECT_NAME__
|
||||||
- **Owner**: Mathias
|
- **Owner**: Mathias
|
||||||
- **Client**: personal
|
- **Client**: personal
|
||||||
- **Repo**: gitea.d-ma.be/mathias/hostexecutor
|
- **Repo**: __MODULE_PATH__
|
||||||
- **Status**: active
|
- **Status**: active
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|||||||
+3
-3
@@ -1,14 +1,14 @@
|
|||||||
# Cursor rules — auto-generated
|
# Cursor rules — auto-generated
|
||||||
# Do not edit. Run: task context:sync
|
# Do not edit. Run: task context:sync
|
||||||
|
|
||||||
# hostexecutor
|
# __PROJECT_NAME__
|
||||||
|
|
||||||
## Identity
|
## Identity
|
||||||
|
|
||||||
- **Name**: hostexecutor
|
- **Name**: __PROJECT_NAME__
|
||||||
- **Owner**: Mathias
|
- **Owner**: Mathias
|
||||||
- **Client**: personal
|
- **Client**: personal
|
||||||
- **Repo**: gitea.d-ma.be/mathias/hostexecutor
|
- **Repo**: __MODULE_PATH__
|
||||||
- **Status**: active
|
- **Status**: active
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|||||||
+11
-11
@@ -8,7 +8,7 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE: hostexecutor
|
IMAGE: __PROJECT_NAME__
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
@@ -81,16 +81,16 @@ jobs:
|
|||||||
rm -rf /tmp/infra
|
rm -rf /tmp/infra
|
||||||
git clone -b main ssh://git@10.0.1.20:30022/mathias/infra.git /tmp/infra
|
git clone -b main ssh://git@10.0.1.20:30022/mathias/infra.git /tmp/infra
|
||||||
cd /tmp/infra
|
cd /tmp/infra
|
||||||
DEPLOYMENT="k3s/apps/hostexecutor/deployment.yaml"
|
DEPLOYMENT="k3s/apps/__PROJECT_NAME__/deployment.yaml"
|
||||||
sed -i "s|image: localhost:5000/hostexecutor:.*|image: localhost:5000/hostexecutor:${IMAGE_TAG}|" "$DEPLOYMENT"
|
sed -i "s|image: localhost:5000/__PROJECT_NAME__:.*|image: localhost:5000/__PROJECT_NAME__:${IMAGE_TAG}|" "$DEPLOYMENT"
|
||||||
grep -q "localhost:5000/hostexecutor:${IMAGE_TAG}" "$DEPLOYMENT" \
|
grep -q "localhost:5000/__PROJECT_NAME__:${IMAGE_TAG}" "$DEPLOYMENT" \
|
||||||
|| { echo "✗ image tag patch failed"; exit 1; }
|
|| { echo "✗ image tag patch failed"; exit 1; }
|
||||||
if git diff --quiet "$DEPLOYMENT"; then
|
if git diff --quiet "$DEPLOYMENT"; then
|
||||||
echo "ℹ image tag unchanged — skipping push"
|
echo "ℹ image tag unchanged — skipping push"
|
||||||
else
|
else
|
||||||
git -c user.name="hostexecutor CI" \
|
git -c user.name="__PROJECT_NAME__ CI" \
|
||||||
-c user.email="ci@hostexecutor.local" \
|
-c user.email="ci@__PROJECT_NAME__.local" \
|
||||||
commit -m "chore(deploy): hostexecutor → ${IMAGE_TAG}" "$DEPLOYMENT"
|
commit -m "chore(deploy): __PROJECT_NAME__ → ${IMAGE_TAG}" "$DEPLOYMENT"
|
||||||
git push origin main
|
git push origin main
|
||||||
echo "✓ pushed to infra repo"
|
echo "✓ pushed to infra repo"
|
||||||
fi
|
fi
|
||||||
@@ -105,11 +105,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Verify rollout
|
- name: Verify rollout
|
||||||
run: |
|
run: |
|
||||||
kubectl rollout status deployment/hostexecutor \
|
kubectl rollout status deployment/__PROJECT_NAME__ \
|
||||||
--namespace hostexecutor \
|
--namespace __PROJECT_NAME__ \
|
||||||
--timeout=120s \
|
--timeout=120s \
|
||||||
|| {
|
|| {
|
||||||
kubectl get pods -n hostexecutor -o wide
|
kubectl get pods -n __PROJECT_NAME__ -o wide
|
||||||
kubectl get events -n hostexecutor --sort-by='.lastTimestamp' | tail -20
|
kubectl get events -n __PROJECT_NAME__ --sort-by='.lastTimestamp' | tail -20
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# hostexecutor
|
# __PROJECT_NAME__
|
||||||
|
|
||||||
## Identity
|
## Identity
|
||||||
|
|
||||||
- **Name**: hostexecutor
|
- **Name**: __PROJECT_NAME__
|
||||||
- **Owner**: Mathias
|
- **Owner**: Mathias
|
||||||
- **Client**: personal
|
- **Client**: personal
|
||||||
- **Repo**: gitea.d-ma.be/mathias/hostexecutor
|
- **Repo**: __MODULE_PATH__
|
||||||
- **Status**: active
|
- **Status**: active
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# hostexecutor
|
# __PROJECT_NAME__
|
||||||
|
|
||||||
## Identity
|
## Identity
|
||||||
|
|
||||||
- **Name**: hostexecutor
|
- **Name**: __PROJECT_NAME__
|
||||||
- **Owner**: Mathias
|
- **Owner**: Mathias
|
||||||
- **Client**: personal
|
- **Client**: personal
|
||||||
- **Repo**: gitea.d-ma.be/mathias/hostexecutor
|
- **Repo**: __MODULE_PATH__
|
||||||
- **Status**: active
|
- **Status**: active
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ RUN go install github.com/a-h/templ/cmd/templ@latest
|
|||||||
COPY go.mod ./
|
COPY go.mod ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN templ generate && CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/app ./cmd/hostexecutor
|
RUN templ generate && CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/app ./cmd/__PROJECT_NAME__
|
||||||
|
|
||||||
FROM gcr.io/distroless/static-debian12:nonroot
|
FROM gcr.io/distroless/static-debian12:nonroot
|
||||||
COPY --from=build /out/app /app
|
COPY --from=build /out/app /app
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# hostexecutor
|
# __PROJECT_NAME__
|
||||||
|
|
||||||
> Generated from `mathias/template-go-web`.
|
> Generated from `mathias/template-go-web`.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -7,10 +7,10 @@ tasks:
|
|||||||
build:
|
build:
|
||||||
desc: Build the binary
|
desc: Build the binary
|
||||||
deps: [generate]
|
deps: [generate]
|
||||||
cmds: [go build -o bin/hostexecutor ./cmd/hostexecutor]
|
cmds: [go build -o bin/__PROJECT_NAME__ ./cmd/__PROJECT_NAME__]
|
||||||
run:
|
run:
|
||||||
deps: [build]
|
deps: [build]
|
||||||
cmds: [./bin/hostexecutor]
|
cmds: [./bin/__PROJECT_NAME__]
|
||||||
test:
|
test:
|
||||||
desc: Run all tests
|
desc: Run all tests
|
||||||
deps: [generate]
|
deps: [generate]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"gitea.d-ma.be/mathias/hostexecutor/internal/web"
|
"__MODULE_PATH__/internal/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -19,7 +19,7 @@ func main() {
|
|||||||
mux.Handle("/", web.NewHandler())
|
mux.Handle("/", web.NewHandler())
|
||||||
|
|
||||||
addr := ":8080"
|
addr := ":8080"
|
||||||
logger.Info("hostexecutor starting", "addr", addr)
|
logger.Info("__PROJECT_NAME__ starting", "addr", addr)
|
||||||
if err := http.ListenAndServe(addr, mux); err != nil {
|
if err := http.ListenAndServe(addr, mux); err != nil {
|
||||||
logger.Error("server stopped", "err", err)
|
logger.Error("server stopped", "err", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
module gitea.d-ma.be/mathias/hostexecutor
|
module __MODULE_PATH__
|
||||||
|
|
||||||
go 1.26
|
go 1.26
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package web
|
package web
|
||||||
|
|
||||||
templ Index() {
|
templ Index() {
|
||||||
@Layout("hostexecutor") {
|
@Layout("__PROJECT_NAME__") {
|
||||||
<h1 class="text-3xl font-semibold mb-6">hostexecutor</h1>
|
<h1 class="text-3xl font-semibold mb-6">__PROJECT_NAME__</h1>
|
||||||
<button hx-get="/api/hello" hx-target="#out"
|
<button hx-get="/api/hello" hx-target="#out"
|
||||||
class="px-4 py-2 bg-slate-900 text-white rounded-md hover:bg-slate-700">
|
class="px-4 py-2 bg-slate-900 text-white rounded-md hover:bg-slate-700">
|
||||||
Say hello
|
Say hello
|
||||||
|
|||||||
Reference in New Issue
Block a user