-
-
Notifications
You must be signed in to change notification settings - Fork 1
227 lines (225 loc) · 12.1 KB
/
ubuntu_pkg_pgsql_self.yml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: CreateUbuntuPgSQLDEBSelf
on:
workflow_dispatch:
inputs:
reason:
description: 'Launch reason'
required: true
default: 'Create Ubuntu packages'
jobs:
ubuntu-trusty-pg:
name: Ubuntu (Trusty)
runs-on: [self-hosted, linux, ubuntu-trusty]
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Delete old binary
run: |
rm -rf ./bin/* 2>/dev/null
rm -f ./include/version.h.win 2>/dev/null
- name: Run create bin, img and styles directory
run: mkdir -p ./bin/win32/dev ./bin/win64/dev ./ui/assets/img ./ui/assets/styles; chmod a+x ./create/bin/*.{sh,pl}
- name: Build zabbix dist
run: |
./bootstrap.sh
./configure
make dbschema
make gettext
make css
make dist
- name: Set variables
run: |
echo "ZABBIX_VERSION=$(cat configure | grep PACKAGE_VERSION= | cut -d = -f2 | tr -d \')" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Extract distr
run: tar -zxf zabbix-${{ env.ZABBIX_VERSION }}.tar.gz
- name: Prepare build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
cat include/version.h | sed "s@define ZABBIX_VERSION_REVISION.*@define ZABBIX_VERSION_REVISION ${GITHUB_SHA_SHORT}@g" > include/version.h.new
mv include/version.h.new include/version.h
cat src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java | sed "s@REVISION = \".*\";@REVISION = \"${GITHUB_SHA_SHORT}\";@g" > src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new
mv src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
cat src/go/pkg/version/version.go | sed "s@ZABBIX_VERSION_REVISION = \".*\"@ZABBIX_VERSION_REVISION = \"${GITHUB_SHA_SHORT}\"@g" > src/go/pkg/version/version.go.new
mv src/go/pkg/version/version.go.new src/go/pkg/version/version.go
cp "../packages/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s).tar.gz" ubuntu.tar.gz
tar -zxf ubuntu.tar.gz
dch -v "1:${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}+$(lsb_release -c -s)" --distribution "$(lsb_release -c -s)" "Release ${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}"
- name: Build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
env:
GO111MODULE: on
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
dpkg-buildpackage -b -k${{ secrets.DBMON_GPG_KEYID }}
- name: Upload deb from dev server
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
scp ../*.deb ${{ secrets.DBMON_REPO_SERVER_USER }}@${{ secrets.DBMON_REPO_SERVER }}:zabbix-dbmon/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s)/
- name: Cleaning up workspace path
run: |
rm -rf "$GITHUB_WORKSPACE/zabbix-${{ env.ZABBIX_VERSION }}" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.deb" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.ddeb" 2>/dev/null
ubuntu-xenial-pg:
name: Ubuntu (Xenial)
runs-on: [self-hosted, linux, ubuntu-xenial]
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Delete old binary
run: |
rm -rf ./bin/* 2>/dev/null
rm -f ./include/version.h.win 2>/dev/null
- name: Run create bin, img and styles directory
run: mkdir -p ./bin/win32/dev ./bin/win64/dev ./ui/assets/img ./ui/assets/styles; chmod a+x ./create/bin/*.{sh,pl}
- name: Build zabbix dist
run: |
./bootstrap.sh
./configure
make dbschema
make gettext
make css
make dist
- name: Set variables
run: |
echo "ZABBIX_VERSION=$(cat configure | grep PACKAGE_VERSION= | cut -d = -f2 | tr -d \')" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Extract distr
run: tar -zxf zabbix-${{ env.ZABBIX_VERSION }}.tar.gz
- name: Prepare build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
cat include/version.h | sed "s@define ZABBIX_VERSION_REVISION.*@define ZABBIX_VERSION_REVISION ${GITHUB_SHA_SHORT}@g" > include/version.h.new
mv include/version.h.new include/version.h
cat src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java | sed "s@REVISION = \".*\";@REVISION = \"${GITHUB_SHA_SHORT}\";@g" > src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new
mv src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
cat src/go/pkg/version/version.go | sed "s@ZABBIX_VERSION_REVISION = \".*\"@ZABBIX_VERSION_REVISION = \"${GITHUB_SHA_SHORT}\"@g" > src/go/pkg/version/version.go.new
mv src/go/pkg/version/version.go.new src/go/pkg/version/version.go
cp "../packages/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s).tar.gz" ubuntu.tar.gz
tar -zxf ubuntu.tar.gz
dch -v "1:${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}+$(lsb_release -c -s)" --distribution "$(lsb_release -c -s)" "Release ${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}"
- name: Build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
env:
GO111MODULE: on
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
dpkg-buildpackage -b -k${{ secrets.DBMON_GPG_KEYID }}
- name: Upload deb from dev server
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
scp ../*.deb ${{ secrets.DBMON_REPO_SERVER_USER }}@${{ secrets.DBMON_REPO_SERVER }}:zabbix-dbmon/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s)/
- name: Cleaning up workspace path
run: |
rm -rf "$GITHUB_WORKSPACE/zabbix-${{ env.ZABBIX_VERSION }}" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.deb" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.ddeb" 2>/dev/null
ubuntu-bionic-pg:
name: Ubuntu (Bionic)
runs-on: [self-hosted, linux, ubuntu-bionic]
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Delete old binary
run: |
rm -rf ./bin/* 2>/dev/null
rm -f ./include/version.h.win 2>/dev/null
- name: Run create bin, img and styles directory
run: mkdir -p ./bin/win32/dev ./bin/win64/dev ./ui/assets/img ./ui/assets/styles; chmod a+x ./create/bin/*.{sh,pl}
- name: Build zabbix dist
run: |
./bootstrap.sh
./configure
make dbschema
make gettext
make css
make dist
- name: Set variables
run: |
echo "ZABBIX_VERSION=$(cat configure | grep PACKAGE_VERSION= | cut -d = -f2 | tr -d \')" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Extract distr
run: tar -zxf zabbix-${{ env.ZABBIX_VERSION }}.tar.gz
- name: Prepare build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
cat include/version.h | sed "s@define ZABBIX_VERSION_REVISION.*@define ZABBIX_VERSION_REVISION ${GITHUB_SHA_SHORT}@g" > include/version.h.new
mv include/version.h.new include/version.h
cat src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java | sed "s@REVISION = \".*\";@REVISION = \"${GITHUB_SHA_SHORT}\";@g" > src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new
mv src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
cat src/go/pkg/version/version.go | sed "s@ZABBIX_VERSION_REVISION = \".*\"@ZABBIX_VERSION_REVISION = \"${GITHUB_SHA_SHORT}\"@g" > src/go/pkg/version/version.go.new
mv src/go/pkg/version/version.go.new src/go/pkg/version/version.go
cp "../packages/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s).tar.gz" ubuntu.tar.gz
tar -zxf ubuntu.tar.gz
dch -v "1:${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}+$(lsb_release -c -s)" --distribution "$(lsb_release -c -s)" "Release ${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}"
- name: Build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
env:
GO111MODULE: on
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
dpkg-buildpackage -b -k${{ secrets.DBMON_GPG_KEYID }}
- name: Upload deb from dev server
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
scp ../*.deb ${{ secrets.DBMON_REPO_SERVER_USER }}@${{ secrets.DBMON_REPO_SERVER }}:zabbix-dbmon/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s)/
- name: Cleaning up workspace path
run: |
rm -rf "$GITHUB_WORKSPACE/zabbix-${{ env.ZABBIX_VERSION }}" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.deb" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.ddeb" 2>/dev/null
ubuntu-focal-pg:
name: Ubuntu (Focal)
runs-on: [self-hosted, linux, ubuntu-focal]
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Delete old binary
run: |
rm -rf ./bin/* 2>/dev/null
rm -f ./include/version.h.win 2>/dev/null
- name: Run create bin, img and styles directory
run: mkdir -p ./bin/win32/dev ./bin/win64/dev ./ui/assets/img ./ui/assets/styles; chmod a+x ./create/bin/*.{sh,pl}
- name: Build zabbix dist
run: |
./bootstrap.sh
./configure
make dbschema
make gettext
make css
make dist
- name: Set variables
run: |
echo "ZABBIX_VERSION=$(cat configure | grep PACKAGE_VERSION= | cut -d = -f2 | tr -d \')" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Extract distr
run: tar -zxf zabbix-${{ env.ZABBIX_VERSION }}.tar.gz
- name: Prepare build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
cat include/version.h | sed "s@define ZABBIX_VERSION_REVISION.*@define ZABBIX_VERSION_REVISION ${GITHUB_SHA_SHORT}@g" > include/version.h.new
mv include/version.h.new include/version.h
cat src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java | sed "s@REVISION = \".*\";@REVISION = \"${GITHUB_SHA_SHORT}\";@g" > src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new
mv src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java.new src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
cat src/go/pkg/version/version.go | sed "s@ZABBIX_VERSION_REVISION = \".*\"@ZABBIX_VERSION_REVISION = \"${GITHUB_SHA_SHORT}\"@g" > src/go/pkg/version/version.go.new
mv src/go/pkg/version/version.go.new src/go/pkg/version/version.go
cp "../packages/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s).tar.gz" ubuntu.tar.gz
tar -zxf ubuntu.tar.gz
dch -v "1:${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}+$(lsb_release -c -s)" --distribution "$(lsb_release -c -s)" "Release ${{ env.ZABBIX_VERSION }}-${{ secrets.DBMON_DEB_SUB_VER }}"
- name: Build DEB
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
env:
GO111MODULE: on
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
dpkg-buildpackage -b -k${{ secrets.DBMON_GPG_KEYID }}
- name: Upload deb from dev server
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }}
run: |
scp ../*.deb ${{ secrets.DBMON_REPO_SERVER_USER }}@${{ secrets.DBMON_REPO_SERVER }}:zabbix-dbmon/$(lsb_release -i -s | tr '[:upper:]' '[:lower:]')_only_pgsql/$(lsb_release -c -s)/
- name: Cleaning up workspace path
run: |
rm -rf "$GITHUB_WORKSPACE/zabbix-${{ env.ZABBIX_VERSION }}" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.deb" 2>/dev/null
rm -f "$GITHUB_WORKSPACE/*.ddeb" 2>/dev/null