-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
174 lines (167 loc) · 6 KB
/
Taskfile.yaml
File metadata and controls
174 lines (167 loc) · 6 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
version: "3"
includes:
talos: .taskfile/talos.yaml
lab: .taskfile/lab.yaml
gen: .taskfile/gen.yaml
k3d: .taskfile/kube3d.yaml
tool: .taskfile/tool.yaml
lint: .taskfile/lint.yaml
tmux: .taskfile/tmux.yaml
dotenv:
- .env
tasks:
init:
desc: "Initialize the project"
silent: true
cmds:
- echo "Initializing the project"
- cargo install cargo-set-version cargo-machete
- yarn install
- cd .docs && yarn install
- cog install-hook -a -o
back:
desc: "Run the backend"
env:
KUBECONFIG: ./kubeconfig.local-k3d.yaml
#OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:5081/api/default"
#OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Basic cm9vdEBleGFtcGxlLmNvbTpDb21wbGV4cGFzcyMxMjM=,organization=default,stream-name=default"
REDIS_URL: redis://:{{ .REDIS_PASSWORD }}@localhost:6379
silent: true
cmds:
- echo "Running the backend"
- cargo run --bin server
back:tls:
desc: "Run the TLS terminator"
env:
KUBECONFIG: ./kubeconfig.local-k3d.yaml
REDIS_URL: redis://:{{ .REDIS_PASSWORD }}@localhost:6379
SERVER_HTTPS: "true"
SERVER_CERT_PATH: ".tls/cert.pem"
SERVER_KEY_PATH: ".tls/key.pem"
ENV: "development"
RUST_LOG: "debug"
silent: true
cmds:
- echo "Running the backend"
- cargo run --bin server
back:tls2:
desc: "Run a second instance if the backend with TLS"
cmds:
- HOSTNAME="BACK2" SERVER_PORT="5438" task back:tls
front:
desc: "Run the frontend in development mode"
silent: true
cmds:
- echo "Running the frontend in development mode"
- yarn nx run front:dev
front:tls:
desc: "Run the frontend in development mode with TLS"
silent: true
cmds:
- echo "Running the frontend in development mode with TLS"
- VITE_TLS_ENABLE=true yarn nx run front:dev
aio:
desc: "Run the backend and frontend in development mode"
silent: true
deps:
- back:tls
- front:tls
- service
- k3d:start
service:
desc: "Run the service task"
silent: true
cmds:
- echo "Running the service task"
- echo "Traefik Dashboard https://traefik.k8s.localhost/dashboard/"
# check if neither docker nor podman is installed
- |
if ! command -v docker >/dev/null && ! command -v podman >/dev/null; then
echo "Neither docker nor podman is installed. Please install one of them to run the service."
exit 1
fi
- command -v docker && PUID="$(id -u)" PGID="$(id -g)" docker compose up || true
- command -v podman && PODMAN_USERNS="host" PUID="$(id -u)" PGID="$(id -g)" podman compose up || true
service:recette:
desc: "Run the service task in recette mode"
silent: true
cmds:
- echo "Running the service task in recette mode"
- echo "Traefik Dashboard https://traefik.k8s.localhost/dashboard/"
# check if neither docker nor podman is installed
- |
if ! command -v docker >/dev/null && ! command -v podman >/dev/null; then
echo "Neither docker nor podman is installed. Please install one of them to run the service."
exit 1
fi
- command -v docker && PUID="$(id -u)" PGID="$(id -g)" MODE="recette" docker compose -f .compose/compose.recette.yaml up || true
- command -v podman && PODMAN_USERNS="host" PUID="$(id -u)" PGID="$(id -g)" MODE="recette" podman compose -f .compose/compose.recette.yaml up || true
init:service:
desc: "Initialize the service task"
silent: true
cmds:
- echo "Initializing the service task"
- echo "Generating self-signed certificates for local development"
- docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd)/.compose/authelia":/keys authelia/authelia:latest authelia crypto pair rsa generate --directory /keys
docs:
desc: "Run the documentation server"
dir: .docs
silent: true
env:
PROXY_AUTH_K8S_VERSION: 0.1.8
cmds:
- echo "Running the documentation server"
- yarn && yarn dev
recu:
desc: "Run all gen jobs"
silent: true
deps:
- gen:swagger-file
- gen:crds-file
cmds:
- task gen:client
lint:
desc: "Run all linters"
silent: true
deps:
- lint:rust
- lint:helm
cmds:
- task lint:all
cli:
desc: "Run kubectl_proxyauth with args"
silent: true
env:
KUBECONFIG: ./kubeconfig.proxy-dev.yaml
vars:
CLI: "./tmp/kubectl_proxyauth" #"cargo run --bin kubectl_proxyauth --"
cmds:
- '{{ .CLI }} {{ .CLI_ARGS }} --proxy-auth-config="proxyauth_config.dev.yaml"'
cli:get-token:
desc: "Run kubectl_proxyauth to get a token for a cluster"
silent: true
env:
KUBECONFIG: ./kubeconfig.proxy-dev.yaml
KUBERNETES_EXEC_INFO: '{ "apiVersion": "client.authentication.k8s.io/v1beta1", "kind": "ExecCredential", "spec": { "cluster": { "server": "https://localhost:5437/clusters/default/local-sso" } } }'
vars:
CLI_ARGS: "cargo run --bin kubectl_proxyauth --"
cmds:
- '{{ .CLI_ARGS }} --proxy-auth-config="proxyauth_config.dev.yaml" get-token'
cli:login:
desc: "Run kubectl_proxyauth to get a token for a cluster"
silent: true
env:
KUBECONFIG: ./kubeconfig.proxy-dev.yaml
KUBERNETES_EXEC_INFO: '{ "apiVersion": "client.authentication.k8s.io/v1beta1", "kind": "ExecCredential", "spec": { "cluster": { "server": "https://localhost:5437/clusters/default/local-sso" } } }'
cmds:
- kubectl oidc-login get-token --oidc-issuer-url=https://authelia.k8s.localhost --oidc-client-id=kube_login --oidc-client-secret=insecure_secret --oidc-extra-scope=groups --insecure-skip-tls-verify=true
bump:
desc: "Bump the version of the project"
silent: true
vars:
message: "cerberus4"
cmds:
- echo "Bumping the version of the project"
- cog bump {{ .CLI_ARGS }}
- VERSION=$(git tag --sort=-creatordate | head -n1) git tag $VERSION $VERSION^{} -f -m "{{ .message }}"
- VERSION=$(git tag --sort=-creatordate | head -n1) git push origin tag $VERSION