-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.35 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
DOCKER ?= docker
INPUT_RELEASE_VERSION ?= 0.1.0
MIN_RUST_VERSION ?= 1.65.0
REPO ?= jerusdp/ci-rust
TAG ?= $(MIN_RUST_VERSION)
BASE_TAG ?= base
WASI_TAG ?= wasi
publish: build
$(DOCKER) push $(REPO):${TAG}
publish-tag: build publish
$(DOCKER) tag $(REPO):${TAG} "$(REPO):$(INPUT_RELEASE_VERSION)-min-rust-$(MIN_RUST_VERSION)"
$(DOCKER) push "$(REPO):$(INPUT_RELEASE_VERSION)-min-rust-$(MIN_RUST_VERSION)"
build:
$(DOCKER) build --no-cache --build-arg MIN_RUST_VERSION=$(MIN_RUST_VERSION) -t $(REPO):${TAG} --target final .
build-binaries:
$(DOCKER) build --no-cache --build-arg MIN_RUST_VERSION=$(MIN_RUST_VERSION) -t $(REPO):${TAG} --target binaries .
build-base:
$(DOCKER) build --no-cache -t $(REPO):${BASE_TAG} --target base .
build-wasi:
$(DOCKER) build --no-cache --build-arg MIN_RUST_VERSION=$(MIN_RUST_VERSION) -t $(REPO):${TAG}-${WASI_TAG} --target wasi .
debug: build
$(DOCKER) run --rm -it \
--entrypoint=/bin/bash \
$(REPO):${TAG}
debug-wasi: build-wasi
$(DOCKER) run --rm -it \
--entrypoint=/bin/bash \
$(REPO):${TAG}-${WASI_TAG}
debug-binaries : build-binaries
$(DOCKER) run --rm -it \
--entrypoint=/bin/bash \
$(REPO):$(TAG)
build-test:
$(DOCKER) build --build-arg MIN_RUST_VERSION=$(MIN_RUST_VERSION) -t $(REPO)/test:${TAG}-${WASI_TAG} --target test .
test: build-test
$(DOCKER) run --rm \
$(REPO)/test:${TAG}-${WASI_TAG}