forked from openshift/monitoring-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
123 lines (94 loc) · 3 KB
/
Makefile
File metadata and controls
123 lines (94 loc) · 3 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
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
VERSION ?= latest
PLATFORMS ?= linux/arm64,linux/amd64
ORG ?= openshift-observability-ui
PLUGIN_NAME ?=monitoring-plugin
IMAGE ?= quay.io/${ORG}/${PLUGIN_NAME}:${VERSION}
FEATURES ?=incidents,perses-dashboards,dev-config
export NODE_OPTIONS?=--max_old_space_size=4096
.PHONY: install-frontend
install-frontend:
cd web && npm install
.PHONY: install-frontend-ci
install-frontend-ci:
cd web && npm ci --ignore-scripts
.PHONY: install-frontend-ci-clean
install-frontend-ci-clean: install-frontend-ci
cd web && npm cache clean
.PHONY: build-frontend
build-frontend:
cd web && npm run build
.PHONY: start-frontend
start-frontend:
cd web && npm run start
.PHONY: start-console
start-console:
./scripts/start-console.sh
.PHONY: i18n-frontend
i18n-frontend:
cd web && npm run i18n
.PHONY: lint-frontend
lint-frontend:
cd web && npm run lint
.PHONY: lint-backend
lint-backend:
go mod tidy
go fmt ./cmd/
go fmt ./pkg/
.PHONY: install-backend
install-backend:
go mod download
.PHONY: build-backend
build-backend:
go build $(BUILD_OPTS) -mod=readonly -o plugin-backend cmd/plugin-backend.go
.PHONY: start-backend
start-backend:
go run ./cmd/plugin-backend.go -port='9001' -config-path='./config' -static-path='./web/dist'
.PHONY: test-backend
test-backend:
go test ./pkg/... -v
.PHONY: test-frontend
test-frontend:
cd web && npm run test:unit
.PHONY: build-image
build-image:
./scripts/build-image.sh
.PHONY: install
install:
make install-frontend && make install-backend
.PHONY: update-plugin-name
update-plugin-name:
./scripts/update-plugin-name.sh
.PHONY: deploy
deploy:
make lint-backend
PUSH=1 scripts/build-image.sh
helm uninstall $(PLUGIN_NAME) -n $(PLUGIN_NAME)-ns || true
helm install $(PLUGIN_NAME) charts/openshift-console-plugin -n monitoring-plugin-ns --create-namespace --set plugin.image=$(IMAGE)
.PHONY: deploy-acm
deploy-acm:
./scripts/deploy-acm.sh
.PHONY: build-mcp-image
build-mcp-image:
DOCKER_FILE_NAME="Dockerfile.mcp" REPO="monitoring-console-plugin" scripts/build-image.sh
.PHONY: build-dev-mcp-image
build-dev-mcp-image:
DOCKER_FILE_NAME="Dockerfile.dev-mcp" REPO="monitoring-console-plugin" scripts/build-image.sh
.PHONY: start-feature-console
start-feature-console:
PLUGIN_PORT=9443 ./scripts/start-console.sh
.PHONY: start-feature-backend
start-feature-backend:
go run ./cmd/plugin-backend.go -port='9443' -config-path='./config' -static-path='./web/dist' -features='${FEATURES}'
.PHONY: start-devspace-backend
start-devspace-backend:
/opt/app-root/plugin-backend -port='9443' -cert='/var/cert/tls.crt' -key='/var/cert/tls.key' -static-path='/opt/app-root/web/dist' -config-path='/opt/app-root/config' -features='${FEATURES}'
.PHONY: podman-cross-build
podman-cross-build:
podman manifest create -a ${IMAGE}
podman build --platform ${PLATFORMS} --manifest ${IMAGE} -f Dockerfile.mcp
.PHONY: podman-cross-build-push
podman-cross-build-push: podman-cross-build
podman manifest push ${IMAGE}
.PHONY: test-translations
test-translations:
./scripts/test-translations.sh