-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (40 loc) · 1.42 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
build:
cargo build --release --target arm-unknown-linux-musleabi
$(MAKE) deploy
build-cli:
cargo build --release --bin goto
mv target/release/goto /usr/local/bin/
goto --version
build-cross: # todo: compress before sending
cross build --release --target arm-unknown-linux-musleabi
$(MAKE) deploy
deploy:
scp target/arm-unknown-linux-musleabi/release/goto-api pi:/home/pi/goto-api
scp -r front/dist pi:/home/pi/goto-dist
scp goto.service pi:/home/pi/goto.service
ssh pi -- sudo mv /home/pi/goto-api /usr/local/bin/goto-api
ssh pi -- sudo mkdir -p /etc/goto/dist
ssh pi -- sudo rm -rf /etc/goto/dist/*
ssh pi -- sudo mv /home/pi/goto-dist/* /etc/goto/dist/
ssh pi -- sudo rm -r /home/pi/goto-dist
ssh pi -- sudo chown root:root /usr/local/bin/goto-api
ssh pi -- sudo chmod 755 /usr/local/bin/goto-api
ssh pi -- sudo mv /home/pi/goto.service /etc/systemd/system/goto.service
ssh pi -- sudo systemctl restart goto.service
ssh pi -- sudo journalctl -u goto.service
tarpaulin:
docker run \
--rm \
-v $(PWD):/volume \
--entrypoint cargo \
--security-opt seccomp=unconfined \
xd009642/tarpaulin \
tarpaulin --exclude-files front/*
coverage:
rm -rf coverage/
RUSTFLAGS="-Z instrument-coverage" \
LLVM_PROFILE_FILE="goto-%p-%m.profraw" \
cargo +nightly test
grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*cargo*" -o ./coverage/
rm *.profraw
open coverage/index.html