-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (71 loc) · 2.6 KB
/
Makefile
File metadata and controls
93 lines (71 loc) · 2.6 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
VERSION ?= latest
PLATFORMS ?= linux/arm64,linux/amd64
ORG ?= openshift-observability-ui
IMAGE ?= quay.io/${ORG}/troubleshooting-panel-console-plugin:${VERSION}
TAG ?= $(VERSION)
.PHONY: all
all: build-frontend build-backend test-frontend
.PHONY: test
test: test-frontend
.PHONY: test-frontend
test-frontend: lint-frontend
cd web && npm run test:unit
.PHONY: test-e2e
test-e2e:
cd web && npm install && npm run test:e2e
.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 --force
.PHONY: build-frontend
build-frontend: lint-frontend
cd web && npm run i18n && npm run build
.PHONY: start-frontend
start-frontend:
cd web && npm run start
.PHONY: start-console
start-console:
./scripts/start-console.sh
.PHONY: lint-frontend
lint-frontend:
cd web && npm run lint && npm run lint:tsc
.PHONY: install-backend
install-backend:
go mod download
.PHONY: build-backend
build-backend:
go build $(BUILD_OPTS) -o plugin-backend -mod=readonly cmd/plugin-backend.go
.PHONY: start-backend
start-backend:
go run ./cmd/plugin-backend.go -port='9002' -config-path='./web/dist' -static-path='./web/dist' -plugin-config-path='ct.yaml'
.PHONY: install
install: install-frontend install-backend
.PHONY: build-image
build-image: build-frontend test-frontend
TAG=$(TAG) ./scripts/build-image.sh
.PHONY: start-forward
start-forward:
./scripts/start-forward.sh
.PHONY: deploy
deploy: test-frontend ## Build and push image, reinstall on cluster using helm.
helm uninstall troubleshooting-panel-console-plugin -n troubleshooting-panel-console-plugin || true
PUSH=1 scripts/build-image.sh
helm install troubleshooting-panel-console-plugin charts/openshift-console-plugin -n troubleshooting-panel-console-plugin --create-namespace --set plugin.image=${IMAGE}
.PHONY: start-devspace-backend
start-devspace-backend:
/opt/app-root/plugin-backend -port=9443 -cert=/var/serving-cert/tls.crt -key=/var/serving-cert/tls.key -plugin-config-path=/etc/plugin/config.yaml -static-path=/opt/app-root/web/dist -config-path=/opt/app-root/web/dist
# NOTE: copied from https://github.com/korrel8r/korrel8r/blob/main/doc/korrel8r-openapi.yaml
.PHONY: generate-client
generate-client:
cd web && npm run generate-client
.PHONY: podman-cross-build
podman-cross-build:
podman manifest rm ${IMAGE} || true
podman manifest create ${IMAGE}
podman build --platform=${PLATFORMS} --manifest ${IMAGE} -f Dockerfile.dev
podman manifest push ${IMAGE}