-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
61 lines (53 loc) · 2.03 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
59
60
.ONE_SHELL:
.PHONY: default
SHELL := /bin/bash
default: aarch64
.PHONY: aarch64
aarch64:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc cargo build --target aarch64-unknown-linux-gnu
aarch64-release:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc cargo build --target aarch64-unknown-linux-gnu --release --locked
.PHONY: aarch64-cross
aarch64-cross:
cross build --target aarch64-unknown-linux-gnu --release --locked
.PHONY: amd64
amd64:
TARGET_CC=x86_64-unknown-linux-gnu-gcc cargo build --target=x86_64-unknown-linux-gnu
.PHONY: amd64-cross
amd64-cross:
cross build --target=x86_64-unknown-linux-gnu --release --locked
.PHONY: lint
lint:
cargo clippy
.PHONY: lint-fix
lint-fix:
cargo clippy --fix --all --allow-dirty --allow-staged
.PHONY: run-e2e-tests
run-e2e-tests: SSH_PRIVATE_KEY=/tmp/skate-e2e-key
run-e2e-tests:
set -euo pipefail
[ -f ${SSH_PRIVATE_KEY} ] || ssh-keygen -b 2048 -t rsa -f ${SSH_PRIVATE_KEY} -q -N ""
echo "SSH_PRIVATE_KEY=${SSH_PRIVATE_KEY}" > ./hack/.clusterplz.env
# start vms
./hack/clusterplz create || exit 0
cargo run --bin skate -- delete cluster e2e-test --yes || exit 0
cargo run --bin skate -- create cluster e2e-test
cargo run --bin skate -- config use-context e2e-test
./hack/clusterplz skatelet
./hack/clusterplz skate
# the ignored tests are the e2e tests. This is not optimal.
SKATE_E2E=1 cargo test --test '*' -v -- --show-output --nocapture
.PHONY: run-e2e-tests-docker
run-e2e-tests-docker: SSH_PRIVATE_KEY=/tmp/skate-e2e-key
run-e2e-tests-docker:
set -xeuo pipefail
[ -f ${SSH_PRIVATE_KEY} ] || ssh-keygen -b 2048 -t rsa -f ${SSH_PRIVATE_KEY} -q -N ""
echo "SSH_PRIVATE_KEY=${SSH_PRIVATE_KEY}" > ./hack/.sindplz.env
# start vms
./hack/sindplz create || exit 0
cargo run --bin skate -- delete cluster e2e-test --yes || exit 0
cargo run --bin skate -- create cluster e2e-test
cargo run --bin skate -- config use-context e2e-test
./hack/sindplz skatelet
./hack/sindplz skate
SKATE_E2E=1 cargo test --test '*' -v -- --show-output --nocapture