-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
74 lines (61 loc) · 2.16 KB
/
Makefile
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
.PHONY: ci getfrontendfiles build builder packages run
DEB_PREFIX = /usr
RPM_PREFIX = /usr
BUILD_NUMBER := $(or $(BUILD_NUMBER),1)
# make a ci build
ci:
CGO_ENABLED=0 \
GOOS=linux \
GO111MODULE=on go build \
-a \
-o build/ccmgr \
-ldflags "-s -w -extldflags -static" \
.
CGO_ENABLED=0 \
GOOS=linux \
GO111MODULE=on go build \
-a \
-o build/ccmgradm \
-ldflags "-s -w -extldflags -static" \
./ccmgradm
ci-docker:
docker run --platform=linux/amd64 --rm -v "$(shell pwd):/code" -w /code -it severalnines/cmon-proxy-builder make ci
packages:
cmake . \
-Bcmake-build \
-DCMAKE_INSTALL_PREFIX=$(DEB_PREFIX) \
-DBUILDNUM=$(BUILD_NUMBER) \
-DCPACK_GENERATOR=DEB
make -C ./cmake-build package
cmake . \
-Bcmake-build \
-DCMAKE_INSTALL_PREFIX=$(RPM_PREFIX) \
-DBUILDNUM=$(BUILD_NUMBER) \
-DCPACK_GENERATOR=RPM
make -C ./cmake-build package
getfrontendfiles:
-@docker rm -f cmonproxyfe
docker create -ti --name cmonproxyfe severalnines/cmon-proxy-fe:latest bash
docker cp cmonproxyfe:/app ./
docker rm -f cmonproxyfe
echo "Pulled frontend files:"
find ./app
echo "window.FEAS_ENV = { API_URL: '/proxy' };" > app/config.js
build:
docker build -t severalnines/cmon-proxy . -f docker/Dockerfile.local
builder:
docker buildx build --platform=linux/amd64 -t severalnines/cmon-proxy-builder . -f docker/Dockerfile.builder
builder-run:
docker run -v "$(shell pwd):/code" -p 19051:19051 -it severalnines/cmon-proxy-builder
builder-push:
docker push severalnines/cmon-proxy-builder:latest
run:
-@echo "Once started you can open UI at https://127.0.0.1:19051/ (accept the self-signed cert)"
-@echo "To create/change users, find your container using docker ps, then call"
-@echo "$$ docker exec e4a846db54b3 ./ccmgradm # replace with your container ID"
-mkdir -p dockerdata
docker run -v "$(shell pwd)/dockerdata:/data" -p 19051:19051 severalnines/cmon-proxy
releasetoregistry:
bash -c 'pushd ../cmon-proxy-fe; docker build -f Dockerfile.build . -t severalnines/cmon-proxy-fe; popd'
docker build -f Dockerfile.local . -t severalnines/clustercontrol-manager
docker push severalnines/clustercontrol-manager:latest