Skip to content

Commit 8ddd1e8

Browse files
authored
Merge pull request #1169 from traPtitech/introduce-mise
miseの導入
2 parents 503d29a + 0fc8ffd commit 8ddd1e8

45 files changed

Lines changed: 574 additions & 771 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-protobuf.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v6
19-
- name: Install buf
20-
run: make init-buf
19+
- uses: jdx/mise-action@v4
20+
with:
21+
install_args: buf
2122
- name: Generate code
22-
run: make gen-proto
23+
run: mise run gen:proto
2324
- name: Check diff
2425
run: git diff --exit-code
2526

@@ -28,8 +29,9 @@ jobs:
2829
runs-on: ubuntu-latest
2930
steps:
3031
- uses: actions/checkout@v6
31-
- name: Install buf
32-
run: make init-buf
32+
- uses: jdx/mise-action@v4
33+
with:
34+
install_args: buf
3335
- name: Format proto files
3436
run: |
3537
if ! buf format --diff --exit-code; then
@@ -42,7 +44,8 @@ jobs:
4244
runs-on: ubuntu-latest
4345
steps:
4446
- uses: actions/checkout@v6
45-
- name: Install buf
46-
run: make init-buf
47+
- uses: jdx/mise-action@v4
48+
with:
49+
install_args: buf
4750
- name: Lint proto files
4851
run: buf lint

.local-manifest/Makefile

Lines changed: 0 additions & 66 deletions
This file was deleted.

.local-manifest/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ Manifest files required to deploy NeoShowcase locally using k8s backend
55
## Usage
66

77
tl;dr:
8-
Run `make up` / `make down`
8+
Run `mise run up` / `mise run down`
99

1010
### Spin up
1111

12-
1. `make k3d-up` to spin up the k3d cluster
13-
2. `make import` to build and import NeoShowcase images
14-
3. `make apply` to apply the manifest files
12+
1. `mise run k3d:up` to spin up the k3d cluster
13+
2. `mise run import` to build and import NeoShowcase images
14+
3. `mise run apply` to apply the manifest files
1515

1616
### Managing
1717

18-
- To tail cluster events (pulling image, creating container etc.), `make events`
19-
- To tail specific pod / container logs, `make logs NAMESPACE=ns-system APP=ns-controller`
18+
- To tail cluster events (pulling image, creating container etc.), `kubectl get events --watch`
19+
- To tail specific pod / container logs, `kubectl logs -f <pod-name> -n <namespace>`
2020
- For more, visit http://grafana.local.trapti.tech/ and see centralized Loki logs
2121
- Go to http://localhost:8080/ to view traefik dashboard
2222

@@ -27,4 +27,4 @@ Run `make up` / `make down`
2727

2828
### Spin down
2929

30-
1. `make k3d-down` to take down the k3d cluster completely
30+
1. `mise run k3d:down` to take down the k3d cluster completely

.local-manifest/mise.toml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[env]
2+
CLUSTER_NAME = "ns-dev"
3+
4+
[tasks."k3d:up"]
5+
description = "Spin up k3d cluster with envsubst"
6+
run = """
7+
if k3d cluster list "$CLUSTER_NAME" > /dev/null 2>&1; then
8+
echo "Cluster $CLUSTER_NAME already exists, skipping creation."
9+
else
10+
TMP_FILE=$(mktemp)
11+
envsubst < k3d.yaml > "$TMP_FILE"
12+
k3d cluster create "$CLUSTER_NAME" -c "$TMP_FILE"
13+
rm "$TMP_FILE"
14+
fi
15+
"""
16+
env = { PROJECT_ROOT = "{{ config_root | dirname }}" }
17+
18+
[tasks."k3d:down"]
19+
description = "Spin down k3d cluster"
20+
run = "k3d cluster delete $CLUSTER_NAME"
21+
22+
[tasks."ensure:context"]
23+
description = "Switch kubectl context to k3d"
24+
run = "kubectl config use-context k3d-$CLUSTER_NAME"
25+
26+
[tasks.import]
27+
description = "Build and import images into k3d"
28+
depends = ["build"]
29+
run = """
30+
#!/usr/bin/env bash
31+
images=(
32+
ns-dashboard ns-sablier ns-auth-dev ns-builder
33+
ns-controller ns-gateway ns-gitea-integration
34+
ns-migrate ns-ssgen
35+
)
36+
k3d image import --cluster "$CLUSTER_NAME" $(printf "ghcr.io/traptitech/%s:main " "${images[@]}")
37+
"""
38+
39+
[tasks.apply]
40+
description = "Apply manifests to k3d cluster (Helm enabled)"
41+
depends = ["ensure:context"]
42+
run = """
43+
ls -d */ | tr -d '/' | grep -v -E 'coredns-patch|crd' | \
44+
xargs -I{} sh -c 'kubectl create namespace {} --dry-run=client -o yaml | kubectl apply -f -'
45+
46+
kustomize build ./crd | kubectl apply -f -
47+
kustomize build --enable-helm --load-restrictor LoadRestrictionsNone . | kubectl apply -f -
48+
49+
kubectl rollout restart deployment/coredns -n kube-system
50+
"""
51+
52+
# ---- All-in-one commands ----
53+
54+
[tasks.up]
55+
description = "Full setup: k3d-up -> import -> apply"
56+
run = [{ task = "k3d:up" }, { task = "import" }, { task = "apply" }]
57+
58+
[tasks.down]
59+
description = "Full teardown"
60+
run = { task = "k3d:down" }

Makefile

Lines changed: 0 additions & 157 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This application is a successor to [kaz/showcase](https://github.com/kaz/showcas
1010

1111
## Development
1212

13-
Quick start: run `make init && make up`.
13+
Quick start: run `mise trust && mise run up`.
1414

1515
See [development.md](./docs/development.md) for more.
1616

buf.gen.go.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ managed:
77
- file_option: go_package
88
value: github.com/traPtitech/neoshowcase/pkg/infrastructure/grpc/pb
99
plugins:
10-
- local: ["go", "tool", "protoc-gen-go"]
10+
- remote: buf.build/protocolbuffers/go:v1.36.11
1111
out: .
12-
opt:
13-
- module=github.com/traPtitech/neoshowcase
14-
- local: ["go", "tool", "protoc-gen-connect-go"]
12+
opt: module=github.com/traPtitech/neoshowcase
13+
- remote: buf.build/connectrpc/go:v1.19.1
1514
out: .
16-
opt:
17-
- module=github.com/traPtitech/neoshowcase
15+
opt: module=github.com/traPtitech/neoshowcase

buf.gen.ts.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
version: v2
44
plugins:
5-
- local: ["sh", "-c", "cd dashboard && yarn protoc-gen-es"]
5+
- remote: buf.build/bufbuild/es:v2.11.0
66
out: dashboard/src/api
7-
opt:
8-
- target=ts
7+
opt: target=ts
98
inputs:
109
- directory: .
1110
exclude_paths:

0 commit comments

Comments
 (0)