-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 1.13 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
# This Makefile targets Ubuntu, different builds may require steps other than those in the 'prepare' stage
#
# 'deploy' expects POG_BUCKET to be set to the S3 bucket/folder containing the binaries
# example: export POG_BUCKET=my-s3-bucket/pog/production
.PHONY: clean
clean:
rm bootstrap*
cargo clean
.PHONY: prepare
prepare:
rustup target add x86_64-unknown-linux-musl
sudo apt install musl-tools
test:
cargo test
check:
cargo audit
cargo clippy
build: test
cargo build --target x86_64-unknown-linux-musl --release --bin pog
cargo build --target x86_64-unknown-linux-musl --release --bin pog_client
cargo build --release --bin gateway
cargo build --release --bin commands
deploy: check-env build
cp target/x86_64-unknown-linux-musl/release/pog bootstrap
zip bootstrap.zip bootstrap
aws s3 cp bootstrap.zip s3://$(POG_BUCKET)/server/bootstrap.zip
cp target/x86_64-unknown-linux-musl/release/pog_client bootstrap
zip bootstrap.zip bootstrap
aws s3 cp bootstrap.zip s3://$(POG_BUCKET)/client/bootstrap.zip
aws s3 cp target/release/gateway s3://$(POG_BUCKET)/gateway
check-env:
ifndef POG_BUCKET
$(error POG_BUCKET is undefined)
endif