-
Notifications
You must be signed in to change notification settings - Fork 2
/
MakeDist.mk
84 lines (69 loc) · 3.61 KB
/
MakeDist.mk
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
# this file must use as base Makefile
SERVER_TEST_SSH_ALIASE = aliyun-ecs
SERVER_TEST_FOLDER = /home/work/Document/
SERVER_REPO_SSH_ALIASE = temp-goadmin-base
SERVER_REPO_FOLDER = /home/ubuntu/$(ROOT_NAME)
checkTestBuildPath:
@if [ ! -d ${ROOT_TEST_BUILD_PATH} ]; \
then mkdir -p ${ROOT_TEST_BUILD_PATH} && echo "~> mkdir ${ROOT_TEST_BUILD_PATH}"; \
fi
checkTestDistPath:
@if [ ! -d ${ROOT_TEST_DIST_PATH} ]; \
then mkdir -p ${ROOT_TEST_DIST_PATH} && echo "~> mkdir ${ROOT_TEST_DIST_PATH}"; \
fi
checkTestOSDistPath:
@if [ ! -d ${ROOT_TEST_OS_DIST_PATH} ]; \
then mkdir -p ${ROOT_TEST_OS_DIST_PATH} && echo "~> mkdir ${ROOT_TEST_OS_DIST_PATH}"; \
fi
checkReleaseDistPath:
@if [ ! -d ${ROOT_REPO_DIST_PATH} ]; \
then mkdir -p ${ROOT_REPO_DIST_PATH} && echo "~> mkdir ${ROOT_REPO_DIST_PATH}"; \
fi
checkReleaseOSDistPath:
@if [ ! -d ${ROOT_REPO_OS_DIST_PATH} ]; \
then mkdir -p ${ROOT_REPO_OS_DIST_PATH} && echo "~> mkdir ${ROOT_REPO_OS_DIST_PATH}"; \
fi
distTest: dep buildMain checkTestBuildPath
mv ./build/main $(ROOT_TEST_BUILD_PATH)
cp ./conf/test/config.yaml $(ROOT_TEST_BUILD_PATH)
-cp -R ./static $(ROOT_TEST_BUILD_PATH)
@echo "=> pkg at: $(ROOT_TEST_BUILD_PATH)"
distTestOS: dep buildARCH checkTestOSDistPath
@echo "=> Test at: $(ENV_DIST_OS) ARCH as: $(ENV_DIST_ARCH)"
mv ./build/main $(ROOT_TEST_OS_DIST_PATH)
cp ./conf/test/config.yaml $(ROOT_TEST_OS_DIST_PATH)
-cp -R ./static $(ROOT_TEST_OS_DIST_PATH)
@echo "=> pkg at: $(ROOT_TEST_OS_DIST_PATH)"
distTestOSTar: distTestOS
@echo "=> start tar test as os $(ENV_DIST_OS) $(ENV_DIST_ARCH)"
tar zcvf $(ROOT_DIST)/$(ENV_DIST_OS)/test/$(ROOT_NAME)-$(ENV_DIST_OS)-$(ENV_DIST_ARCH)-$(ENV_DIST_VERSION).tar.gz $(ROOT_TEST_OS_DIST_PATH)
distRelease: dep buildMain checkReleaseDistPath
mv ./build/main $(ROOT_REPO_DIST_PATH)
cp ./conf/release/config.yaml $(ROOT_REPO_DIST_PATH)
-cp -R ./static $(ROOT_REPO_DIST_PATH)
@echo "=> pkg at: $(ROOT_REPO_DIST_PATH)"
distReleaseOS: dep buildARCH checkReleaseOSDistPath
@echo "=> Release at: $(ENV_DIST_OS) ARCH as: $(ENV_DIST_ARCH)"
mv ./build/main $(ROOT_REPO_OS_DIST_PATH)
cp ./conf/release/config.yaml $(ROOT_REPO_OS_DIST_PATH)
-cp -R ./static $(ROOT_REPO_OS_DIST_PATH)
@echo "=> pkg at: $(ROOT_REPO_OS_DIST_PATH)"
distReleaseOSTar: distReleaseOS
@echo "=> start tar release as os $(ENV_DIST_OS) $(ENV_DIST_ARCH)"
tar zcvf $(ROOT_DIST)/$(ENV_DIST_OS)/release/$(ROOT_NAME)-$(ENV_DIST_OS)-$(ENV_DIST_ARCH)-$(ENV_DIST_VERSION).tar.gz $(ROOT_REPO_OS_DIST_PATH)
scpDistReleaseOSTar: distReleaseOSTar
scp $(ROOT_DIST)/$(ENV_DIST_OS)/release/$(ROOT_NAME)-$(ENV_DIST_OS)-$(ENV_DIST_ARCH)-$(ENV_DIST_VERSION).tar.gz $(SERVER_REPO_SSH_ALIASE):$(SERVER_REPO_FOLDER)
@echo "=> must check below config of set for relase OS Scp"
scpDockerComposeTest:
scp ./conf/test/docker-compose.yml $(SERVER_TEST_SSH_ALIASE):$(SERVER_TEST_FOLDER)
@echo "=> finish update docker compose at test"
helpDist:
@echo "Help: helpDist.mk"
@echo "-- distTestOS or distReleaseOS will out abi as: $(ENV_DIST_OS) $(ENV_DIST_ARCH) --"
@echo "~> make distTest - build dist at $(ROOT_TEST_DIST_PATH) in local OS"
@echo "~> make distTestOS - build dist at $(ROOT_TEST_OS_DIST_PATH) as: $(ENV_DIST_OS) $(ENV_DIST_ARCH)"
@echo "~> make distTestOSTar - build dist at $(ROOT_TEST_OS_DIST_PATH) as: $(ENV_DIST_OS) $(ENV_DIST_ARCH) and tar"
@echo "~> make distRelease - build dist at $(ROOT_REPO_DIST_PATH) in local OS"
@echo "~> make distReleaseOS - build dist at $(ROOT_REPO_OS_DIST_PATH) as: $(ENV_DIST_OS) $(ENV_DIST_ARCH)"
@echo "~> make distReleaseOSTar - build dist at $(ROOT_REPO_OS_DIST_PATH) as: $(ENV_DIST_OS) $(ENV_DIST_ARCH) and tar"
@echo ""