SERVICE_NAME := weather-rust
REGION := us-central1
.PHONY: all build run clean release test fmt clippy check docker-build deploy help
all: build
build:
@echo "Building the Rust project..."
@cargo build
run:
@echo "Running the Rust project..."
@cargo run
clean:
@echo "Cleaning the project..."
@cargo clean
release:
@echo "Building Release..."
@cargo build --release --target x86_64-unknown-linux-gnu
test:
@echo "Running tests..."
@cargo test
fmt:
@echo "Formatting code..."
@cargo fmt --all -- --check
clippy:
@echo "Linting code..."
@cargo clippy -- -D warnings
check:
@echo "Checking the code..."
@cargo check
docker-build:
@echo "Building the Docker image..."
@docker build -t gcr.io/$(gcloud config get-value project)/$(SERVICE_NAME):latest .
deploy:
@echo "Submitting build to Google Cloud Build..."
@gcloud builds submit . --config cloudbuild.yaml
help:
@echo "Makefile for the Rust project"
@echo ""
@echo "Usage:"
@echo " make <target>"
@echo ""
@echo "Targets:"
@echo " all (default) same as 'build'"
@echo " build Build the project for development"
@echo " run Run the project"
@echo " clean Clean the project"
@echo " release Build the project for release"
@echo " test Run tests"
@echo " fmt Check formatting"
@echo " clippy Lint the code"
@echo " check Check the code"
@echo " docker-build Build the Docker image"
@echo " deploy Submit the build to Google Cloud Build"