Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
225 lines (171 loc) · 5.45 KB
/
Copy pathMakefile
File metadata and controls
225 lines (171 loc) · 5.45 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
include common.mk
TEST_COUNT = 1
GO_TEST_FLAGS =
TEST_OUTPUT = ${PWD}/.test-output
PROTO_OUT := "${PWD}/ak-platform/src/generated"
TARGETS := ak-pam ak-nss ak-browser-support ak-cli ak-agent-desktop ak-agent browser-ext ee/psso ee/wcp vpkg/macos vpkg/windows vpkg/linux containers/selenium containers/test containers/e2e containers/ssh ak-platform ak-sysd
.PHONY: all
all: clean gen
.PHONY: clean
clean:
rm -rf ${PWD}/bin/*
.PHONY: gen
gen: rs-gen-proto ee/psso/gen
rs-gen-proto:
cargo install protoc-gen-prost
cargo install protoc-gen-tonic
cargo install protoc-gen-prost-crate
cargo install protoc-gen-prost-serde
mkdir -p $(PROTO_OUT)
protoc \
--prost_out=$(PROTO_OUT) \
--prost_opt=compile_well_known_types \
--prost_opt=extern_path=.google.protobuf=::pbjson_types \
--prost-crate_out=$(PROTO_OUT) \
--prost-crate_opt=no_features \
--tonic_out=$(PROTO_OUT) \
--prost-serde_out=$(PROTO_OUT) \
-I $(PROTO_DIR) \
${PROTO_DIR}/*
cargo fmt --all
cargo clippy --fix --allow-dirty -p ak-platform
ci-install-deps:
ifeq ($(PLATFORM),gnu/linux)
ifeq ($(CI),true)
sudo apt-get update
sudo apt-get install -y \
build-essential pkg-config libpam0g-dev libudev-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
endif
endif
# credprovider and browser-host are Windows-only workspace members: the first
# is written against Win32 APIs that don't exist off Windows, the second
# renders through WebView2. e2e drives both. They stay workspace members so one
# lockfile and one cargo invocation cover the repo, but clippy can only build
# them on Windows -- `make ee/wcp/lint` covers them there.
ifneq ($(OS),Windows_NT)
RS_LINT_EXCLUDE := --exclude ak-ee-wcp --exclude ak-ee-wcp-browser-host --exclude ak-ee-wcp-e2e
else
# nss and pam are unix-only.
RS_LINT_EXCLUDE := --exclude ak-nss --exclude ak-pam
endif
format:
cargo fmt
cargo clippy \
--fix \
--allow-dirty \
--workspace \
$(RS_LINT_EXCLUDE)
lint-rs:
cargo fmt --all
cargo clippy --workspace \
${RS_LINT_EXCLUDE} \
${RS_TEST_FLAGS}
cargo clippy --fix \
--allow-dirty \
--workspace \
${RS_LINT_EXCLUDE} \
${RS_TEST_FLAGS}
lint-rs-ci:
cargo fmt --all --check
cargo clippy --workspace \
${RS_LINT_EXCLUDE} \
${RS_TEST_FLAGS} \
-- -D warnings
lint-spellcheck:
pnpm install
pnpm run lint:spellcheck
.PHONY: lint
lint:$(foreach target,$(TARGETS),${target}/lint)
"$(MAKE)" lint-rs
test-integration:
"$(MAKE)" test GO_TEST_FLAGS=-tags=integration
test-e2e: containers/e2e/local-build
$(call cargo_test,ak-platform-e2e)
test-e2e-ci:
$(call cargo_test,ak-platform-e2e)
test-e2e-convert:
$(call rs_e2e_coverage_convert)
test-setup:
cargo run -p ak-cli -- -v config setup --authentik-url http://authentik:9000
test-ssh:
ssh -i akadmin@ak-platform-test-machine
test-shell:
docker exec -it authentik-platform_devcontainer-test-machine-1 bash
test-join:
docker exec \
-it \
--env AK_SYS_INSECURE_ENV_TOKEN=test-enroll-key \
authentik-platform_devcontainer-test-machine-1 \
ak-sysd domains join ak -a http://authentik:9000
test-full: clean ak-agent/test-deploy ak-sysd/test-deploy ak-cli/test-deploy ak-nss/test-deploy ak-pam/test-deploy test-ssh
dev--initialize: containers/test/local-build
bump:
$(SED_INPLACE) 's/VERSION = .*/VERSION = ${version}/g' common.mk
$(SED_INPLACE) 's/^version = "${VERSION}"/version = "${version}"/g' ${TOP}/Cargo.toml ${TOP}/Cargo.lock
"$(MAKE)" browser-ext/bump
"$(MAKE)" vpkg/macos/bump
"$(MAKE)" ee/psso/bump || true
print-version:
@echo ${VERSION}
# Must match the release the apps report (`ak_meta::sentry_options`, browser-ext `sentry.ts`).
SENTRY_RELEASE := ak-platform@${VERSION}
SENTRY_RELEASES_CLI := npx @sentry/cli releases --org authentik-security-inc --project platform
# Associates commits with the release so `Fixes PLATFORM-123` resolves issues on release.
sentry-release:
${SENTRY_RELEASES_CLI} new ${SENTRY_RELEASE}
${SENTRY_RELEASES_CLI} set-commits --auto --ignore-missing ${SENTRY_RELEASE}
${SENTRY_RELEASES_CLI} finalize ${SENTRY_RELEASE}
ak-pam/%:
"$(MAKE)" -C "${TOP}/ak-pam" $*
ak-nss/%:
"$(MAKE)" -C "${TOP}/ak-nss" $*
ak-browser-support/%:
"$(MAKE)" -C "${TOP}/ak-browser-support" $*
ak-cli/%:
"$(MAKE)" -C "${TOP}/ak-cli" $*
ak-platform/%:
"$(MAKE)" -C "${TOP}/ak-platform" $*
ak-sysd/%:
"$(MAKE)" -C "${TOP}/ak-sysd" $*
ak-agent/%:
"$(MAKE)" -C "${TOP}/ak-agent" $*
ak-agent-desktop/%:
"$(MAKE)" -C "${TOP}/ak-agent-desktop" $*
ak-api-cli-gen/%:
"$(MAKE)" -C "${TOP}/ak-api-cli-gen" $*
ak-platform-facts/%:
"$(MAKE)" -C "${TOP}/ak-platform-facts" $*
ak-platform-keyring/%:
"$(MAKE)" -C "${TOP}/ak-platform-keyring" $*
ak-platform-authz/%:
"$(MAKE)" -C "${TOP}/ak-platform-authz" $*
ak-api-cli/%:
"$(MAKE)" -C "${TOP}/ak-api-cli" $*
ak-flow-executor/%:
"$(MAKE)" -C "${TOP}/ak-flow-executor" $*
ak-meta/%:
"$(MAKE)" -C "${TOP}/ak-meta" $*
ak-meta-macros/%:
"$(MAKE)" -C "${TOP}/ak-meta-macros" $*
browser-ext/%:
"$(MAKE)" -C "${TOP}/browser-ext/" $*
ee/psso/%:
"$(MAKE)" -C "${TOP}/ee/psso/" $*
ee/wcp/%:
"$(MAKE)" -C "${TOP}/ee/wcp/" $*
vpkg/macos/%:
"$(MAKE)" -C "${TOP}/vpkg/macos" $*
vpkg/windows/%:
"$(MAKE)" -C "${TOP}/vpkg/windows" $*
vpkg/linux/%:
"$(MAKE)" -C "${TOP}/vpkg/linux" $*
containers/builder/%:
"$(MAKE)" -C "${TOP}/containers/builder" $*
containers/selenium/%:
"$(MAKE)" -C "${TOP}/containers/selenium" $*
containers/test/%:
"$(MAKE)" -C "${TOP}/containers/test" $*
containers/e2e/%:
"$(MAKE)" -C "${TOP}/containers/e2e" $*
containers/ssh/%:
"$(MAKE)" -C "${TOP}/containers/ssh" $*