-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (85 loc) · 2.71 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Makefile provides an API for CI related tasks
# Using the makefile is not required however CI
# uses the specific targets within the file.
# Therefore may be useful in ensuring a change
# is ready to pass CI checks.
RUSTFLAGS = --cfg tokio_unstable
CARGO = RUSTFLAGS='${RUSTFLAGS}' cargo
RELEASE_LEVEL ?= minor
# ECS environment to deploy image to
DEPLOY_ENV ?= dev
# Deploy target to use for CD manager job
DEPLOY_TARGET ?= latest
# Docker image tag to deploy
DEPLOY_TAG ?= latest
# Whether or not this is a manual deployment
MANUAL_DEPLOY ?= false
RUST_LOG ?= info
.EXPORT_ALL_VARIABLES:
.PHONY: all
all: build check-fmt check-clippy test
.PHONY: build
build:
# Build with default features
$(CARGO) build --locked --release
# Build with all features
$(CARGO) build --locked --release --all-features
.PHONY: fluence-build
fluence-build:
# Build with default features
fluence build
.PHONY: release
release: RUSTFLAGS += -D warnings
release:
$(CARGO) build -p checkpointer --locked --release
# Prepare a release PR.
.PHONY: release-pr
release-pr:
./ci-scripts/release_pr.sh ${RELEASE_LEVEL}
.PHONY: debug
debug:
$(CARGO) build -p checkpointer --locked
.PHONY: test
test:
# Setup scaffolding
./ci-scripts/setup_test_env.sh
# Test with default features
RUST_LOG=$(RUST_LOG) $(CARGO) test -p checkpointer --locked --release
# Test with all features
RUST_LOG=$(RUST_LOG) $(CARGO) test -p checkpointer --locked --release --all-features
./ci-scripts/teardown_test_env.sh
.PHONY: test-event-joiner
test-event-joiner:
# Setup scaffolding
IT_TEST_CHECKPOINTER=1 ./ci-scripts/setup_test_env.sh
# Test with default features
$(CARGO) test -p event-joiner --locked --release
# Test with all features
$(CARGO) test -p event-joiner --locked --release --all-features
IT_TEST_CHECKPOINTER=1 ./ci-scripts/teardown_test_env.sh
.PHONY: check-fmt
check-fmt:
$(CARGO) fmt --all -- --check
.PHONY: check-clippy
check-clippy:
# Check with default features
$(CARGO) clippy --workspace --locked --release -- -D warnings --no-deps
# Check with all features
$(CARGO) clippy --workspace --locked --release --all-features -- -D warnings --no-deps
.PHONY: run
run:
RUST_LOG=WARN,checkpointer=DEBUG $(CARGO) run --all-features --locked --release --bin checkpointer
.PHONY: build-docker
build-docker:
./ci-scripts/setup_test_env.sh
./ci-scripts/image.sh
./ci-scripts/teardown_test_env.sh
.PHONY: publish-docker
publish-docker: build-docker
./ci-scripts/publish.sh
.PHONY: schedule-ecs-deployment
schedule-ecs-deployment:
./ci-scripts/schedule_ecs_deploy.sh "${DEPLOY_ENV}" "${DEPLOY_TARGET}" "${DEPLOY_TAG}" "${MANUAL_DEPLOY}"
.PHONY: schedule-k8s-deployment
schedule-k8s-deployment:
./ci-scripts/schedule_k8s_deploy.sh "${DEPLOY_ENV}" "${DEPLOY_TAG}"