Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
58 lines (49 loc) · 1.9 KB
/
Copy pathTaskfile.yml
File metadata and controls
58 lines (49 loc) · 1.9 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
version: "3"
dotenv: [".env"] # Load variables automatically from .env at project root
vars:
CERTS_DIR: "certs/webhook"
# Taskfile for local development and testing
# Requires: https://taskfile.dev
# Usage examples:
# EMAIL_API_KEY=yourkey
# EMAIL_PROVIDER_FROM=from@example.com \
# EMAIL_PROVIDER_REPLY_TO=reply@example.com task run
#
# The run-manager task disables the metrics endpoint (metrics-bind-address=0) and skips any
# other production-specific settings so you can focus on testing the Email
# controller logic locally.
tasks:
# Run the controller manager locally
run-manager:
desc: "Run the controller manager locally with minimal settings"
cmds:
- |
go run ./cmd manager \
--metrics-bind-address 0 \
--email-from-address "$EMAIL_FROM_ADDRESS" \
--email-reply-to-address "$EMAIL_REPLY_TO_ADDRESS"
env:
# Propagate the variables set in the shell to Task so they can be used in the
# command block above. Values can be provided via the environment or a .env
# file.
RESEND_API_KEY: "{{.RESEND_API_KEY}}"
EMAIL_FROM_ADDRESS: "onboarding@resend.dev"
EMAIL_REPLY_TO_ADDRESS: "delivered@resend.dev"
# Generate all certificates for webhook server
generate-webhook-certs:
desc: Generate all certificates for webhook server
cmds:
- mkdir -p "{{.CERTS_DIR}}" && openssl req -x509 -nodes -newkey rsa:4096 -keyout "{{.CERTS_DIR}}/server.key" -out "{{.CERTS_DIR}}/server.crt" -days 1024 -subj "/CN=webhook.zitadel.svc" -sha256
# Run the webhook server locally
run-webhook:
desc: Run the webhook server locally
deps:
- generate-webhook-certs
cmds:
- |
go run ./cmd resend-webhook \
--webhook-port 8443 \
--cert-dir "{{.CERTS_DIR}}" \
--cert-file "server.crt" \
--key-file "server.key" \
--metrics-bind-address :8082