-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (65 loc) · 2.23 KB
/
Copy pathMakefile
File metadata and controls
80 lines (65 loc) · 2.23 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
75
76
77
78
79
80
SHELL := /bin/bash
.DEFAULT_GOAL := help
.NOTPARALLEL:
DOCKER_COMPOSE ?= docker compose
COMPOSE_PARALLEL_LIMIT ?= 1
WISP_IMAGE_REPOSITORY ?= ghcr.io/jumpserver/wisp
WISP_BRANCH ?=
export WISP_BRANCH
WISP_TAG ?= $(shell ./scripts/resolve-wisp-tag.sh)
WISP_IMAGE ?= $(WISP_IMAGE_REPOSITORY):$(WISP_TAG)
WISP_PULL_POLICY ?= missing
export COMPOSE_PARALLEL_LIMIT
export WISP_IMAGE_REPOSITORY
export WISP_TAG
export WISP_IMAGE
export WISP_PULL_POLICY
export WISP_SOURCE
DEV_COMPOSE_FILES := -f docker-compose.yml -f docker-compose.wisp-dev.yml
ifneq ($(strip $(WISP_SOURCE)),)
DEV_COMPOSE_FILES += -f docker-compose.wisp-source.yml
endif
DEV_COMPOSE := $(DOCKER_COMPOSE) $(DEV_COMPOSE_FILES)
.PHONY: help dev run dev-run dev-up dev-wisp dev-wisp-image dev-logs dev-ps dev-config dev-down proto-sync
help:
@printf '%s\n' \
'Chen development commands:' \
' make dev Run in the foreground (make dev run also works)' \
' make dev-up Build and run in the background' \
' make dev-wisp Rebuild/recreate only Wisp' \
' make dev-wisp-image Show the resolved Wisp image' \
' make dev-logs Follow Chen and Wisp logs' \
' make dev-ps Show development services' \
' make dev-config Render the merged Compose configuration' \
' make dev-down Stop and remove development services' \
' make proto-sync Copy generated Java protobuf files from Wisp' \
'' \
'Wisp source mode:' \
' make dev WISP_SOURCE=/absolute/path/to/wisp' \
'' \
'Wisp image mode:' \
' Wisp tag defaults to the current Chen tracking branch' \
' make dev WISP_TAG=latest' \
' make dev WISP_IMAGE=registry/wisp:tag WISP_PULL_POLICY=always'
# Both spellings are supported, including one invocation written as
# `make dev run`. GNU Make updates their shared prerequisite only once.
dev run: dev-run
@:
dev-run:
@$(DEV_COMPOSE) up --build
dev-up:
@$(DEV_COMPOSE) up -d --build
dev-wisp:
@$(DEV_COMPOSE) up -d --build --no-deps wisp
dev-wisp-image:
@printf '%s\n' '$(WISP_IMAGE)'
dev-logs:
@$(DEV_COMPOSE) logs -f chen-backend wisp
dev-ps:
@$(DEV_COMPOSE) ps
dev-config:
@$(DEV_COMPOSE) config
dev-down:
@$(DEV_COMPOSE) down
proto-sync:
@./scripts/sync-wisp-proto.sh