-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
146 lines (123 loc) · 4.51 KB
/
Copy pathTaskfile.yml
File metadata and controls
146 lines (123 loc) · 4.51 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
version: "3"
vars:
CMD: ./cmd/server
tasks:
default:
desc: Show available tasks
cmd: task --list
setup:
desc: Create .env from .env.example if it doesn't exist (cross-platform)
cmds:
- cp .env.example .env
status:
- test -f .env
run:
desc: Run the server locally (loads .env)
preconditions:
- sh: test -f .env
msg: ".env not found — run `task setup` first"
dotenv: [".env"]
cmd: go run {{.CMD}}
test:
desc: Run all tests
cmd: go test -race -count=1 ./...
upload:
desc: 'Upload a file via WebDAV PUT. Usage: task upload FILE=path/to/file [USER=alice:alice123] [URL=http://localhost:8080/files]'
requires:
vars: [FILE]
vars:
USER: '{{.USER | default "alice:alice123"}}'
URL: '{{.URL | default "http://localhost:8080/files"}}'
cmds:
- 'curl -sS -T "{{.FILE}}" -u "{{.USER}}" -w "HTTP %{http_code}\n" "{{.URL}}/{{base .FILE}}"'
deps:
desc: Download Go module dependencies
cmd: go mod download
deps-update:
desc: Upgrade all dependencies to latest and tidy
cmds:
- go get -u ./...
- go mod tidy
lint:
desc: Run golangci-lint
cmd: golangci-lint run ./...
lint-install:
desc: Install golangci-lint (dev only)
cmd: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
quality:
desc: Run linter, vet, and tests (mirrors the CI quality workflow)
cmds:
- go vet ./...
- golangci-lint run ./...
- go test -race -count=1 -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out
minio-up:
desc: Start a local MinIO instance and create the `webdav` bucket
cmds:
- docker compose -f docker-compose.minio.yml up -d
- echo "MinIO API → http://localhost:9000"
- echo "MinIO UI → http://localhost:9001 (minioadmin / minioadmin)"
- echo "Bucket → webdav"
minio-down:
desc: Stop and remove the local MinIO instance (volumes preserved)
cmd: docker compose -f docker-compose.minio.yml down
minio-reset:
desc: Stop MinIO and wipe its data volume
cmd: docker compose -f docker-compose.minio.yml down -v
run-minio:
desc: Run the server against the local MinIO instance (run `task minio-up` first)
env:
STORAGE_TYPE: s3
S3_BUCKET: webdav
S3_REGION: us-east-1
S3_ENDPOINT: http://localhost:9000
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
BASIC_AUTH_ENABLED: "true"
BASIC_USERS: "alice:alice123"
FOLDER_PERMISSIONS: "/files:*:rw"
cmd: go run {{.CMD}}
azurite-up:
desc: Start a local Azurite (Azure Blob emulator) and create the `webdav` container
cmds:
- docker compose -f docker-compose.azurite.yml up -d
- 'echo "Azurite blob → http://localhost:10000"'
- 'echo "Container → webdav (account devstoreaccount1)"'
azurite-down:
desc: Stop and remove the local Azurite instance (volume preserved)
cmd: docker compose -f docker-compose.azurite.yml down
azurite-reset:
desc: Stop Azurite and wipe its data volume
cmd: docker compose -f docker-compose.azurite.yml down -v
gcs-up:
desc: Start a local fake-gcs-server and create the `webdav` bucket
cmds:
- docker compose -f docker-compose.fake-gcs.yml up -d
- 'echo "fake-gcs → http://localhost:4443"'
- 'echo "Bucket → webdav"'
gcs-down:
desc: Stop and remove the local fake-gcs-server (volume preserved)
cmd: docker compose -f docker-compose.fake-gcs.yml down
gcs-reset:
desc: Stop fake-gcs-server and wipe its data volume
cmd: docker compose -f docker-compose.fake-gcs.yml down -v
run-gcs:
desc: Run the server against the local fake-gcs-server (run `task gcs-up` first)
env:
STORAGE_TYPE: gcs
GCS_BUCKET: webdav
STORAGE_EMULATOR_HOST: http://localhost:4443
BASIC_AUTH_ENABLED: "true"
BASIC_USERS: "alice:alice123"
FOLDER_PERMISSIONS: "/files:*:rw"
cmd: go run {{.CMD}}
run-azure:
desc: Run the server against the local Azurite instance (run `task azurite-up` first)
env:
STORAGE_TYPE: azure
AZURE_CONTAINER: webdav
AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
BASIC_AUTH_ENABLED: "true"
BASIC_USERS: "alice:alice123"
FOLDER_PERMISSIONS: "/files:*:rw"
cmd: go run {{.CMD}}