-
Notifications
You must be signed in to change notification settings - Fork 126
/
Makefile
31 lines (23 loc) · 1.39 KB
/
Makefile
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
CARGO_PKG_VERSION := $(shell cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version')
clean:
rm -rf target
lint:
cargo clippy -- -Dwarnings
fmt:
cargo fmt --all -- --check
test:
cargo nextest run
build-image-x86: fmt lint test
LAMBDA_RUNTIME_USER_AGENT=aws-lambda-rust/aws-lambda-adapter/$(CARGO_PKG_VERSION) cargo lambda build --release --extension --target x86_64-unknown-linux-musl
printf 'FROM scratch\nADD target/lambda/extensions/. /\n' | docker build --platform=linux/amd64 -t aws-lambda-adapter:$(CARGO_PKG_VERSION)-x86_64 -f- .
build-image-arm64: fmt lint test
LAMBDA_RUNTIME_USER_AGENT=aws-lambda-rust/aws-lambda-adapter/$(CARGO_PKG_VERSION) cargo lambda build --release --extension --target aarch64-unknown-linux-musl
printf "FROM scratch\nADD target/lambda/extensions/. /\n" | docker build --platform=linux/arm64 -t aws-lambda-adapter:$(CARGO_PKG_VERSION)-aarch64 -f- .
build-LambdaAdapterLayerX86:
cp layer/* $(ARTIFACTS_DIR)/
LAMBDA_RUNTIME_USER_AGENT=aws-lambda-rust/aws-lambda-adapter/$(CARGO_PKG_VERSION) \
cargo lambda build --release --extension --target x86_64-unknown-linux-musl --lambda-dir $(ARTIFACTS_DIR)
build-LambdaAdapterLayerArm64:
cp layer/* $(ARTIFACTS_DIR)/
LAMBDA_RUNTIME_USER_AGENT=aws-lambda-rust/aws-lambda-adapter/$(CARGO_PKG_VERSION) \
cargo lambda build --release --extension --target aarch64-unknown-linux-musl --lambda-dir $(ARTIFACTS_DIR)