-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
72 lines (57 loc) · 1.73 KB
/
Copy pathjustfile
File metadata and controls
72 lines (57 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# naste deployment commands
# Show all available commands
[private]
default:
@just --list
# Build the Go server binary
build:
go build -o naste-server .
# Build the CLI client
build-cli:
go build -o naste ./cmd/naste
# Run locally with default settings
run:
NASTE_DATA_DIR=./tmp-data NASTE_PORT=8080 ./naste-server
# Run with auth configured
run-auth:
NASTE_DATA_DIR=./tmp-data NASTE_PORT=8080 NASTE_PRIVATE_USER=admin NASTE_PRIVATE_PASS=secret ./naste-server
# Run tests
test:
go test ./...
# Lint everything
lint:
golangci-lint run ./...
go vet ./...
# Format nix + go files via treefmt
fmt:
nix develop -c treefmt
# Build Docker image via Nix
image:
nix build .#dockerImage
echo "Image: ./result"
ls -la result
# Load image into Docker (requires Docker daemon)
image-load: image
docker load < result
# Deploy locally
# First run: prompts for NASTE_PRIVATE_USER, NASTE_PRIVATE_PASS, NASTE_PORT
# Subsequent runs: reads from /etc/naste-server/env (preserves config)
deploy:
nix run .#deploy
# Deploy to remote server via SSH
# First run: prompts for config on remote server
# Subsequent runs: preserves config automatically
# Usage: just deploy-remote user@server.example.com
deploy-remote host:
nix run .#deploy -- "{{host}}"
# Deploy from GitHub without cloning
# Usage: just deploy-github user@server.example.com
deploy-github host="":
nix run github:semi710/naste#deploy -- "{{host}}"
# Clean build artifacts
clean:
rm -f naste-server naste
rm -rf result result-* tmp-data test-data
# Serve docs locally (http://0.0.0.0:<random-port>)
doc:
PORT=$(shuf -i 8000-9000 -n 1) && echo "→ http://0.0.0.0:$PORT" && nix run .#docs -- serve -a 0.0.0.0:$PORT --quiet 2>&1 | grep -v "│"