-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
56 lines (45 loc) · 1.87 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
TOP := $(dir $(firstword $(MAKEFILE_LIST)))
.PHONY: build sdk-openssl example-test-agent-image example-resource-agent-image controller-image images sonobuoy-test-agent-image integ-test
UNAME_ARCH=$(shell uname -m)
ARCH ?= $(lastword $(subst :, ,$(filter $(UNAME_ARCH):%,x86_64:amd64 aarch64:arm64)))
export CARGO_HOME = $(TOP)/.cargo
# Fetches crates from upstream
fetch:
cargo fetch --locked
images: fetch controller-image
# Builds, Lints and Tests the Rust workspace
build: fetch
cargo fmt -- --check
cargo build --locked
cargo test --locked
# Build the container image for the example test-agent program
example-test-agent-image: fetch
docker build $(DOCKER_BUILD_FLAGS) \
--build-arg ARCH="$(UNAME_ARCH)" \
--tag "example-testsys-agent" \
--network none \
-f agent/test-agent/examples/example_test_agent/Dockerfile .
# Build the container image for the example resource-agent program
example-resource-agent-image: fetch
docker build $(DOCKER_BUILD_FLAGS) \
--build-arg ARCH="$(UNAME_ARCH)" \
--tag "example-resource-agent" \
--network none \
-f agent/resource-agent/examples/example_resource_agent/Dockerfile .
controller-image: fetch
docker build $(DOCKER_BUILD_FLAGS) \
--build-arg ARCH="$(UNAME_ARCH)" \
--tag "testsys-controller" \
-f controller/Dockerfile .
sonobuoy-test-agent-image: fetch
docker build $(DOCKER_BUILD_FLAGS) \
--build-arg UNAME_ARCH="$(UNAME_ARCH)" \
--build-arg ARCH="$(ARCH)" \
--tag "sonobuoy-test-agent" \
-f agent/sonobuoy-test-agent/Dockerfile .
integ-test: fetch controller-image example-test-agent-image example-resource-agent-image sonobuoy-test-agent-image
docker tag example-testsys-agent example-testsys-agent:integ
docker tag testsys-controller testsys-controller:integ
docker tag example-resource-agent example-resource-agent:integ
docker tag sonobuoy-test-agent sonobuoy-test-agent:integ
cargo test --features integ