-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (45 loc) · 1.11 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
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
.PHONY: build
ARCH = x86_64-unknown-linux-musl
BIN_NAME = bootstrap
SAM_TEMPLATE = template.yaml
STACK_NAME = microservice-actix-sam
AWS_REGION = us-east-1
test:
cargo test -- --nocapture
check:
@cargo fmt --all
@cargo clippy --no-deps -- -D warnings
serve: check
fuser -k 7878/tcp || true && cargo run
coverage:
cargo tarpaulin --ignore-tests --avoid-cfg-tarpaulin
audit:
cargo audit
lint:
cargo fmt --all --check && cargo clippy --no-deps -- -D warnings
build:
cargo +nightly build --release --target $(ARCH)
package:
rm -rf build && mkdir -p build
cp -v ./target/$(ARCH)/release/$(BIN_NAME) build/bootstrap
ci-package: package
mkdir interim-wrapper
cp -v ./$(SAM_TEMPLATE) ./interim-wrapper/template.yaml
cp -v ./Makefile ./interim-wrapper/Makefile
mv build interim-wrapper
mv interim-wrapper build
deploy:
sam validate
sam deploy \
--stack-name $(STACK_NAME) \
--region $(AWS_REGION) \
--resolve-s3 \
--capabilities CAPABILITY_IAM \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--force-upload
destroy:
sam delete \
--stack-name $(STACK_NAME) \
--region $(AWS_REGION) \
--no-prompts