-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
103 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
setup: | ||
# install brew if not installed | ||
ifeq (, $(shell which brew)) | ||
$(info "brew not found, install...") | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
endif | ||
# install docker if not installed | ||
ifeq (, $(shell which docker)) | ||
$(info "docker not found, install...") | ||
brew install --cask docker | ||
endif | ||
# install helm if not installed | ||
ifeq (, $(shell which helm)) | ||
$(info "helm not found, install...") | ||
brew install helm | ||
endif | ||
# install rust if not installed | ||
ifeq (, $(shell which rustc)) | ||
$(info "rust not found, install...") | ||
curl https://sh.rustup.rs -sSf | sh | ||
endif | ||
# update /etc/hosts (required for deploy with helm) | ||
ifeq (, $(shell cat /etc/hosts | grep dev-wep-api.com)) | ||
$(info "update /etc/hosts...") | ||
echo "127.0.0.1 dev-wep-api.com" | sudo tee -a /etc/hosts | ||
endif | ||
rustup component add rustfmt | ||
rustup component add clippy | ||
rustup component add llvm-tools-preview | ||
cargo install grcov | ||
|
||
deploy: | ||
openssl req \ | ||
-x509 -newkey rsa:4096 -sha256 -nodes \ | ||
-keyout tls.key -out tls.crt \ | ||
-subj "/CN=ingress.local" -days 365 | ||
|
||
kubectl create secret tls api-secret \ | ||
--cert=tls.crt \ | ||
--key=tls.key | ||
|
||
helm upgrade --install --atomic --timeout 300s --wait web-api-dev helm | ||
|
||
delete: | ||
helm delete web-api-dev --purge | ||
|
||
uninstall: | ||
rustup self uninstall -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
up: | ||
ifeq ($(flag),e) | ||
docker-compose up -d | ||
else ifeq ($(flag),a) | ||
docker-compose --profile dev-build up -d | ||
else | ||
$(warning "pass flag=e (environment only) or flag=a (all include applications)") | ||
endif | ||
|
||
down: | ||
ifeq ($(flag),e) | ||
docker-compose down | ||
else ifeq ($(flag),a) | ||
docker-compose --profile dev-build down | ||
else | ||
$(warning "pass flag=e (environment only) or flag=a (all include applications)") | ||
endif | ||
|
||
build: | ||
ifeq ($(flag),l) | ||
cargo build --workspace | ||
else ifeq ($(flag),i) | ||
docker-compose --profile dev-build build | ||
else | ||
$(warning "pass flag=l (for build local) or flag=i (for build images)") | ||
endif | ||
|
||
lint: | ||
cargo clippy | ||
|
||
format: | ||
cargo fmt | ||
|
||
run: | ||
./target/debug/host | ||
|
||
tests: | ||
./run_tests.sh |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters