-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
144 lines (126 loc) · 4.87 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#==============================================================#
# File : Makefile
# Desc : pgsty/pgsql-rpm repo shortcuts
# Ctime : 2024-07-28
# Mtime : 2024-07-28
# Path : Makefile
# Author : Ruohang Feng ([email protected])
# License : AGPLv3
#==============================================================#
DEVEL_PATH = sv:/data/pgsql-rpm
###############################################################
# 1. Building #
###############################################################
init:
mkdir -p rpm rpm/{el7.x86_64,el8.x86_64,el9.x86_64}
mkdir -p rpm rpm/{el7.aarch64,el8.aarch64,el9.aarch64}
build: build-amd64 build-arm64
build-amd64:
./build rpm/el7.x86_64
./build rpm/el8.x86_64
./build rpm/el9.x86_64
build-arm64:
./build rpm/el7.aarch64
./build rpm/el8.aarch64
./build rpm/el9.aarch64
builds: builds-amd64 builds-arm64
builds-amd64:
./build rpm/el7.x86_64 sign
./build rpm/el8.x86_64 sign
./build rpm/el9.x86_64 sign
builds-arm64:
./build rpm/el7.aarch64 sign
./build rpm/el8.aarch64 sign
./build rpm/el9.aarch64 sign
###############################################################
# 2. Syncing #
###############################################################
# push/pull project to/from building host
push:
rsync -avc ./ $(DEVEL_PATH)/
pushd:
rsync -avc --delete ./ $(DEVEL_PATH)/
pull:
rsync -avc $(DEVEL_PATH)/ ./
pulld:
rsync -avc --delete $(DEVEL_PATH)/ ./
# push SRC to building VMs
push-el: push9 push8 #push7
push7:
rsync -avc --exclude=RPMS --exclude=SRPMS --exclude=BUILD --exclude=BUILDROOT --delete rpmbuild/ el7:~/rpmbuild/
ssh el7 'cp -f ~/rpmbuild/Makefile.el7 ~/rpmbuild/Makefile'
push8:
rsync -avc --exclude=RPMS --exclude=SRPMS --exclude=BUILD --exclude=BUILDROOT --delete rpmbuild/ el8:~/rpmbuild/
push9:
rsync -avc --exclude=RPMS --exclude=SRPMS --exclude=BUILD --exclude=BUILDROOT --delete rpmbuild/ el9:~/rpmbuild/
# fetch RPMS from building VMs
pull-el: pull9 pull8 pull7
pull7:
mkdir -p rpmbuild/RPMS/el7.x86_64/
rsync -avc --delete el7:~/rpmbuild/RPMS/x86_64/ rpmbuild/RPMS/el7.x86_64/ || true
pull8:
mkdir -p rpmbuild/RPMS/el8.x86_64/
rsync -avc --delete el8:~/rpmbuild/RPMS/x86_64/ rpmbuild/RPMS/el8.x86_64/ || true
pull9:
mkdir -p rpmbuild/RPMS/el9.x86_64/
rsync -avc --delete el9:~/rpmbuild/RPMS/x86_64/ rpmbuild/RPMS/el9.x86_64/ || true
pull-ela: pull9 pull8 #pull7
pull7a:
rsync -avc el7:~/rpmbuild/RPMS/x86_64/ rpmbuild/RPMS/el7.aarch64/ || true
pull8a:
rsync -avc el8:~/rpmbuild/RPMS/x86_64/ rpmbuild/RPMS/el8.aarch64/ || true
pull9a:
rsync -avc el9:~/rpmbuild/RPMS/x86_64/ rpmbuild/RPMS/el9.aarch64/ || true
# sync building specs with el VMs
el-dir:
ssh el9 'rpmdev-setuptree'
ssh el8 'rpmdev-setuptree'
ssh el7 'rpmdev-setuptree'
el-spec:
rsync -avc --delete rpmbuild/SPECS/ el7:~/rpmbuild/SPECS/
rsync -avc --delete rpmbuild/SPECS/ el8:~/rpmbuild/SPECS/
rsync -avc --delete rpmbuild/SPECS/ el9:~/rpmbuild/SPECS/
el-src:
rsync -avc rpmbuild/SOURCES/ el7:~/rpmbuild/SOURCES/
rsync -avc rpmbuild/SOURCES/ el8:~/rpmbuild/SOURCES/
rsync -avc rpmbuild/SOURCES/ el9:~/rpmbuild/SOURCES/
# push to building server, then deliver to el building VMs
ps: push-ss
push-ss: push
ssh -t sv "cd /data/pgsql-rpm && make push-el"
psa: push-ssa
push-ssa: push
ssh -t sv "cd /data/pgsql-rpm && make push-el"
pl: pull-ss
pull-ss:
ssh -t sv "cd /data/pgsql-rpm && make pull-el"
rsync -avc --delete $(DEVEL_PATH)/rpmbuild/RPMS/ rpmbuild/RPMS/
pull-rpm:
rsync -avc --delete sv:/data/pgsql-rpm/rpmbuild/RPMS/ rpmbuild/RPMS/
pp: pull-ssp
pull-ssp:
ssh -t sv "cd /data/pgsql-rpm && make pull-el repo7 repo8 repo9"
rsync -avc --delete $(DEVEL_PATH)/rpmbuild/RPMS/ rpmbuild/RPMS/
###############################################################
# 5. Build Repo #
###############################################################
repo7:
mkdir -p rpmbuild/RPMS/el7.x86_64/debug
mv -f rpmbuild/RPMS/el7.x86_64/*debug*.rpm rpmbuild/RPMS/el7.x86_64/debug/ || true
./build rpmbuild/RPMS/el7.x86_64 sign
./build rpmbuild/RPMS/el7.x86_64/debug sign
repo8:
mkdir -p rpmbuild/RPMS/el8.x86_64/debug
mv -f rpmbuild/RPMS/el8.x86_64/*debug*.rpm rpmbuild/RPMS/el8.x86_64/debug/ || true
./build rpmbuild/RPMS/el8.x86_64 sign
./build rpmbuild/RPMS/el8.x86_64/debug sign
repo9:
mkdir -p rpmbuild/RPMS/el9.x86_64/debug
mv -f rpmbuild/RPMS/el9.x86_64/*debug*.rpm rpmbuild/RPMS/el9.x86_64/debug/ || true
./build rpmbuild/RPMS/el9.x86_64 sign
./build rpmbuild/RPMS/el9.x86_64/debug sign
###############################################################
# Inventory #
###############################################################
.PHONY: init build build-amd64 build-arm64 builds builds-amd64 builds-arm64 \
push pushd pull pulld push7 push8 push9 push-el pushss