-
Notifications
You must be signed in to change notification settings - Fork 39
406 lines (355 loc) · 21.5 KB
/
ha-tests.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
name: HA tests
on:
push:
pull_request:
branches: [ devel ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 2 * * 6'
jobs:
ha_django_mariadb_tests:
name: "ha_django_mariadb_tests"
runs-on: ubuntu-latest
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: Retrieve Version from version.py
run: |
echo TAG_NAME=$(cat acme_srv/version.py | grep -i __version__ | head -n 1 | sed 's/__version__ = //g' | sed s/\'//g) >> $GITHUB_ENV
- run: echo "Latest tag is ${{ env.TAG_NAME }}"
- name: update version number in spec file
run: |
# sudo sed -i "s/Source0:.*/Source0: %{name}-%{version}.tar.gz/g" examples/install_scripts/rpm/acme2certifier.spec
sudo sed -i "s/__version__/${{ env.TAG_NAME }}/g" examples/install_scripts/rpm/acme2certifier.spec
cat examples/install_scripts/rpm/acme2certifier.spec
- name: build RPM package
id: rpm
uses: grindsa/rpmbuild@alma9
with:
spec_file: "examples/install_scripts/rpm/acme2certifier.spec"
- run: echo "path is ${{ steps.rpm.outputs.rpm_dir_path }}"
- name: "Setup environment"
run: |
docker network create acme
sudo mkdir -p data
sudo chmod -R 777 data
sudo cp ${{ steps.rpm.outputs.rpm_dir_path }}noarch/acme2certifier-${{ env.TAG_NAME }}-1.0.noarch.rpm data
# sudo cp examples/Docker/almalinux-systemd/rpm_tester.sh data
sudo mkdir -p $PWD/lego
sudo mkdir -p $PWD/certbot
sudo mkdir -p $PWD/acme-sh
- name: "Bring up Almalinux instance"
run: |
sudo cp examples/Docker/almalinux-systemd/Dockerfile data
cat data/Dockerfile | docker build -t almalinux-systemd -f - . --no-cache
docker run -d -id --rm --privileged --network acme --name=alma9-c1 -v "$(pwd)/data":/tmp/acme2certifier almalinux-systemd
docker run -d -id --rm --privileged --network acme --name=alma9-c2 -v "$(pwd)/data":/tmp/acme2certifier almalinux-systemd
- name: "Prepare almalinux instances"
run: |
docker exec alma9-c1 yum -y install openssh-server openssh-clients procps rsyslog
docker exec alma9-c1 systemctl enable sshd
docker exec alma9-c1 systemctl start sshd
docker exec alma9-c1 systemctl start rsyslog
docker exec alma9-c1 yum install -y epel-release
docker exec alma9-c2 yum -y install openssh-server openssh-clients procps rsyslog
docker exec alma9-c2 systemctl enable sshd
docker exec alma9-c2 systemctl start rsyslog
docker exec alma9-c2 systemctl start sshd
docker exec alma9-c2 yum install -y epel-release
- name: "Prepare ssh users"
run: |
ssh-keygen -t rsa -N '' -f data/id_lsyncd_alma9-c1
ssh-keygen -t rsa -N '' -f data/id_lsyncd_alma9-c2
docker exec alma9-c1 rm /run/nologin
docker exec alma9-c1 mkdir -p /root/.ssh
docker exec alma9-c1 chmod 700 /root/.ssh
docker exec alma9-c1 cp /tmp/acme2certifier/id_lsyncd_alma9-c1 /root/.ssh/id_lsyncd
docker exec alma9-c1 cp /tmp/acme2certifier/id_lsyncd_alma9-c1.pub /root/.ssh/id_lsyncd.pub
docker exec alma9-c1 cp /tmp/acme2certifier/id_lsyncd_alma9-c2.pub /root/.ssh/authorized_keys
docker exec alma9-c1 chmod 600 /root/.ssh/id_lsyncd
docker exec alma9-c1 chmod 600 /root/.ssh/authorized_keys
docker exec alma9-c2 rm /run/nologin
docker exec alma9-c2 mkdir -p /root/.ssh
docker exec alma9-c2 chmod 700 /root/.ssh
docker exec alma9-c2 cp /tmp/acme2certifier/id_lsyncd_alma9-c2 /root/.ssh/id_lsyncd
docker exec alma9-c2 cp /tmp/acme2certifier/id_lsyncd_alma9-c2.pub /root/.ssh/id_lsyncd.pub
docker exec alma9-c2 cp /tmp/acme2certifier/id_lsyncd_alma9-c1.pub /root/.ssh/authorized_keys
docker exec alma9-c2 chmod 600 /root/.ssh/id_lsyncd
docker exec alma9-c2 chmod 600 /root/.ssh/authorized_keys
- name: "Configure mariadb on alma9-c1"
run: |
docker exec alma9-c1 yum install -y mariadb-server
docker exec alma9-c1 systemctl enable mariadb
docker exec alma9-c1 sed -i "s#pid-file=/run/mariadb/mariadb.pid#pid-file=/run/mariadb/mariadb.pid\nserver-id = 1\nreport_host = alma9-c1\nlog_bin = /var/log/mariadb/mariadb-bin\nlog_bin_index = /var/log/mariadb/mariadb-bin.index\nrelay_log = /var/log/mariadb/relay-bin\nrelay_log_index = /var/log/mariadb/relay-bin.index\nlog-slave-updates\nauto_increment_increment=2\nauto_increment_offset=1#g" /etc/my.cnf.d/mariadb-server.cnf
docker exec alma9-c1 systemctl restart mariadb
docker exec alma9-c1 mysql -u root -e"CREATE USER 'replusr'@'%' IDENTIFIED BY 'replpasswd';"
docker exec alma9-c1 mysql -u root -e"GRANT REPLICATION SLAVE ON *.* TO 'replusr'@'%';"
docker exec alma9-c1 mysql -u root -e"FLUSH PRIVILEGES;"
docker exec alma9-c1 mysql -u root -e"SHOW MASTER STATUS\G;" | grep File | awk '{print $2}'
docker exec alma9-c1 mysql -u root -e"SHOW MASTER STATUS\G;" | grep Position | awk '{print $2}'
echo FILE_NAME=$(docker exec alma9-c1 mysql -u root -e"SHOW MASTER STATUS\G;" | grep File | awk '{print $2}') >> $GITHUB_ENV
echo POSITION=$(docker exec alma9-c1 mysql -u root -e"SHOW MASTER STATUS\G;" | grep Position | awk '{print $2}') >> $GITHUB_ENV
- run: echo "FILE_NAME is ${{ env.FILE_NAME }}"
- run: echo "POSITION tag is ${{ env.POSITION }}"
- name: "Configure mariadb on alma9-c2"
run: |
docker exec alma9-c2 yum install -y mariadb-server
docker exec alma9-c2 systemctl enable mariadb
docker exec alma9-c2 sed -i "s#pid-file=/run/mariadb/mariadb.pid#pid-file=/run/mariadb/mariadb.pid\nserver-id = 2\nreport_host = alma9-c2\nlog_bin = /var/log/mariadb/mariadb-bin\nlog_bin_index = /var/log/mariadb/mariadb-bin.index\nrelay_log = /var/log/mariadb/relay-bin\nrelay_log_index = /var/log/mariadb/relay-bin.index\nlog-slave-updates\nauto_increment_increment=2\nauto_increment_offset=2#g" /etc/my.cnf.d/mariadb-server.cnf
docker exec alma9-c2 systemctl restart mariadb
docker exec alma9-c2 mysql -u root -e"CREATE USER 'replusr'@'%' IDENTIFIED BY 'replpasswd';"
docker exec alma9-c2 mysql -u root -e"GRANT REPLICATION SLAVE ON *.* TO 'replusr'@'%';"
docker exec alma9-c2 mysql -u root -e"FLUSH PRIVILEGES;"
- name: "Configure master-master replication on alma9-c2"
run: |
docker exec alma9-c2 mysql -u root -e"STOP SLAVE;"
docker exec alma9-c2 mysql -u root -e"CHANGE MASTER TO MASTER_HOST='alma9-c1.acme', MASTER_USER='replusr', MASTER_PASSWORD='replpasswd', MASTER_LOG_FILE='$FILE_NAME', MASTER_LOG_POS=$POSITION;"
docker exec alma9-c2 mysql -u root -e"START SLAVE;"
env:
FILE_NAME: ${{ env.FILE_NAME }}
POSITION: ${{ env.POSITION }}
- name: "Check replication status on alma9-c2"
run: |
docker exec alma9-c2 mysql -u root -e"SHOW SLAVE STATUS\G;"
docker exec alma9-c2 mysql -u root -e"SHOW SLAVE STATUS\G;" | grep "Slave_IO_Running: Yes"
docker exec alma9-c2 mysql -u root -e"SHOW SLAVE STATUS\G;" | grep "Slave_SQL_Running: Yes"
- name: "Configure master-master replication on alma9-c1"
run: |
docker exec alma9-c1 mysql -u root -e"STOP SLAVE;"
docker exec alma9-c1 mysql -u root -e"CHANGE MASTER TO MASTER_HOST='alma9-c2.acme', MASTER_USER='replusr', MASTER_PASSWORD='replpasswd', MASTER_LOG_FILE='$FILE_NAME', MASTER_LOG_POS=$POSITION;"
docker exec alma9-c1 mysql -u root -e"START SLAVE;"
env:
FILE_NAME: ${{ env.FILE_NAME }}
POSITION: ${{ env.POSITION }}
- name: "Check replication status on alma9-c1"
run: |
docker exec alma9-c1 mysql -u root -e"SHOW SLAVE STATUS\G;"
docker exec alma9-c1 mysql -u root -e"SHOW SLAVE STATUS\G;" | grep "Slave_IO_Running: Yes"
docker exec alma9-c1 mysql -u root -e"SHOW SLAVE STATUS\G;" | grep "Slave_SQL_Running: Yes"
- name: "Test replication between cluster nodes"
run: |
docker exec alma9-c1 mysql -u root -e"CREATE DATABASE testdb CHARACTER SET UTF8;"
sleep 3
docker exec alma9-c2 mysql -u root -e"SHOW DATABASES;" | grep testdb
docker exec alma9-c2 mysql -u root -e"DROP DATABASE testdb;"
sleep 3
docker exec alma9-c1 mysql -u root -e"SHOW DATABASES;" | grep testdb -vqz
docker exec alma9-c1 mysql -u root -e"SHOW DATABASES;"
# docker exec alma9-c1 mysql -u root -e"CREATE DATABASE acme2certifier CHARACTER SET UTF8;"
# docker exec alma9-c1 mysql -u root -e"GRANT ALL PRIVILEGES ON acme2certifier.* TO 'acme2certifier'@'%' IDENTIFIED BY '1mmSvDFl';"
# docker exec alma9-c1 mysql -u root -e"FLUSH PRIVILEGES;"
- name: "Install Lcynd"
run: |
docker exec alma9-c1 yum install -y lsyncd
docker exec alma9-c1 mkdir -p /opt/acme2certifier/volume
docker exec alma9-c2 yum install -y lsyncd
docker exec alma9-c2 mkdir -p /opt/acme2certifier/volume
- name: "Configure Lcynd"
run: |
cat <<EOF > data/alma9-c1-lsyncd.conf
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status",
statusInterval = 20,
nodaemon = false
}
sync {
default.rsyncssh,
source = "/opt/acme2certifier/volume/",
host = "alma9-c2",
targetdir = "/opt/acme2certifier/volume/",
rsync = {
rsh = "/usr/bin/ssh -l root -i /root/.ssh/id_lsyncd -o StrictHostKeyChecking=no",
compress = true,
owner = true,
group = true,
archive = true
}
}
EOF
cat <<EOF > data/alma9-c2-lsyncd.conf
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status",
statusInterval = 20,
nodaemon = false
}
sync {
default.rsyncssh,
source = "/opt/acme2certifier/volume/",
host = "alma9-c1",
targetdir = "/opt/acme2certifier/volume/",
rsync = {
rsh = "/usr/bin/ssh -l root -i /root/.ssh/id_lsyncd -o StrictHostKeyChecking=no",
compress = true,
owner = true,
group = true,
archive = true
}
}
EOF
docker exec alma9-c1 cp /tmp/acme2certifier/alma9-c1-lsyncd.conf /etc/lsyncd.conf
docker exec alma9-c2 cp /tmp/acme2certifier/alma9-c2-lsyncd.conf /etc/lsyncd.conf
docker exec alma9-c1 systemctl restart lsyncd
docker exec alma9-c1 systemctl enable lsyncd
docker exec alma9-c2 systemctl restart lsyncd
docker exec alma9-c2 systemctl enable lsyncd
- name: "Test syncronisation between cluster nodes"
run: |
docker exec alma9-c1 touch /opt/acme2certifier/volume/lsycd_test.txt
sleep 20
docker exec alma9-c2 ls /opt/acme2certifier/volume/ | grep -i lsycd_test.txt
docker exec alma9-c2 rm /opt/acme2certifier/volume/lsycd_test.txt
sleep 20
docker exec alma9-c1 ls -la /opt/acme2certifier/volume/ | grep -i lsycd_test.txt -vqz
- name: "Install acme2certifier"
run: |
docker exec alma9-c1 yum install python3-mysqlclient python3-django3 python3-pyyaml -y
docker exec alma9-c1 yum localinstall -y /tmp/acme2certifier/acme2certifier-${{ env.TAG_NAME }}-1.0.noarch.rpm
# docker exec alma9-c1 yum localinstall -y /tmp/acme2certifier/acme2certifier-0.34-1.0.noarch.rpm
docker exec alma9-c1 chown -R nginx /opt/acme2certifier/volume/
docker exec alma9-c1 cp /opt/acme2certifier/examples/nginx/nginx_acme_srv.conf /etc/nginx/conf.d
docker exec alma9-c1 cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
docker exec alma9-c1 sh -c "head -n 37 /etc/nginx/nginx.conf.orig > /etc/nginx/nginx.conf"
docker exec alma9-c1 sh -c "echo '}' >> /etc/nginx/nginx.conf"
docker exec alma9-c1 cp /opt/acme2certifier/examples/db_handler/django_handler.py /opt/acme2certifier/acme_srv/db_handler.py
docker exec alma9-c1 sh -c "cp -r /opt/acme2certifier/examples/django/* /opt/acme2certifier/"
docker exec alma9-c1 rm /opt/acme2certifier/acme_srv/acme_srv.cfg
docker exec alma9-c1 ln -s /opt/acme2certifier/volume/acme_srv.cfg /opt/acme2certifier/acme_srv/
docker exec alma9-c1 systemctl enable acme2certifier
docker exec alma9-c1 systemctl start acme2certifier
docker exec alma9-c1 systemctl enable nginx
docker exec alma9-c1 systemctl start nginx
docker exec alma9-c2 yum install python3-mysqlclient python3-django3 python3-pyyaml -y
docker exec alma9-c2 yum localinstall -y /tmp/acme2certifier/acme2certifier-${{ env.TAG_NAME }}-1.0.noarch.rpm
# docker exec alma9-c2 yum localinstall -y /tmp/acme2certifier/acme2certifier-0.34-1.0.noarch.rpm
docker exec alma9-c2 chown -R nginx /opt/acme2certifier/volume/
docker exec alma9-c2 cp /opt/acme2certifier/examples/nginx/nginx_acme_srv.conf /etc/nginx/conf.d
docker exec alma9-c2 cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
docker exec alma9-c2 sh -c "head -n 37 /etc/nginx/nginx.conf.orig > /etc/nginx/nginx.conf"
docker exec alma9-c2 sh -c "echo '}' >> /etc/nginx/nginx.conf"
docker exec alma9-c2 cp /opt/acme2certifier/examples/db_handler/django_handler.py /opt/acme2certifier/acme_srv/db_handler.py
docker exec alma9-c2 sh -c "cp -r /opt/acme2certifier/examples/django/* /opt/acme2certifier/"
docker exec alma9-c2 rm /opt/acme2certifier/acme_srv/acme_srv.cfg
docker exec alma9-c2 ln -s /opt/acme2certifier/volume/acme_srv.cfg /opt/acme2certifier/acme_srv/
docker exec alma9-c2 systemctl enable acme2certifier
docker exec alma9-c2 systemctl start acme2certifier
docker exec alma9-c2 systemctl enable nginx
docker exec alma9-c2 systemctl start nginx
- name: "Prepare handler configuration"
run: |
sudo mkdir -p data/volume/acme_ca/certs
sudo cp test/ca/sub-ca-key.pem test/ca/sub-ca-crl.pem test/ca/sub-ca-cert.pem test/ca/root-ca-cert.pem data/volume/acme_ca/
sudo cp .github/openssl_ca_handler.py_acme_srv_choosen_handler.cfg data/volume/acme_srv.cfg
sudo sed -i "s#volume/acme_ca/#/opt/acme2certifier/volume/acme_ca/#g" data/volume/acme_srv.cfg
sudo sed -i "s#examples/ca_handler/#/opt/acme2certifier/examples/ca_handler/#g" data/volume/acme_srv.cfg
sudo sed -i "s/challenge_validation_disable: False/challenge_validation_disable: True/g" data/volume/acme_srv.cfg
docker exec alma9-c1 sh -c "cp -r /tmp/acme2certifier/volume/* /opt/acme2certifier/volume/"
docker exec alma9-c1 chown -R nginx.nginx /opt/acme2certifier/volume/
- name: "Profile ${{ secrets.ASA_PROFILE1 }} - Sleep for 20s"
uses: juliangruber/[email protected]
with:
time: 20s
- name: "Configure acme2certifier"
run: |
docker exec alma9-c1 mysql -u root -e"CREATE DATABASE acme2certifier CHARACTER SET UTF8;"
docker exec alma9-c1 mysql -u root -e"GRANT ALL PRIVILEGES ON acme2certifier.* TO 'acme2certifier'@'%' IDENTIFIED BY 'a2cpasswd';"
docker exec alma9-c1 mysql -u root -e"FLUSH PRIVILEGES;"
cp .github/django_settings_mariadb.py data/alma9-c1-settings.py
sudo sed -i "s/mariadbsrv.acme/alma9-c1.acme/g" data/alma9-c1-settings.py
sudo sed -i "s/USE_I18N = True/USE_I18N = False/g" data/alma9-c1-settings.py
sudo sed -i "s/'PASSWORD': '1mmSvDFl'/'PASSWORD': 'a2cpasswd'/g" data/alma9-c1-settings.py
docker exec alma9-c1 cp /tmp/acme2certifier/alma9-c1-settings.py /opt/acme2certifier/acme2certifier/settings.py
docker exec alma9-c1 sh -c "cd /opt/acme2certifier/ && python3 manage.py makemigrations && python3 manage.py migrate && python3 manage.py loaddata acme_srv/fixture/status.yaml"
docker exec alma9-c1 systemctl restart acme2certifier.service
cp .github/django_settings_mariadb.py data/alma9-c2-settings.py
sudo sed -i "s/mariadbsrv.acme/alma9-c2.acme/g" data/alma9-c2-settings.py
sudo sed -i "s/USE_I18N = True/USE_I18N = False/g" data/alma9-c2-settings.py
sudo sed -i "s/'PASSWORD': '1mmSvDFl'/'PASSWORD': 'a2cpasswd'/g" data/alma9-c2-settings.py
docker exec alma9-c2 cp /tmp/acme2certifier/alma9-c2-settings.py /opt/acme2certifier/acme2certifier/settings.py
docker exec alma9-c2 systemctl restart acme2certifier.service
- name: "Sleep for 5s"
uses: juliangruber/[email protected]
with:
time: 5s
- name: "Test acme2certifier on alma9-c1"
run: |
docker run -i --rm --network acme curlimages/curl -f http://alma9-c1.acme/directory
sudo rm -rf lego/
docker run -i -v $PWD/lego:/.lego/ --rm --name lego --network acme goacme/lego -s http://alma9-c1.acme -a --email "[email protected]" -d lego.local --http run
- name: "Test acme2certifier on alma9-c2"
run: |
docker run -i --rm --network acme curlimages/curl -f http://alma9-c2.acme/directory
sudo rm -rf lego/
docker run -i -v $PWD/lego:/.lego/ --rm --name lego --network acme goacme/lego -s http://alma9-c2.acme -a --email "[email protected]" -d lego.local --http run
- name: "Setup and test load-balancer"
run: |
docker run -d --rm --name acme-srv --network acme grindsa/pen:latest -r 80 alma9-c1.acme:80 alma9-c2.acme:80
docker run -i --rm --network acme curlimages/curl -f http://acme-srv.acme/directory
- name: "Create script for mass-testing"
run: |
cat <<EOF > data/mass_test.sh
#!/bin/bash
MAXCOUNTER=100
counter=1
echo "## Start mass-test ##"
until [ \$counter -gt \$MAXCOUNTER ]
do
echo "## Counter \${counter} ##"
sudo rm -rf \$PWD/acme-sh/*
sudo rm -rf \$PWD/lego/*
sudo rm -rf \$PWD/certbot/*
docker run -i -p 80:80 --rm --network acme --name=lego -v \$PWD/lego:/.lego/ goacme/lego -s http://acme-srv.acme -a --email "[email protected]" -d lego01.acme --http run > /dev/null
if [[ $? != 0 ]]; then break; fi
docker run -i -p 80:80 --rm --network acme --name=acme-sh -v \$PWD/acme-sh:/acme.sh neilpang/acme.sh:latest --issue --server http://acme-srv --accountemail '[email protected]' -d acme-sh.acme --standalone --force > /dev/null
if [[ $? != 0 ]]; then break; fi
docker run -i -p 80:80 --rm --network acme --name=certbot -v \$PWD/certbot:/etc/letsencrypt/ certbot/certbot certonly --server http://acme-srv.acme --agree-tos -m '[email protected]' --no-eff-email --standalone --preferred-challenges http -d certbot.acme --cert-name certbot > /dev/null
if [[ $? != 0 ]]; then break; fi
docker run -i -p 80:80 --rm --network acme --name=lego -v \$PWD/lego:/.lego/ goacme/lego -s http://acme-srv.acme -a --email "[email protected]" -d lego01.acme --http run > /dev/null
if [[ $? != 0 ]]; then break; fi
docker run -i -p 80:80 --rm --network acme --name=acme-sh -v \$PWD/acme-sh:/acme.sh neilpang/acme.sh:latest --issue --server http://acme-srv --accountemail '[email protected]' -d acme-sh.acme --standalone --output-insecure --force > /dev/null
if [[ $? != 0 ]]; then break; fi
docker run -i -p 80:80 --rm --network acme --name=certbot -v \$PWD/certbot:/etc/letsencrypt/ certbot/certbot certonly --server http://acme-srv.acme --agree-tos -m '[email protected]' --no-eff-email --standalone --preferred-challenges http -d certbot.acme --cert-name certbot > /dev/null
((counter++))
done
echo "## End mass-test ##"
echo \$counter
echo \$MAXCOUNTER
if [ \$counter -gt \$MAXCOUNTER ]
then
exit 0
else
exit 1
fi
EOF
chmod a+rx data/mass_test.sh
- name: "Sleep for 5s"
uses: juliangruber/[email protected]
with:
time: 5s
- name: "Run mass-test"
run: |
echo "## Run mass-test ##"
data/mass_test.sh
echo "## End mass-test ##"
- name: "[ * ] collecting test logs"
if: ${{ failure() }}
run: |
mkdir -p ${{ github.workspace }}/artifact/upload
# docker exec alma9-c1 tar cvfz /tmp/acme2certifier/alma9-c1-a2c.tgz /opt/acme2certifier
# docker exec alma9-c2 tar cvfz /tmp/acme2certifier/alma9-c2-a2c.tgz /opt/acme2certifier
sudo cp -rp data/ ${{ github.workspace }}/artifact/data/
docker exec alma9-c1 cat /var/log/messages > ${{ github.workspace }}/artifact/alma9-c1-messages.log
docker exec alma9-c1 systemctl status rsyslog.service
# docker exec alma9-c1 journalctl -xeu rsyslog.service
# docker exec alma9-c2 cat /var/log/messages > ${{ github.workspace }}/artifact/alma9-c2-messages.log
# docker exec alma9-c1 cat /var/log/lsyncd/lsyncd.log > ${{ github.workspace }}/artifact/alma9-c1-lsyncd.log
# docker exec alma9-c2 cat /var/log/lsyncd/lsyncd.log > ${{ github.workspace }}/artifact/alma9-c2-lsyncd.log
# sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz data alma9-c1-messages.log alma9-c2-messages.log alma9-c1-lsyncd.log alma9-c2-lsyncd.log
sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz data alma9-c1-messages.log
- name: "[ * ] uploading artificates"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ha_django_mariadb_tests.tar.gz
path: ${{ github.workspace }}/artifact/upload/