-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
145 lines (106 loc) · 4.84 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
.PHONY: help
.DEFAULT_GOAL := help
_latest_version := $(shell scripts/version.sh true)
_version := $(shell scripts/version.sh)
export USE_CONTAINER ?= docker
# Begin OS detection
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
export OPERATING_SYSTEM := Windows
export DEFAULT_FEATURES = default-msvc
else
export OPERATING_SYSTEM := $(shell uname) # same as "uname -s"
export DEFAULT_FEATURES = default
endif
help:
@echo " __ __ __"
@echo " \ \ / / / /"
@echo " \ V / / / "
@echo " \_/ \/ "
@echo ""
@echo " V E C T O R"
@echo ""
@echo "---------------------------------------------------------------------------------------"
@echo ""
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Development
bench: ## Run internal benchmarks
@cargo bench --all
build: ## Build the project in release mode
@cargo build --no-default-features --features="$${FEATURES:-default}" --release
check: check-code check-fmt check-generate check-examples
check-code: ## Checks code for compilation errors (only default features)
@scripts/run.sh checker cargo check --all --all-targets --features docker,kubernetes
check-fmt: ## Checks code formatting correctness
@scripts/run.sh checker scripts/check-style.sh
@scripts/run.sh checker cargo fmt -- --check
check-markdown: ## Check Markdown style
@scripts/run.sh checker-markdown markdownlint .
check-generate: ## Checks for pending `make generate` changes
@scripts/run.sh checker scripts/check-generate.sh
check-examples: ## Validates the config examples
@cargo run -q -- validate --topology --deny-warnings ./config/examples/*.toml
check-version: ## Checks that the version in Cargo.toml is up-to-date
@scripts/run.sh checker scripts/check-version.rb
check-blog: ## Checks that all blog articles are signed by their authors
@scripts/run.sh checker scripts/check-blog-signatures.rb
check-component-features: ## Checks that all component are behind corresponding features
@scripts/run.sh checker-component-features scripts/check-component-features.sh
export CHECK_URLS ?= true
generate: ## Generates files across the repo using the data in /.meta
@scripts/run.sh checker scripts/generate.rb
fmt: ## Format code
@scripts/check-style.sh --fix
@cargo fmt
release: ## Release a new Qovery version
@$(MAKE) release-meta
@$(MAKE) generate CHECK_URLS=false
@$(MAKE) release-commit
release-push: ## Push new Qovery version
@scripts/release-push.sh
run: ## Starts Qovery in development mode
@cargo run --no-default-features --features ${DEFAULT_FEATURES}
signoff: ## Signsoff all previous commits since branch creation
@scripts/signoff.sh
export ARTICLE ?= true
sign-blog: ## Sign newly added blog articles using GPG
@scripts/sign-blog.sh
test: ## Spins up Docker resources and runs _every_ test
@cargo test --no-default-features --features ${DEFAULT_FEATURES} --all --features docker --no-run
@docker-compose up -d test-runtime-deps
@cargo test --no-default-features --features ${DEFAULT_FEATURES} --all --features docker -- --test-threads 4
test-behavior: ## Runs behavioral tests
@cargo run --no-default-features --features ${DEFAULT_FEATURES} -- test tests/behavior/**/*.toml
clean: ## Remove build artifacts
@cargo clean
##@ Releasing
build-archive: ## Build a Qovery archive for a given $TARGET and $VERSION
scripts/build-archive.sh
build-ci-docker-images: ## Build the various Docker images used for CI
@scripts/build-ci-docker-images.sh
build-docker: ## Build the Qovery docker images from artifacts created via `package-deb`, but do not push
@scripts/build-docker.sh
package-deb: ## Create a .deb package from artifacts created via `build`
@scripts/package-deb.sh
package-rpm: ## Create a .rpm package from artifacts created via `build`
@scripts/package-rpm.sh
release-commit: ## Commits release changes
@scripts/release-commit.rb
release-docker: ## Release to Docker Hub
@scripts/release-docker.sh
release-github: ## Release to Github
@bundle install --gemfile=scripts/Gemfile --quiet
@scripts/release-github.rb
release-homebrew: ## Release to timberio Homebrew tap
@scripts/release-homebrew.sh
release-meta: ## Prepares the release metadata
@bundle install --gemfile=scripts/Gemfile --quiet
@scripts/release-meta.rb
release-rollback:
@bundle install --gemfile=scripts/Gemfile --quiet
@scripts/release-rollback.rb
release-s3: ## Release artifacts to S3
@scripts/release-s3.sh
sync-install:
@aws s3 cp distribution/install.sh s3://sh.qovery.dev --sse --acl public-read
version: ## Get the current Qovery version
@echo $(_version)