-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (60 loc) · 1.87 KB
/
Makefile
File metadata and controls
74 lines (60 loc) · 1.87 KB
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
.PHONY: setup build test lint fmt \
container-build container-test container-run \
login-github login-azure login-gitlab auth-status \
help
OS := $(shell uname -s 2>/dev/null || echo Windows)
## setup: Full automated setup -- installs Docker if needed, builds the image, opens a shell
setup:
ifeq ($(OS),Darwin)
@echo "==> Detected macOS"
@chmod +x ./scripts/setup.sh && ./scripts/setup.sh
else ifeq ($(OS),Linux)
@echo "==> Detected Linux"
@chmod +x ./scripts/setup.sh && ./scripts/setup.sh
else
@echo "==> Detected Windows"
@powershell -ExecutionPolicy Bypass -File scripts\\setup.ps1
endif
## build: Compile the devopster binary
build:
cargo build
## test: Run all tests
test:
cargo test
## lint: Run clippy
lint:
cargo clippy --all-targets --all-features -- -D warnings
## fmt: Format all Rust source files
fmt:
cargo fmt --all
## login-github: Sign in to GitHub via browser
login-github:
cargo run -- login github
## login-azure: Sign in to Azure DevOps via browser
login-azure:
cargo run -- login azure-devops
## login-gitlab: Sign in to GitLab via browser
login-gitlab:
cargo run -- login gitlab
## auth-status: Show authentication status for all providers
auth-status:
cargo run -- login status
## container-build: Build the dev container image
container-build:
docker build --target dev -t devopster-cli-dev .
## container-test: Run tests inside the container
container-test:
docker build -t devopster-cli-ci .
docker run --rm devopster-cli-ci cargo test
## container-run: Open a shell inside the container with host credentials mounted
container-run:
docker build --target dev -t devopster-cli-dev .
docker run --rm -it \
-v "$(HOME)/.config/devopster:/root/.config/devopster" \
-v "$(PWD):/app" \
-w /app \
devopster-cli-dev \
$(if $(ARGS),$(ARGS),bash)
## help: Show available make targets
help:
@grep -E '^##' Makefile | sed 's/## / /'