-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (50 loc) · 1.69 KB
/
Copy pathMakefile
File metadata and controls
65 lines (50 loc) · 1.69 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
SHELL := /bin/bash
SERVER_DIR := server
WEBAPP_DIR := webapp
E2E_DIR := e2e
BUILD_DIR := build
PLUGIN_ARCHIVE := $(BUILD_DIR)/plugins/mm-oidc.tar.gz
PLUGIN_ID := com.mm.oidc
PACKAGE_ROOT := $(BUILD_DIR)/package
PLUGIN_STAGING := $(PACKAGE_ROOT)/$(PLUGIN_ID)
SERVER_DIST_DIR := $(SERVER_DIR)/dist
WEBAPP_DIST_DIR := $(WEBAPP_DIR)/dist
SERVER_BINARY := plugin-linux-amd64
YARN := corepack yarn
.PHONY: server-test server-build webapp-install webapp-build webapp-test webapp-lint e2e-install e2e-test package dev-up dev-down dev-logs clean-plugin
server-test:
cd $(SERVER_DIR) && go test ./...
server-build:
cd $(SERVER_DIR) && GOOS=linux GOARCH=amd64 go build -o dist/$(SERVER_BINARY) ./...
webapp-install:
cd $(WEBAPP_DIR) && $(YARN) install --inline-builds
webapp-build: webapp-install
cd $(WEBAPP_DIR) && $(YARN) build
webapp-test: webapp-install
cd $(WEBAPP_DIR) && $(YARN) test
webapp-lint: webapp-install
cd $(WEBAPP_DIR) && $(YARN) lint
e2e-install:
cd $(E2E_DIR) && $(YARN) install --inline-builds
cd $(E2E_DIR) && $(YARN) playwright install chromium
e2e-test:
./scripts/e2e-test.sh
package: server-build webapp-build
rm -rf $(PLUGIN_STAGING)
mkdir -p $(PLUGIN_STAGING)/server/dist $(PLUGIN_STAGING)/webapp/dist
cp plugin.json $(PLUGIN_STAGING)/
cp $(SERVER_DIST_DIR)/$(SERVER_BINARY) $(PLUGIN_STAGING)/server/dist/
cp -R $(WEBAPP_DIST_DIR)/. $(PLUGIN_STAGING)/webapp/dist/
mkdir -p $(BUILD_DIR)/plugins
tar -czvf $(PLUGIN_ARCHIVE) -C $(PACKAGE_ROOT) $(PLUGIN_ID)
clean-plugin:
rm -f $(PLUGIN_ARCHIVE)
rm -rf $(SERVER_DIR)/dist/$(SERVER_BINARY)
rm -rf $(WEBAPP_DIR)/dist
dev-up:
./scripts/dev-up.sh
dev-down:
./scripts/dev-down.sh
SERVICES ?=
dev-logs:
./scripts/dev-logs.sh $(SERVICES)